I recently created a trivial site locally with Django that I wanted to deploy on my DreamHost shared server. DreamHost has made this process pretty painless by creating an easy-to-follow guide that can be found here. The only problem is that it doesn’t work. After entering in my project name and database info, i got the error message:
Creating project framework… oops, django-admin failed to run!
With nothing to lose (and not wanting to figure out how to get Passenger set up on my own), I dove into their django-setup.py script. As it turns out, the problem is on line 126.
if os.spawnl(os.P_WAIT, "/usr/bin/django-admin.py", "django-admin.py", "startproject", projname) != 0: |
Apparently on DreamHost, django-admin.py has dropped the extension. So if you replace line 126 with the following, everything works great.
if os.spawnl(os.P_WAIT, "/usr/bin/django-admin", "django-admin", "startproject", projname) != 0: |
11 replies on “Fixing DreamHost’s Django Deployment Script”
Boom! That fixed what ailed me! Thanks for helping out struggling django n00bs.
Thanks for pointing me in the right direction here, but oddly it looks like I had the exact opposite problem. The install script now does not include extensions on line 126, but apparently the system now requires them. Adding .py back on made the script set things up just fine for me.
Thanks. Funny thing is that for me the problem was the exact opposite. The script didn’t have the .sh but the command did.
Thanks so much. I had the same issue as Jeremy, I had to add the .py back onto the filename.
[…] 谷歌到这个页面(https://re-cycledair.com/fixing-dreamhosts-django-deployment-script),大意是dreamhost提供的安装脚本与它目前的环境不匹配,vi django-setup.py,找到if os.spawnl(os.P_WAIT, “/usr/bin/django-admin.py”, “django-admin.py”, “startproject”, projname) != 0:,将两个django-admin.py改为django-admin。 […]
Exact same issue as Jeremy. I had to add the .py back on the file names
Thanks for this, i actually had the same problem as Jeremy Sher, sorted now!
Maybe someone should mention this to Dreamhost if they haven’t already…
here are the instructions from dreamhost:
http://wiki.dreamhost.com/Talk:Django#Script_Error_Breaks_Installation
Thank you for writing this! I had to do the reverse and add “.py” to my extension but this saved me some time.
[…] Offers cheap, professional and fast PHP script installation service. Read More… […]