Newbie needs help on setting up Django on subdomain


#1

Hi I would like to get a new Django app to run on a seperate subdomain I’ve created … and I’m following the same steps listed here, that I followed to set up an app on my main domain.

However, I only get as far as running the step up wizard in step 4: python django-setup.py

Then I see this error: “oops, django-admin failed to run!” which happens right after my mysql db is confirmed. There is no other information given about why this might be happening! Can you tell me what’s going on?? Or how to debug this issue… I can’t access /usr/bin/django-admin. Thanks.


#2

Hello, I had the same issue and I’ve managed to figure it out (at least for myself.) The issue is with the following line in django-setup.py

print "Creating project framework... ",
if os.spawnl(os.P_WAIT, "/usr/bin/django-admin", "django-admin", "startproject", projname) != 0:
    print "oops, django-admin failed to run!"
    sys.exit(1)

I’m fairly new to Python and Django but while attempting to run the code from the shell I noticed that os.spawn was returning the code 127 (The code above expects a 0) upon further googling I came across the explanation that return code 127 means it can’t find the command it’s trying to run. I was able to solve the problem by modifying the line to read:

print "Creating project framework... ",
if os.spawnl(os.P_WAIT, "/usr/bin/django-admin.py", "django-admin", "startproject", projname) != 0:
    print "oops, django-admin failed to run!"
    sys.exit(1)

(I added .py to the end of /usr/bin/django-admin)
Once that was done I uploaded the modified file to my server and ran it successfully.

Hope that helps!