Django manage.py returns ValueError: zero length field name in format

79 views
Skip to first unread message

Carlos Quiros

unread,
Jan 5, 2014, 8:50:06 PM1/5/14
to django...@googlegroups.com
Hi,

I am trying to run a Django application in Python 2.6.6 Django==1.5.5 . But when I try to run

python manage.py

I get:

Traceback (most recent call last):
  File "manage.py", line 12, in <module>
    print('Your environment is:"{}"'.format(os.environ['DJANGO_SETTINGS_MODULE']))
ValueError: zero length field name in format

Any idea what is wrong? I am also running the same application in another server but with Python 2.7.5 and it works ok.

Note: DJANGO_SETTINGS_MODULE is an environmental variable in both systems

Thanks,

Carlos



Mario Gudelj

unread,
Jan 5, 2014, 9:14:00 PM1/5/14
to django...@googlegroups.com
Sounds like you need 2.7 or at least 3. Check out this answer on SO http://stackoverflow.com/questions/10054122/valueerror-zero-length-field-name-in-format-python

Can't have print('Your environment is:"{}"'.format(os.environ['DJANGO_SETTINGS_MODULE']))

Should be print('Your environment is:"{0}"'.format(os.environ['DJANGO_SETTINGS_MODULE']))


--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fc3c63a0-ff11-47cd-866f-069683af3ee6%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Jaimin Patel

unread,
Jan 6, 2014, 10:13:47 AM1/6/14
to django...@googlegroups.com
Its highly recommended that you use Python 2.7. It should resolve the issue.

Thanks.

Jaimin Patel

unread,
Jan 6, 2014, 10:16:28 AM1/6/14
to django...@googlegroups.com
Here you can read it, https://docs.djangoproject.com/en/dev/releases/1.5/#python-compatibility

though I agree that is should be working fine with your current setup as it does mention that its compatible with 2.6.5+. However, if its not too much trouble just update to 2.7 and it should work fine. (I had come across this issue in past and python version upgrade fixed for me.)
Reply all
Reply to author
Forward
0 new messages