2

I've just tried to setup and upload my Django project to Dreamhost.

I've followed the answer here : Update new Django and Python 2.7.* with virtualenv on Dreamhost (with passenger)

Everything seemed to have worked fine up to the passenger_wsgi which gives me the error "An error occurred importing your passenger_wsgi.py" I've not had any experience with setting this kind of thing up before.

My current wsgi file

import sys, os
cwd = os.getcwd()
sys.path.append(cwd)
sys.path.append(cwd + '/projectname')

if sys.version < "2.7.5": os.excel("/home/<usr>/<domain.com>/env/bin/python",
    "python2.7.5", *sys.argv)

sys.path.insert(0, '/home/<usr>/<domain.com>/evn/bin')
sys.path.insert(0, '/home/<usr>/<domain.com>/evn/lib/python2.7/site-packages/django')
sys.path.insert(0, '/home/<usr>/<domain.com>/evn/lib/python2.7/site-packages')

os.environ['DJANGO_SETTINGS_MODULE'] = "projectname.settings"
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

where

<usr>

is the Shell user, and

<domain.com> 

is the folder for my domain-

I don't really know how to go about finding the source of the problem here, as I don't even know how I can debug this. I have tried changing some of the file directories in case I had something wrong but have had no luck.

I wonder if it could be something to do with Django being installed onto the Python virtualenv?

Community
  • 1
  • 1
Lookeh
  • 33
  • 3
  • There is no problem with Django into a virtualenv. – MoiTux Apr 27 '14 at 14:50
  • I've been playing about and it's currently not giving the error, but it just hangs. Am I correct in starting the Django server by using the python virtualenv and running manage.py runserver whilst in Shell? – Lookeh Apr 27 '14 at 15:13
  • Yes you should be in the virtualenv since Django only exist there, FYI The 'runserver' command is just to have a lightweight development Web server. – MoiTux Apr 27 '14 at 18:04
  • I think I've sorted my issues will post back if the solution is worth while. – Lookeh Apr 27 '14 at 18:11
  • 1
    Please do post the solution :) – Mosab Ibrahim Jul 13 '14 at 04:18

0 Answers0