diff options
-rwxr-xr-x | apps/manage.py | 18 | ||||
-rw-r--r-- | apps/settings.py | 2 | ||||
-rw-r--r-- | lib/apache2/patchwork.mod_python.conf | 2 |
3 files changed, 9 insertions, 13 deletions
diff --git a/apps/manage.py b/apps/manage.py index 1f6f0ed..f9726f9 100755 --- a/apps/manage.py +++ b/apps/manage.py @@ -1,14 +1,10 @@ -#!/usr/bin/python - +#!/usr/bin/env python +import os import sys -from django.core.management import execute_manager -try: - import settings # Assumed to be in the same directory. -except ImportError: - import sys - sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) - sys.exit(1) - if __name__ == "__main__": - execute_manager(settings) + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") + + from django.core.management import execute_from_command_line + + execute_from_command_line(sys.argv) diff --git a/apps/settings.py b/apps/settings.py index 43a37d8..4bde26b 100644 --- a/apps/settings.py +++ b/apps/settings.py @@ -63,7 +63,7 @@ MIDDLEWARE_CLASSES = ( 'django.middleware.csrf.CsrfViewMiddleware', ) -ROOT_URLCONF = 'apps.urls' +ROOT_URLCONF = 'urls' LOGIN_URL = '/user/login/' LOGIN_REDIRECT_URL = '/user/' diff --git a/lib/apache2/patchwork.mod_python.conf b/lib/apache2/patchwork.mod_python.conf index 6dbb09b..6395738 100644 --- a/lib/apache2/patchwork.mod_python.conf +++ b/lib/apache2/patchwork.mod_python.conf @@ -7,7 +7,7 @@ NameVirtualHost patchwork.example.com:80 <Location "/"> SetHandler python-program PythonHandler django.core.handlers.modpython - PythonPath "['/srv/patchwork/apps', '/srv/patchwork', '/srv/patchwork/lib/python'] + sys.path" + PythonPath "['/srv/patchwork/apps', '/srv/patchwork/lib/python'] + sys.path" SetEnv DJANGO_SETTINGS_MODULE settings </Location> |