Thanks so much for help me with the $DJANGO_SETTINGS_MODULE issue. Now
I just installed the wsgi module and try to use apache 2.2.17 to host
the django project. However, the page always throws error. I checked
the log file and it says there's no module named urls. Seems like
python could not find the 'urls.py' inside my django project
directory. Does this mean that I still haven't got my
$DJANGO_SETTINGS_MODULE set up properly. Below is the error and how I
set the django.wsgi file.
>>>>>>>>>>>>>>>>>>>>>>>>>>
[Fri Jun 03 13:04:28 2011] [notice] SIGHUP received. Attempting to
restart
[Fri Jun 03 13:04:28 2011] [notice] Digest: generating secret for
digest authentication ...
[Fri Jun 03 13:04:28 2011] [notice] Digest: done
[Fri Jun 03 13:04:28 2011] [notice] Apache/2.2.17 (Unix) DAV/2 PHP/
5.3.6 mod_wsgi/3.2 Python/2.7 mod_perl/2.0.4 Perl/v5.12.3 configured
-- resuming normal operations
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] mod_wsgi
(pid=14389): Exception occurred processing WSGI script '/srv/mirnaweb/
apache/django.wsgi'.
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] Traceback (most
recent call last):
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] File "/usr/lib/
python2.7/site-packages/django/core/handlers/wsgi.py", line 248, in
__call__
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] response =
self.get_response(request)
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] File "/usr/lib/
python2.7/site-packages/django/core/handlers/base.py", line 141, in
get_response
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] return
self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] File "/usr/lib/
python2.7/site-packages/django/core/handlers/base.py", line 176, in
handle_uncaught_exception
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] if
resolver.urlconf_module is None:
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] File "/usr/lib/
python2.7/site-packages/django/core/urlresolvers.py", line 239, in
_get_urlconf_module
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1]
self._urlconf_module = import_module(self.urlconf_name)
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] File "/usr/lib/
python2.7/site-packages/django/utils/importlib.py", line 35, in
import_module
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1]
__import__(name)
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] ImportError: No
module named urls
>>>>>>>>>>>>>>>>>>>>
import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'mirnaweb'
import django.core.handlers.wsgi
path = '/srv/mirnaweb'
if path not in sys.path:
sys.path.append(path)
application = django.core.handlers.wsgi.WSGIHandler()
>>>>>>>>>>>>>>>>>>>>>>>>>>
the content of my django project is as below:
>>>>>>>>>>>>>>>>>>>>>>>>>>>
[xxxx@yyyyyy mirnaweb]$ ls
apache __init__.pyc media mirnaweb.pyc scripts
tmp urls.pyc
__init__.py manage.py mirnaweb.py mirnaworkbench template
test.txt urls.py
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment