On Sat, Jun 27, 2009 at 7:04 AM, sheepeatingtaz <sheepeating...@gmail.com>wrote:
> > Hi All, > > I'm new to django, and am working through the tutorial on the > djangoproject site (http://docs.djangoproject.com/en/dev/intro/ > tutorial02/#intro-tutorial02<http://docs.djangoproject.com/en/dev/intro/%0Atutorial02/#intro-tutorial02> > ) > > When I try to edit or create a Poll from the admin page, I get an > error. As the debug mode is quite verbose, I've posted the out put to > pastebin (http://pastebin.ubuntu-uk.org/54224) > FYI, there's a "switch to copy and paste" link which makes the debug information less verbose and gives you something you can paste into an email. > It looks like it is a problem with either the date or time entered - > but it makes no difference what values I put in. Please can someone > take a look at the output and steer me in the right direction? > > I'm running django 1.0.2 from the ubuntu 9.04 repositories, in case > that makes a difference > What about Python level? You've got a mixture of what appears to be Python 2.5, 2.6.2, and who knows what from netbeans-6.5, as reported version and in your Python path: 1. Exception Location: /var/lib/python-support/python2.5/django/forms/fields.py in clean, line 308 2. Python Executable: /usr/bin/python 3. Python Version: 2.6.2 4. Python Path: ['/home/sheepeatingtaz/code/mysite', '/usr/local/netbeans-6.5/python1', '/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload', '/usr/local/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages/Numeric', '/usr/lib/python2.5/site-packages/PIL', '/usr/lib/python2.5 /site-packages/gst-0.10', '/var/lib/python-support/python2.5', '/usr/lib/python2.5/site-packages/gtk-2.0', '/var/lib/python-support/python2.5/gtk-2.0', '/home/sheepeatingtaz/code/mysite', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/local/lib/python2.6/site-packages'] The exception is "Attribute Error" on _strptime_time, raised on an innocuous line of code: return datetime.date(*time.strptime(value, format)[:3]) that's line 308 of /var/lib/python-support/python2.5/django/forms/fields.py. With a valid Python install/path, there's no way that line of code should raise that AttributeError, so I suspect your Python install is broken as a result of (partially?) installing 2.6.2 on top of 2.5 yet keeping 2.5 in the path ahead of 2.6.2, or something. Try importing "time" and calling time.strptime in a Python shell -- the values Django was trying to use here are u'2009-06-27' for value and '%Y-%m-%d' for format (though I'd guess it doesn't really matter what values exactly are used). I suspect you'll get the same exception in the shell. Until you fix your base Python to work properly for calls like that Django is going to have trouble. Karen --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---