Forums

Can't get django to run

Hi, I'm trying to deploy my first Django application on pythonanywhere. I believe I deleted the instructions from wsgi.py to run my virtualenv.

# +++++++++++ VIRTUALENV +++++++++++
# If you want to use a virtualenv, set its path on the web app setup tab.
# Then come back here and import your application object as per the
# instructions below
# +++++++++++ CUSTOM WSGI +++++++++++
# If you have a WSGI file that you want to serve using PythonAnywhere, perhaps
# in your home directory under version control, then use something like this:

Running my wsgi.py file with the virtualenv activated, directly from /var/www has some debug statements that lead me to believe its running fine. From reading the forums, I see that I should have something like this inserted above:

activate_this = '/home/username/projectfolder/env/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))

I don't see 'activate_this.py' in either my django project nor my .virtualenv folders. My folder structure is: /home/user/djangoProject

/home/user/.virtualenv/virtualenv

I do have the virtualenv set in the webapp config, with no errors. What am I missing?

Could you check your web app's error log and see what's the most recent error (at the bottom)?

I figured it out, I had actually setup 2 virtualenvs and I had left an empty folder behind. Thanks,

Glad you figured that out!