Al 22/08/12 23:00, En/na Bestrafung ha escrit:
I'm new to Django and though I've dabbled with Linux off and on for a
decade I'm still learning so please go easy on me. I'm following this
guide
<http://blog.perplexedlabs.com/2008/11/10/setup-python-25-mod_wsgi-and-django-10-on-centos-5-cpanel/>
to setup a Django 1.4.1 test project. So far I've setup Python 2.5 with
MySQL-python-1.2.3 and setuptools, setup mod_wsgi, and edited
.bash_profile. I've downloaded Django 1.4.1 (not trunk) and so far
everything looks good. As soon as I run "django-admin.py startproject
testproject" I receive an error and am having trouble resolving it. I
apologize if this has come up before bet a quick search wasn't helpful.
Thanks in advance for any assistance, the error is below:

    [-bash-3.2 root@server1: /home/username/sites/domain.com] #
    /home/username/sites/domain.com/django/bin/django-admin.py
    startproject testproject
    Traceback (most recent call last):
    File "/home/username/sites/domain.com/django/bin/django-admin.py",
    line 2, in ?
    from django.core import management
    File "/home/username/sites/domain.com/django/__init__.py", line 15
    parts = 2 if version[2] == 0 else 3
    ^
    SyntaxError: invalid syntax
    [-bash-3.2 root@server1: /home/username/sites/domain.com] #

The "var = value if predicate else value" syntax was introduce in python 2.5, so it seems like the python interpreter that's being used to run django-admin.py is older.

Try executing python and look at the version number. Check the shebang in the 'django-admin.py' too.

As a workaround execute:

/path/to/python2.5 /path/to/django-admin.py startproject testproject



HTH

--
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.

Reply via email to