Re: Having trouble understanding Timezone

2016-01-06 Thread Mike Dewhirst
Ryan I too went through USE_TZ and time zones etc but too long ago to remember enough to answer your questions with any authority. However this works for me ... USE_TZ = True TIME_ZONE = 'UTC' At 18:23 (AESummertime) here in Melbourne Australia I just created a new record in my Postgres

404, media files are not served in template during development

2016-01-06 Thread charito.romeo
Hi ALL, I was trying to render user-uploaded media files into the template but it throws out a 404 only on the media files. The all other context variables are rendered except the media files. I am using django 1.9.1 and python 2.7.9. Here's the settings file. I only included the code

Re: Having trouble understanding Timezone

2016-01-06 Thread Avraham Serour
1. you don't need to st the TIME_ZONE setting, leave at default 2. honestly I don't know how setting the timezone in postgres influences the data, but I believe it doesn't need to be in sync with django settings. 3. yes, this is a good recommendation success Avraham On Thu, Jan 7, 2016 at 5:36

passing list of objects as manytomany field type in django

2016-01-06 Thread Akash Tomar
I want to know if we can pass a list of objects (in this case list of blog objects to the Entry model as the manytomany object parameter). On doing so i am not getting the desired result. Please help. models.py class Blog(models.Model): id=models.AutoField(primary_key=True) class

Having trouble understanding Timezone

2016-01-06 Thread Ryan Causey
Hello, I'm new to Python and Django so please bear with me on this one. I've been reading the Django docs, googling, and searching this mailing list on the proper configuration and usage of Django when USE_TZ = True. However, I'm still a bit fuzzy on things and would like clarification on the

Re: Working with Django signals

2016-01-06 Thread Bernardo Garcia
Hi luisza I've choose work overriding the save() method of the AbstractUser class, instead of apply the post_save() signal to the create_profile_for_new_use function. According to the prevouos mentioned, my User MedicalProfile, PatientProfile y PhisiotherapystProfile models stayed so:

Re: Choice and choice

2016-01-06 Thread Mario R. Osorio
Choice is a class and choice is an instance of that class. You might want to check your knowledge of python before trying django... On Wednesday, January 6, 2016 at 8:07:16 AM UTC-5, 林攀 wrote: > > > dear: > in djano the first app what is difference between Choice and > choice ? I

Amazon + Django each 12 hours appears that [Errno 5] Input/output error

2016-01-06 Thread Bernardo Garcia
I recently setup and deploy an Amazon EC2 instance for deploy my django project. I was interacting with my application via browser when I get this error in the browser: errno 5 input/output error django This error did reference to some function of my application, but in my console

Re: Conditional annotation super slow

2016-01-06 Thread Simon Charette
Hi Mark, I suppose you opened #26045 about the same issue. Are you using PostgreSQL? If it's the case the issue I suppose the issue is fixed in Django 1.9 . Simon

Re: Error while loading data from fixture

2016-01-06 Thread Parijatha Kumar Pasupuleti
I've posted this question in stackoverflow at http://stackoverflow.com/questions/34636107/error-while-loading-data-from-fixture. The solution was posted by one Alasdair. For reference, his answer is pasted below ... " The natural_key

Re: Update model field after a certain period

2016-01-06 Thread 'Tom Evans' via Django users
On Wed, Jan 6, 2016 at 9:39 AM, wrote: > I have a Django model with a Boolean field called New. During the model > creation it's set to True, but I want it to be updated automatically to > False after a certain period (1 month post creation for example). Can I use

Re: Update model field after a certain period

2016-01-06 Thread Mark Harley
One option would be to create a custom management command (https://docs.djangoproject.com/en/1.9/howto/custom-management-commands/) that checks for models with a `created_at < now - 1month`. You could then run this, say once a day, using crontab (https://help.ubuntu.com/community/CronHowto).

Error while loading data from fixture

2016-01-06 Thread Parijatha Kumar Pasupuleti
Hai ! I have the following model and manager. *class StateManager(models.Manager):def get_by_natural_key(self, name):return self.get(name=name)class State(models.Model):class Meta:verbose_name = "State"

Re: Steadman

2016-01-06 Thread Jon Atkinson
I've alerted Mark off-list. --Jon On Wed, Jan 6, 2016 at 1:02 PM, Avraham Serour wrote: > virus people, don't click the link > > On Wed, Jan 6, 2016 at 2:29 PM, Steadman wrote: > >> Please find the attached document referred to the mail subject. >> >>

Re: Conditional annotation super slow

2016-01-06 Thread Mark
I've run query manually removing all fields from GROUP BY that are not related to aggregation and query runs fast. But how to do the same in Django? How to remove unrelated fields to the aggregation from GROUP BY clause? -- You received this message because you are subscribed to the Google

../manage.py makemessages -l zh_CN do not create file

2016-01-06 Thread nie_kl
I am using Django for a web app.Today I used command : ../manage.py makemessages -l zh_CN to create the .po file.But nothing hanppend without printing the processing locale zh_CN Why?In my settins.py,all things about I18N was set. LANGUAGE_CODE = 'zh-hans' TIME_ZONE = 'Asia/Shanghai'

Update model field after a certain period

2016-01-06 Thread salma . essalmani . wbc
I have a Django model with a Boolean field called New. During the model creation it's set to True, but I want it to be updated automatically to False after a certain period (1 month post creation for example). Can I use signals here? -- You received this message because you are subscribed to

Choice and choice

2016-01-06 Thread 林攀
dear: in djano the first app what is difference between Choice and choice ? I feel confused! -- 林攀 -- 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

Re: Steadman

2016-01-06 Thread Avraham Serour
virus people, don't click the link On Wed, Jan 6, 2016 at 2:29 PM, Steadman wrote: > Please find the attached document referred to the mail subject. > > Steadman.io > Blog | Podcasts | Twitter >

Conditional annotation super slow

2016-01-06 Thread Mark
I'm using django's (1.8.5) conditional annotation in order to add filtered data to each object dynamically. But the issue is that it's very slow on all machines I've tested it. What it does is basically adds data to each user. How many messages they sent from provided date, how many messages

Steadman

2016-01-06 Thread Steadman
Please find the attached document referred to the mail subject. Steadman.io Blog | Podcasts | Twitter | Facebook I do a *live podcast* every Monday night

Re: Debugging Django with Debug set to False

2016-01-06 Thread Dheerendra Rathor
What I do is to log things in log files. All exceptions are logged in error.log files and I've enabled admin mail which sends me an email whenever there is an exception. So basically logs and emails are quite helpful in debugging and makes it smooth. On Wed, 6 Jan 2016 at 10:20 Web Architect