Failed to start my Django site (version 1.6) on Apache server

I am running a site that previously ran on django 1.4, but now I have moved it to django 1.6.

I can run my site on both versions using the python manage.py shell.

I use it well on Apache when I hold the python path of the django 1.4 virtual environment on the Apache site, but it does not work when I hold the python path of the django 1.6 virtual environment.

For django 1.6, it causes an error:

Incorrect Configured: The requested DEBUG parameter, but the settings are not configured. You must either define the DJANGO_SETTINGS_MODULE environment variable, or call the settings.configure () parameters before accessing the settings

What could be the problem? Any changes needed in the wsgi.py file for django 1.6? Please, help.

my virtual host file:

<VirtualHost *:80>
    ServerAdmin vidya.sagar0911@gmail.com
    DocumentRoot /home/vidya/workspace/vidya/vidya_rose/cms/trunk/demo/
    ServerName www.vidblog.com
    <Directory /home/vidya/workspace/vidya/vidya_rose/cms/trunk/demo>
            #Order deny,allow
            #Allow from all
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    Alias /media /home/vidya/workspace/vidya/vidya_rose/cms/trunk/demo/vidyamedia/
    Alias /static /home/vidya/workspace/vidya/vidya_rose/cms/trunk/demo/static/
    WSGIDaemonProcess www.demo.com user=www-data group=www-data processes=8 threads=75\
    python-path=/home/vidya/workspace/djnago1.6/lib/python2.7/site-packages
    WSGIProcessGroup www.vidblog.com
    WSGIScriptAlias / /home/vidya/workspace/vidya/vidya_rose/cms/trunk/demo/demo/wsgi.py
</VirtualHost>
+3
source share
1 answer

This is a problem when you transfer old projects from django-1.x (<1.6) to django-1.6 , you need to define DJANGO_SETTINGS_MODULE before calling get_wsgi_application

import os
import sys

sys.path.append(os.path.dirname(os.path.dirname(__file__)))
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "yourproject.settings")

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
+6
source

All Articles