Re: help with time

2012-03-02 Thread Scott Macri
OK, I guess a better question is how do I switch my time outputs using datetime.time from 24-hour clock to 12-hour clock so I can use am/pm? On Sat, Mar 3, 2012 at 12:13 AM, 赵帅 wrote: > You can change the contents of TIME_CHOICES,every time before render one > template, since django render one fo

Re: help with time

2012-03-02 Thread 赵帅
You can change the contents of TIME_CHOICES,every time before render one template, since django render one form up to the attribute of the form . 2012/3/3 Scott Macri > OK, I'm experimenting with time. To be specific datetime.time. My > goal is to generate a list of times in a pull down menu s

help with time

2012-03-02 Thread Scott Macri
OK, I'm experimenting with time. To be specific datetime.time. My goal is to generate a list of times in a pull down menu so when the user saves the form it populates the db with the proper type. In order to use a model with choices, which is what I've done, I have to do something like this: TI

Re: Adding ImageField to Existing Models Results in Errors...and Confusion

2012-03-02 Thread 赵帅
"no such column: report_userprofile.profile_pic" This error suggests that your database table has no such column profile_pic. After you add one column in the model of django,you have to add the according column with proper column type for the table.Django won't do it for you. You can refer to http

Re: Automated Processes

2012-03-02 Thread Scott Macri
Awsome, cron it is! Thanks. :) On Fri, Mar 2, 2012 at 11:48 PM, Russell Keith-Magee wrote: > > On 03/03/2012, at 4:10 AM, Scott Macri wrote: > >> I'm trying to figure out the best way to create an automated in a >> python/django web application.  My intention is to send an email >> message in t

Re: Is it time to start sqlite3 DB from scratch?

2012-03-02 Thread Shawn Milochik
You're welcome. To clarify, South is wonderful. It's sqlite that is the problem. The migrations only fail because sqlite doesn't support all normal SQL commands. I love sqlite, but it's not always the best solution. -- You received this message because you are subscribed to the Google Groups "

Re: Django, nginx, Passenger

2012-03-02 Thread 赵帅
I suggest you do a pressure test on the url that have triggered the problem to see whether it will show up again.If yes, to see the system status such as the number of sockets being used and the number of connections from nginx to fastcgi service in the status of waiting to be accepted. 2012/3/3 D

Re: Error on Tutorial Part 3 - https://docs.djangoproject.com/en/1.3/intro/tutorial03/

2012-03-02 Thread sillyou su
like this: your_project--- |---__init__.py |---settings.py |---urls.py |---manage.py |---app_A--- | |---__init__.py

Re: Automated Processes

2012-03-02 Thread Russell Keith-Magee
On 03/03/2012, at 4:10 AM, Scott Macri wrote: > I'm trying to figure out the best way to create an automated in a > python/django web application. My intention is to send an email > message in the future based on the given future date/time. What is > the best approach to do this? > > I was thi

Re: Is it time to start sqlite3 DB from scratch?

2012-03-02 Thread DF
The solution appears the have been simple: delete the offending tables. I have not tried to upload an actual image yet yet everything appears 9knock wood) to be working properly thus far. Thanks for the advice, especially about how South isn't so friendly with sqlite3! On Mar 2, 10:02 pm, DF wr

Re: Is it time to start sqlite3 DB from scratch?

2012-03-02 Thread DF
Thanks. I'm having a bear of a time after I added an ImageFile and media folder and then tried to make a migration with South (made another post about this). I figure it might be best to just chuck it and start again. On Mar 2, 9:59 pm, Shawn Milochik wrote: > On 03/02/2012 09:55 PM, DF wrote: >

Re: Is it time to start sqlite3 DB from scratch?

2012-03-02 Thread Shawn Milochik
On 03/02/2012 09:55 PM, DF wrote: Thanks. Still not sure how to wipe the database before starting fresh with South. If it's a sqlite database you just delete the file. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, se

Re: Is it time to start sqlite3 DB from scratch?

2012-03-02 Thread DF
Thanks. Still not sure how to wipe the database before starting fresh with South. On Mar 2, 8:50 pm, Shawn Milochik wrote: > If it's dummy data then you can always wipe it and reset South. > > There are some issues with sqlite. Not all constraints are enforced and > it doesn't support removing fi

Adding ImageField to Existing Models Results in Errors...and Confusion

2012-03-02 Thread DF
I'm currently working on my first Django project and have hit a roadblock in regard to adding an ImageField to an existing model. I currently have a model for a user posting content and one for django- profiles. For the former, I added an ImageField so the used can submit a photo to accompany the

Re: Is it time to start sqlite3 DB from scratch?

2012-03-02 Thread Shawn Milochik
If it's dummy data then you can always wipe it and reset South. There are some issues with sqlite. Not all constraints are enforced and it doesn't support removing fields, for two biggies. So you can't delete a field from a model (the migration will fail), and you can't use the 'unique_togethe

Is it time to start sqlite3 DB from scratch?

2012-03-02 Thread DF
I've been working on my first project for about a month now and have had to iterate various models through the process, which is typical, especially the first time. I just started using South about a week or so ago and it's been giving me some problematic returns as I add new fields to the models,

Extra data for form(set) display?

2012-03-02 Thread Carsten Fuchs
Hi all, using a formset with a large number of forms, I would like to add "extra data" to each of the forms that I can render in the template as read-only info near the fields of the related form. For example, let's assume we have a formset with one form for each day in the month, and each f

Django, nginx, Passenger

2012-03-02 Thread Daniele Procida
We're having a devil of a time with our new server, which went live yesterday after two months of testing. Every so often, nginx will display a 502 gateway error page, and something like this will appear in the logs: 2012/03/02 18:05:38 [error] 29743#0: *1479 upstream prematurely closed connec

Re: Error on Tutorial Part 3 - https://docs.djangoproject.com/en/1.3/intro/tutorial03/

2012-03-02 Thread Sami Balbaky
Thank you for the clarification DR. I finished the beginning tutorial on djangoproject.com. I'm certainly going to need a lot more practice. I'll fix my code with your changes. Best, SB On Fri, Mar 2, 2012 at 2:21 PM, Daniel Roseman wrote: > On Friday, 2 March 2012 21:47:54 UTC, Django_for_SB w

Re: Error on Tutorial Part 3 - https://docs.djangoproject.com/en/1.3/intro/tutorial03/

2012-03-02 Thread Daniel Roseman
On Friday, 2 March 2012 21:47:54 UTC, Django_for_SB wrote: > > Thank you everyone for your very insightful and helps remarks. I had 2 > issues with my code: > > 1) I didn't properly separate my directory strings with commas and > 2) I need to code the directory structure, and the absolute path to

Re: Error on Tutorial Part 3 - https://docs.djangoproject.com/en/1.3/intro/tutorial03/

2012-03-02 Thread Sami Balbaky
Thank you everyone for your very insightful and helps remarks. I had 2 issues with my code: 1) I didn't properly separate my directory strings with commas and 2) I need to code the directory structure, and the absolute path to the file itself. Here is the correct code from within settings.py: TE

Re: Unable to open database file

2012-03-02 Thread Brian Schott
Is the WSGI server running as www-data user, perhaps? Check the permissions on the file with "ls -l". Simple check would be "chmod a+rw " to guarantee that it is writable by www-data. Brian Schott bfsch...@gmail.com On Feb 18, 2012, at 4:24 PM, j...@jsdey.com wrote: > I'm another newbe

Re: best resources for learning django

2012-03-02 Thread Larry Martell
On Fri, Mar 2, 2012 at 2:00 PM, Jonathan Holloway wrote: > I sympathise with you.  I'm following the 1.3 online docs and hacking a site > together at the moment. > > an up to date book would be awesome !!! > > I found looking at example projects on Github very useful. > > Cheers, > Jon. > > -- > Y

Re: best resources for learning django

2012-03-02 Thread Djamel Gasbakid
I find this a very good ressource Django by Example: Django Tutorials - Django by Example 2012/3/2 Jonathan Holloway > I sympathise with you. I'm following the 1.3 online docs and hacking a > site together at the moment. > > an up to date book would be awe

Re: best resources for learning django

2012-03-02 Thread Jonathan Holloway
I sympathise with you. I'm following the 1.3 online docs and hacking a site together at the moment. an up to date book would be awesome !!! I found looking at example projects on Github very useful. Cheers, Jon. -- You received this message because you are subscribed to the Google Groups "Dj

Re: South with multiple virtual hosts

2012-03-02 Thread Greg
As a kind soul nicely pointed out to me elsewhere, I don't have a problem. The migration history is DB specific, so simply run the schemamigration using any settings file, then do the migrate with all settings files. Doh! It's been a long week. On Mar 2, 3:55 pm, Greg wrote: -- You received

Re: Traceback from csrf_exempt in 1.3.1

2012-03-02 Thread Ethan Whitt
I get a 403 error when I comment out csrf_example as such: auth/views.py from django.http import HttpResponse from django.utils import simplejson #from django.views.decorators.csrf import csrf_exempt #@csrf_exempt def json_api(request): return HttpResponse(simplejson.dumps(request), mimetype="a

Re: Django profile

2012-03-02 Thread Bolang
On 03/03/2012 03:33 AM, Denis Darii wrote: 1. http://pinaxproject.com/ 2. http://django-userena.org/ Thanks Denis, Django userena looks very interesting. On Fri, Mar 2, 2012 at 9:26 PM, Bolang mailto:boo.l...@gmail.com>> wrote: Can someone suggest me an application for adding user profi

Re: Django profile

2012-03-02 Thread creecode
Hello Bo, On Friday, March 2, 2012 12:26:05 PM UTC-8, Bo Lang wrote: > > Can someone suggest me an application for adding user profile to django? > I have found > https://bitbucket.org/ubernostrum/django-profiles Give James Bennett's django-profiles a go if you think it will meet your needs. J

Re: Django profile

2012-03-02 Thread Denis Darii
1. http://pinaxproject.com/ 2. http://django-userena.org/ On Fri, Mar 2, 2012 at 9:26 PM, Bolang wrote: > Can someone suggest me an application for adding user profile to django? > I have found > http://code.google.com/p/**django-profile/and > https://b

Django profile

2012-03-02 Thread Bolang
Can someone suggest me an application for adding user profile to django? I have found http://code.google.com/p/django-profile/ and https://bitbucket.org/ubernostrum/django-profiles but those 2 projects don't receive update recently. Thanks -- You received this message because you are subscrib

Re: Automated Processes

2012-03-02 Thread Jamie Lawrence
On Mar 2, 2012, at 12:10 PM, Scott Macri wrote: > I'm trying to figure out the best way to create an automated in a > python/django web application. My intention is to send an email > message in the future based on the given future date/time. What is > the best approach to do this? > > I was t

Re: Automated Processes

2012-03-02 Thread Scott Macri
Sorry, that should read "create an automated process". On Fri, Mar 2, 2012 at 3:10 PM, Scott Macri wrote: > I'm trying to figure out the best way to create an automated in a > python/django web application.  My intention is to send an email > message in the future based on the given future date/t

Automated Processes

2012-03-02 Thread Scott Macri
I'm trying to figure out the best way to create an automated in a python/django web application. My intention is to send an email message in the future based on the given future date/time. What is the best approach to do this? I was thinking of creating a cron job and a python script, but I woul

Re: best resources for learning django

2012-03-02 Thread Zeengr
After reading the django tutorial mentioned above, I recommend reading http://www.djangobook.com/en/2.0/ then start reading more about any topic you need to work with from django documentaion https://docs.djangoproject.com/ On Friday, March 2, 2012 8:11:07 PM UTC+2, arvapo wrote: > > Hi all, >

Registration and Authentication using google accounts.

2012-03-02 Thread Zeengr
Hi, I want to let my users to register using there google accounts so later can communicate with there google apps services like Documents, Picasa , Calendar ... etc. What is your advice. -- You received this message because you are subscribed to the Google Groups "Django users" group. To vi

South with multiple virtual hosts

2012-03-02 Thread Greg
Hi, We have a setup where multiple domains via Apache's VirtualHost are pointed to individual settings.py files using WSGI. Works great. Each domain shares the same codebase and each domain has its own DB specified in the settings file. Again, works great. Now the problem. If I need to do a So

Re: best resources for learning django

2012-03-02 Thread Andre Terra
First of all, welcome to Django! If you're not familiar with python (and specially managing python packages), I recommend you setup a sane development environment. Namely using virtualenv and pip, and optionally mkvirtualenv (if you're not on windows). Having to figure out import errors is usuall

Re: select_related() and RawQuerySet

2012-03-02 Thread akaariai
On Friday, March 2, 2012 7:24:00 PM UTC+2, Tom Evans wrote: > > Hi all > > I have a particular query that requires me to use a RawQuerySet - I > need to left join the table to itself in order to select the highest > 'priority' row from the table for each distinct value of a foreign key > on the mod

Re: best resources for learning django

2012-03-02 Thread Javier Guerra Giraldez
On Fri, Mar 2, 2012 at 1:23 PM, gowtham wrote: > Not sure if it is the best one (would like to here from Pros on this). But > following really helped me to get started. I  finishing this tutorial in 2 > days and the next two days, i started and had a working application (simple > though) for my pr

Re: best resources for learning django

2012-03-02 Thread gowtham
Not sure if it is the best one (would like to here from Pros on this). But following really helped me to get started. I finishing this tutorial in 2 days and the next two days, i started and had a working application (simple though) for my project.. https://docs.djangoproject.com/en/1.2/intro

best resources for learning django

2012-03-02 Thread arvapo
Hi all, Simple question: For a newbie like me, what is (are) the best resource(s) to learn django? books, etc... I just installed version 1.3.1 Looking forward to your replies. Cheers, Arvapo -- You received this message because you are subscribed to the Google Groups "Django users" group. T

Re: UnicodeEncodeError in file uploads

2012-03-02 Thread Andreas Hasenkopf
In some older group post I found a nice django-based solution: Using a customized ImageField instance: class MyImageField(ImageField): def __init__(self, *args, **kwargs): super(MyImageField, self).__init__(*args, **kwargs) def clean(self, *args, **kwargs): data = super(M

Re: UnicodeEncodeError in file uploads

2012-03-02 Thread Andreas Hasenkopf
Hi there, tried upload of file containing file with umlaut in filename on a Ubuntu server with de_DE.UTF8 locale setting. This server also produces a UnicodeEncodeError error. locale -a gives the following output: C en_AG en_AU.utf8 en_BW.utf8 en_CA.utf8 en_DK.utf8 en_GB.utf8 en_HK.utf8 en_IE.utf8

Re: Is GeoDjango Too Much For This?

2012-03-02 Thread Josh Cartmell
I have two quick comments, check out geopy: http://code.google.com/p/geopy/ and this website http://www.movable-type.co.uk/scripts/latlong-db.html Geopy can give you lat/lng for a given address and that other website has formulas for using lat/lng to calculate a bounding box/circle. It may be a

select_related() and RawQuerySet

2012-03-02 Thread Tom Evans
Hi all I have a particular query that requires me to use a RawQuerySet - I need to left join the table to itself in order to select the highest 'priority' row from the table for each distinct value of a foreign key on the model, and I need to join to the related table in order to filter the result

Re: Traceback from csrf_exempt in 1.3.1

2012-03-02 Thread Thomas Orozco
You seem to have no 500.html page. This traceback won't actually show the error that happened, but error out on the fact that it can't find a template to display the 500 error. 1. Are you running DEBUG = True? 2. Wouldn't you rather want to simplejson.dum > > I have never used csrf_exempt before.

Re: Keeping filters when adding in the admin interface

2012-03-02 Thread Mauro Sánchez
El día 2 de marzo de 2012 11:06, Marc Aymerich escribió: > On Fri, Mar 2, 2012 at 2:18 PM, Mauro Sánchez wrote: >> El día 29 de febrero de 2012 19:04, Marc Aymerich >> escribió: >>> On Wed, Feb 29, 2012 at 10:55 PM, Marc Aymerich wrote: On Wed, Feb 29, 2012 at 8:22 PM, Mauro Sánchez wrote

Re: Is GeoDjango Too Much For This?

2012-03-02 Thread Ethan Jucovy
On Mon, Feb 27, 2012 at 11:42 PM, DF wrote: > I'm on a Mac. The Django GeoDjango installation instructions are > somewhat obtuse and there aren't alternative sites I've found with > more straightforward instructions. It's lame that these are confusing > but, well, they are. I will no doubt review

Re: Keeping filters when adding in the admin interface

2012-03-02 Thread Marc Aymerich
On Fri, Mar 2, 2012 at 2:18 PM, Mauro Sánchez wrote: > El día 29 de febrero de 2012 19:04, Marc Aymerich > escribió: >> On Wed, Feb 29, 2012 at 10:55 PM, Marc Aymerich wrote: >>> On Wed, Feb 29, 2012 at 8:22 PM, Mauro Sánchez wrote: Hello, if I have the following Model: class A:

Re: Keeping filters when adding in the admin interface

2012-03-02 Thread Mauro Sánchez
El día 29 de febrero de 2012 19:04, Marc Aymerich escribió: > On Wed, Feb 29, 2012 at 10:55 PM, Marc Aymerich wrote: >> On Wed, Feb 29, 2012 at 8:22 PM, Mauro Sánchez wrote: >>> Hello, if I have the following Model: >>> >>> class A: >>>    name >>> >>> class B: >>>    name >>>    a = models.Fore

Re: Caught TypeError while rendering: __init__() got an unexpected keyword argument 'maxlength'

2012-03-02 Thread Daniel Roseman
On Friday, 2 March 2012 09:56:26 UTC, Vipulb wrote: > > I tried to enable admin and i got this error... > > I am running Django on Ubuntu 11.10 and installed Django using apt-get... > > > > Exception Value: > > Caught TypeError while rendering: __init__() got an unexpected keyword > argument 'max

Caught TypeError while rendering: __init__() got an unexpected keyword argument 'maxlength'

2012-03-02 Thread vipul borikar
I tried to enable admin and i got this error... I am running Django on Ubuntu 11.10 and installed Django using apt-get... Request Method: GET Request URL: http://localhost:8000/admin/ Django Version: 1.3.1 Exception Type: TemplateSyntaxError Exception Value: Caught TypeError while renderin

Traceback from csrf_exempt in 1.3.1

2012-03-02 Thread Ethan Whitt
I have never used csrf_exempt before. I keep experiencing a traceback with 1.3.1, which may be self-induced. Here is my views file: auth/views.py from django.http import HttpResponse from django.utils import simplejson from django.views.decorators.csrf import csrf_exempt @csrf_exempt def json_ap

How does the multiple database concept work after django 1.2

2012-03-02 Thread Amit Sethi
Hi all , My app has started breaking after moving to django 1.3 . I don't really understand why? I am working using site framework and given model definition through app_label. The only majot change as I can see is that I use UUID Fields rather than AutoField. Now somehow i see that my app is try