django stopped working with mod_wsgi/apache -
i can't seem understand why django/apache refuses load django_settings_module inspite of being declared! checked environmental variable loaded through python, , manage.py can create run server without errors settings.
echo $django_settings_module >>> harshp.settings.production apache error log
ah02282: no slotmem mod_heartmonitor ah00489: apache/2.4.12 (unix) openssl/1.0.1k mod_wsgi/3.5 python/2.7.6 configured -- resuming normal operations ah00094: command line: '/opt/bitnami/apache2/bin/httpd -f /opt/bitnami/apache2/conf/httpd.conf' mod_wsgi (pid=7056): exception occurred processing wsgi script '/opt/bitnami/apps/django/django_projects/harshp.com/harshp/wsgi.py'. traceback (most recent call last): file "/opt/bitnami/python/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 170, in __call__ self.load_middleware() file "/opt/bitnami/python/lib/python2.7/site-packages/django/core/handlers/base.py", line 49, in load_middleware middleware_path in settings.middleware_classes: file "/opt/bitnami/python/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__ self._setup(name) file "/opt/bitnami/python/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup % (desc, environment_variable)) improperlyconfigured: requested setting middleware_classes, settings not configured. must either define environment variable django_settings_module or call settings.configure() before accessing settings.~ apache config
wsgiscriptalias / /opt/bitnami/apps/django/django_projects/harshp.com/harshp.wsgi wsgipythonpath /opt/bitnami/apps/django/django_projects/harshp.com <directory /opt/bitnami/apps/django/django_projects/harshp.com/> require granted </directory> wsgi.py
sys.path.append('/opt/bitnami/apps') sys.path.append('/opt/bitnami/apps/django/django_projects/harshp.com') *** edit *** settings typed settngs on os.environ['django_settings_module']='harshp.settings.production' import django.core.handlers.wsgi application = django.core.handlers.wsgi.wsgihandler() httpd-app.conf
<ifdefine !is_djangostack_loaded> define is_djangostack_loaded wsgidaemonprocess wsgi-djangostack processes=2 threads=15 display-name=%{group} </ifdefine> wsgiscriptalias / '/opt/bitnami/apps/django/django_projects/harshp.com/harshp/wsgi.py' <directory "/opt/bitnami/apps/django/django_projects/harshp.com/harshp/"> wsgiprocessgroup wsgi-djangostack wsgiapplicationgroup %{global} <ifversion < 2.3 > order allow,deny allow </ifversion> <ifversion >= 2.3> require granted </ifversion> </directory>
bitnami developer here. think have typo, @ least in code pasting:
os.environ['django_settngs_module']='harshp.settings.production' can try change settngs settings?
Comments
Post a Comment