On 11/09/2012 1:31am, DJ-Tom wrote:
Hi,
I'm new to django and python at the same time (Nightmare <g>) and
currently struggling to get a basic understanding of how everything
works and how the different components are connected to each other.
My setup is a s follows:
- Apache 2.2 running as a service under Windows 7
- mod_wsgi
- Python 2.7.3
- django 1.4.1
- web server docroot under d:\wwwroot
- test project under d:\wwwroot\djtest\djtest set up with
django-admin.py startproject djtest
Basically I think that almost everything is set up correctly, things
like "python manage.py syncdb" work without probkems, I could activate
django.contrib.admin and create the database without errors - only if I
try to access the admin I get the following apache error.log:
mod_wsgi (pid=6804): Exception occurred processing WSGI script
'D:/wwwroot/djtest/djtest/wsgi.py'.
Traceback (most recent call last):
File
"D:\\Python27\\lib\\site-packages\\django\\core\\handlers\\wsgi.py",
line 219, in __call__
self.load_middleware()
File
"D:\\Python27\\lib\\site-packages\\django\\core\\handlers\\base.py",
line 39, in load_middleware
for middleware_path in settings.MIDDLEWARE_CLASSES:
File
"D:\\Python27\\lib\\site-packages\\django\\utils\\functional.py",
line 184, in inner
self._setup()
File
"D:\\Python27\\lib\\site-packages\\django\\conf\\__init__.py", line
42, in _setup
self._wrapped = Settings(settings_module)
File
"D:\\Python27\\lib\\site-packages\\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 'djtest.djtest.settings' (Is
it on sys.path?): No module named djtest.djtest.settings
wsgi.py looks like this:
import os
import sys
path = 'd:/wwwroot/djtest/djtest/'
if path not in sys.path:
sys.path.append(path)
os.environ.setdefault("DJANGO_SETTINGS_MODULE",
"djtest.djtest.settings")
Try dropping this down to "djtest.settings". Also make sure you have a
file in each of your folders called __init__.py
This tells Python the folder is part of the package.
# This application object is used by any WSGI server configured to
use this
# file. This includes Django's development server, if the
WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
HELP! :-)))
--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/fl5wkcGjpuQJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.