WebFaction
Community site: login faq

I'm getting a 500 error when visiting my new app. Looking through the logs I see:

ImportError: Could not import settings 'novabucket.settings' (Is it on sys.path?): No module named novabucket.settings

It seems like it makes it to my wsgi.py file but can't find my project's settings. I followed the Django tutorial for bringing in an existing app. My website is also set up correctly, with the app selected being "Django" and the url being "/". Here are a few dumps:

wsgi.py

import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "novabucket.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

full stack trace of error

mod_wsgi (pid=2360): Exception occurred processing WSGI script '/home/maxmackie/webapps/django/novabucket/novabucket/wsgi.py'.
Traceback (most recent call last):
File "/home/maxmackie/webapps/django/lib/python2.7/django/core/handlers/wsgi.py", line 219, in __call__ self.load_middleware()
File "/home/maxmackie/webapps/django/lib/python2.7/django/core/handlers/base.py", line 39, in load_middleware for middleware_path in settings.MIDDLEWARE_CLASSES:
File "/home/maxmackie/webapps/django/lib/python2.7/django/utils/functional.py", line 184, in inner self._setup()
File "/home/maxmackie/webapps/django/lib/python2.7/django/conf/__init__.py", line 42, in _setup self._wrapped = Settings(settings_module)
File "/home/maxmackie/webapps/django/lib/python2.7/django/conf/__init__.py", line 95, in __init__ raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'novabucket.settings' (Is it on sys.path?): No module named novabucket.settings

http.conf (important part)

WSGIScriptAlias / /home/maxmackie/webapps/django/novabucket/novabucket/wsgi.py

asked 17 Apr '12, 15:42

maxmackie
9346
accept rate: 0%

edited 17 Apr '12, 15:46


You need to edit your wsgi.py file to set the sys.path to include the parent directory that contains your novabucket module, probably like this:

import sys
sys.path.insert(0, '/home/maxmackie/webapps/django/novabucket')

More information is available in our documentation: Adding to sys.path within Python and WSGI Scripts

Be sure to restart your Apache after making these changes.

permanent link

answered 17 Apr '12, 17:02

seanf
12.2k41836
accept rate: 37%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×337
×225
×108
×19

question asked: 17 Apr '12, 15:42

question was seen: 17,108 times

last updated: 17 Apr '12, 17:02

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM