Re: Getting django.db.utils.IntegrityError When migrating data from SQLite to postgreSQL

2016-02-25 Thread vaibhav jain
I have tried everything. I think now my only option is to write a Script which will read the data from SQLite and save it on postgreSQL. But how can I query different DB in Django?? can someone please tell me that. On Wednesday, February 24, 2016 at 5:48:17 PM UTC+5:30, vaibhav jain wrote: > >

strange upload mechanism: CSS not responding

2016-02-25 Thread clarksonchris81
The following is a part of upload-file mechanism in my forms.py: from crispy_forms.layout import Divclass DocumentForm(forms.Form): docfile = forms.FileField(label='Select a BAM file') Div('docfile', style="background: black;", css_class="col-sm-6 col-md-9 col-lg-9") HTML {% crispy fo

strange upload mechanism clashing with crispy forms styling

2016-02-25 Thread clarksonchris81
The following is a part (the rest being in models an views) of an upload-file mechanism in my forms.py: from crispy_forms.layout import Divclass DocumentForm(forms.Form): docfile = forms.FileField(label='Select a BAM file') Div('docfile', style="background: black;", css_class="col-sm-6 co

a question about django admin and language

2016-02-25 Thread Paul Z
Hi, I'm new to django, I try to set up a site that can select language automatically. So, I set as below: LANGUAGE_CODE = 'en' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = False USE_TZ = False For now, It can select language automatically, But, The question is: I don't wa

Can't Get ListView to display result of SQL Query onto Custom Template

2016-02-25 Thread Malik Rumi
*Note- This question was originally posted on SO before I completely understood what my issue was. However, since editing it to reflect the true state of affairs, the silence over there has been deafening. I only mention that because some people don't like it when similar questions are posted

Re: Can't Get ListView to display result of SQL Query onto Custom Template

2016-02-25 Thread Vijay Khemlani
{{ codelist.arrow }} shouldn't you be using the for variable? something like {{ i.arrow }} On Thu, Feb 25, 2016 at 11:19 AM, Malik Rumi wrote: > *Note- This question was originally posted on SO before I completely > understood what my issue was. However, since editing it to reflect the true

Re: Home Page

2016-02-25 Thread Malik Rumi
> I find that in many of your questions you are thinking a bit too hard. I have been accused of that before, so there's probably something to it. What to do about it is another question. On Wed, Feb 24, 2016 at 3:41 PM, Andreas Kuhne wrote: > Malik, > > I find that in many of your questions you

Re: null datetime field and json fixtures

2016-02-25 Thread Malik Rumi
This will probably be very helpful. Thanks. On Wed, Feb 24, 2016 at 3:39 PM, James Schneider wrote: > > > On Wed, Feb 24, 2016 at 11:26 AM, Malik Rumi > wrote: > >> I am pursuing the debug option now to see what I can learn. >> >> >> > > Have you looked at enabling tracebacks (--traceback) and

Re: Can't Get ListView to display result of SQL Query onto Custom Template

2016-02-25 Thread Malik Rumi
I have been struggling with this all week. I posted to SO and got a lot of flack and downvoted - but no *help*. And FOUR MINUTES after I posted, you zeroed in on the problem. Yes, now my code displays on my own template. And you gave me no snark in the process. A true and helpful gentleman. Thank y

LIMIT 1 on model.objects.get()

2016-02-25 Thread Matthew Crowson
When Django creates the SQL to get an object from model.objects.get() it doesn't look like SQL is adding a "LIMIT 1" to the end. As the get method is always intended to return a single item, would adding that to Django's SQL speed things up? -- You received this message because you are subscribed

Re: LIMIT 1 on model.objects.get()

2016-02-25 Thread Karen Tracey
On Thu, Feb 25, 2016 at 10:10 AM, Matthew Crowson < matthew.d.crow...@gmail.com> wrote: When Django creates the SQL to get an object from model.objects.get() it > doesn't look like SQL is adding a "LIMIT 1" to the end. As the get method > is always intended to return a single item, would adding th

Re: LIMIT 1 on model.objects.get()

2016-02-25 Thread Michal Petrucha
On Thu, Feb 25, 2016 at 07:10:31AM -0800, Matthew Crowson wrote: > When Django creates the SQL to get an object from model.objects.get() it > doesn't look like SQL is adding a "LIMIT 1" to the end. As the get method > is always intended to return a single item, would adding that to Django's > SQL s

Managing the Django Sqlite development db with respect to Git

2016-02-25 Thread cortez
Hi, I'm using the out-of-the-box Sqlite database integration with my Django project, and I'm wondering how to manage it with respect to Git. Currently I have it checked in, but I suspect this isn't what I want to be doing. Also I have noticed that every time I log in to the admin interface and

Re: Managing the Django Sqlite development db with respect to Git

2016-02-25 Thread Rafael E. Ferrero
I put my sqlite files into .gitignore. Rafael E. Ferrero 2016-02-25 12:55 GMT-03:00 cortez : > Hi, > > I'm using the out-of-the-box Sqlite database integration with my Django > project, and I'm wondering how to manage it with respect to Git. Currently > I have it checked in, but I suspect this

Managing the Django Sqlite development db with respect to Git

2016-02-25 Thread Daniel Roseman
Why do you want your db in version control at all? There is not normally a good reason to do that. -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to djang

Re: strange upload mechanism clashing with crispy forms styling

2016-02-25 Thread James Schneider
On Thu, Feb 25, 2016 at 4:38 AM, wrote: > The following is a part (the rest being in models an views) of an > upload-file mechanism in my forms.py: > > from crispy_forms.layout import Divclass DocumentForm(forms.Form): >docfile = forms.FileField(label='Select a BAM file') >Div('docfile',

Re: Managing the Django Sqlite development db with respect to Git

2016-02-25 Thread cortez
Well I don't, but I'm not sure what the alternatives are. I mean what I'm interested in are *alternatives* to keeping it under version control, so I have backups, history, versioning. Preferably something I can easily integrate with my Django workflow, without having to manually keep external c

Re: Managing the Django Sqlite development db with respect to Git

2016-02-25 Thread Alex M
Normally for a site you don't keep your db in version control because the table definitions come from Django. Now if you have data to prepopulate (each time you fresh clone) or need to do a backup then use standard db backup mechanisms. Like dumping your db to an sql backup. It's not efficient to

Re: Managing the Django Sqlite development db with respect to Git

2016-02-25 Thread cortez
Thanks Alex, that's great information, I shall dig in. C On Thursday, 25 February 2016 19:33:06 UTC, Alex wrote: > > Normally for a site you don't keep your db in version control because > the table definitions come from Django. Now if you have data to > prepopulate (each time you fresh clone)

Django 1.8 add created_by when upload image in admin

2016-02-25 Thread gerard
Hello all, I'm trying to add the user when upload a file using the admin in Django. The model is: class Image(models.Model): image = models.FileField(upload_to=DIR_IMAGES, max_length=500) created_by = models.ForeignKey(User, related_name='created_by', editable=False) in admin.py, i hav

Reset password working with unregister user and no with register. Why?

2016-02-25 Thread setivolkylany
*urlconf:* from django.conf.urls import url, include, patterns from django.contrib import admin from django.views.generic import TemplateView from django.conf import settings urlpatterns = [ url(r'^$', TemplateView.as_view(template_name="index.html"), {}, 'index'), url(r'^accounts/',

How right will working Ajax and Class-Based views?

2016-02-25 Thread setivolkylany
. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com.

localized_fields in class-based views?

2016-02-25 Thread setivolkylany
How include localized_fields in class-based views? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this gro

URL namespaces

2016-02-25 Thread Malik Rumi
Assuming it can be done, what is the proper way to namespace two models in the same app, where both use slugs in the url but have different views and templates? In the docs, https://docs.djangoproject.com/en/1.9/topics/http/urls/#url-namespaces, it talks about how to do this, but it always r

Re: URL namespaces

2016-02-25 Thread Alex Heyden
Models don't have views. Applications have views. URLs route to views, not models. Include is basically an import for a urls.py file as a whole, so there's no reason to import the same file multiple times unless you wanted it to match multiple URLs. What are you actually trying to do? On Thu, Feb

Re: Alternative Amazon S3?

2016-02-25 Thread Ezequiel Bertti
dreamhost? On Wed, Feb 24, 2016 at 5:16 PM, wrote: > What Alternative Amazon S3 for serve media(uploaded) on website (Heroku > hosting)? > I need only storage for media files because Heroku deleting my files > > -- > You received this message because you are subscribed to the Google Groups > "Dj

Re: Alternative Amazon S3?

2016-02-25 Thread Andrew Pinkham
Heroku should be treated as the stateless portion of an app - do not store long term data there! (Same goes with services like EC2 and Digital Ocean.) Rackspace and Microsoft have cloud alternatives to Amazon that may suit your purposes. Hosting on a shared host like Dreamhost or A Small Orange

Re: Alternative Amazon S3?

2016-02-25 Thread Mario Gudelj
Give cloudinary a go. It's really good especially for images and pdf On Friday, 26 February 2016, Andrew Pinkham wrote: > Heroku should be treated as the stateless portion of an app - do not store > long term data there! (Same goes with services like EC2 and Digital Ocean.) > > Rackspace and Mic

Re: Debugging DJango app on production for High CPU Usage

2016-02-25 Thread Nikolas Stevenson-Molnar
Which cache backend are you using? Also, how's your memory usage? Do the spikes in CPU correlate with load? I.e., does the CPU use increase/decrease consistently with the number of users? On Wednesday, February 24, 2016 at 10:17:24 PM UTC-8, Web Architect wrote: > > Hi Nikolas, > > I am new to u

large json and files

2016-02-25 Thread lindolfo caetano
I'm trying to send a json post for a view, but when it exceeds 50mb it does not work. How configure django to receive post of large files and upload of a large files. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this gro

Re: URL namespaces

2016-02-25 Thread James Schneider
On Thu, Feb 25, 2016 at 12:45 PM, Malik Rumi wrote: > > Assuming it can be done, what is the proper way to namespace two models in > the same app, where both use slugs in the url but have different views and > templates? > > In the docs, > https://docs.djangoproject.com/en/1.9/topics/http/urls/#u

Re: large json and files

2016-02-25 Thread James Schneider
On Thu, Feb 25, 2016 at 12:40 PM, lindolfo caetano < lindolfocaet...@gmail.com> wrote: > I'm trying to send a json post for a view, but when it exceeds 50mb it > does not work. > How configure django to receive post of large files and upload of a large > files. > Without knowing your setup, it's

Re: Debugging DJango app on production for High CPU Usage

2016-02-25 Thread Web Architect
Hi Nikolas, Cache backend is Redis. The CPU usage is directly proportional to the load (increases with the increase in load). Memory usage seems to be fine. Thanks. On Friday, February 26, 2016 at 3:32:23 AM UTC+5:30, Nikolas Stevenson-Molnar wrote: > > Which cache backend are you using? Also,