On 2 April 2011 04:02, Fred <[email protected]> wrote:
> I've got my .wsgi script successfully importing from my django site, but it
> never seems to get to the views.py.
Did you set 'DEBUG=True' in Django settings file. If you do that, you
should get quite informative error page displayed back to the browser
giving information to help debug the problem.
Also, if you are only intending to catch the root index page, you have :
(r'^', 'census.views.index'),
wrong and possibly should just be:
(r'^$', 'census.views.index'),
The order of URL rules is also important. What you had which catch
more than just root page and so if early in urls.py would stop
remaining rules matching.
Try and get DEBUG=True working and this may be come clearer if you are
getting errors.
Graham
> I occurrs to me that I don't see the "magic" that transfers control from the
> WSGIHandler to my django site and I'm wondering if there should be an entry
> in django settings to "tie in" wsgi. The relevant sections of my settings
> file look like this...
> MIDDLEWARE_CLASSES = (
> 'django.middleware.common.CommonMiddleware',
> 'django.contrib.sessions.middleware.SessionMiddleware',
> # 'django.middleware.csrf.CsrfViewMiddleware',
> # 'django.contrib.auth.middleware.AuthenticationMiddleware',
> 'django.contrib.messages.middleware.MessageMiddleware',
> )
>
> ROOT_URLCONF = 'HWdj.urls'
>
> #MEDIA_ROOT = os.path.join(HERE, 'templates')
> TEMPLATE_DIRS = (
> #os.path.join(HERE, 'templates')
> # Put strings here, like "/home/html/django_templates" or
> "C:/www/django/templates".
> # Always use forward slashes, even on Windows.
> # Don't forget to use absolute paths, not relative paths.
> )
>
>
> INSTALLED_APPS = (
> #'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.sites',
> 'django.contrib.messages',
> 'HWdj.census'
> # Uncomment the next line to enable the admin:
> # 'django.contrib.admin',
> )
>
> I also added some logging as suggest and it shows:
> ('ppREQUEST',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> {'DOCUMENT_ROOT': '/var/www/html',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'GATEWAY_INTERFACE': 'CGI/1.1',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121] 'HTTP_ACCEPT':
> 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'HTTP_ACCEPT_LANGUAGE': 'en-us,en;q=0.5',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'HTTP_CONNECTION': 'keep-alive',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121] 'HTTP_HOST':
> 'daffyduck.sunbelt.org',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'HTTP_KEEP_ALIVE': '115',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0)
> Gecko/20100101 Firefox/4.0',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121] 'PATH_INFO':
> '/hw/getlist/homeworks/census',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'PATH_TRANSLATED': '/var/www/html/hw/getlist/homeworks/census',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'QUERY_STRING': '',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121] 'REMOTE_ADDR':
> '192.168.200.121',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121] 'REMOTE_PORT':
> '52051',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'REQUEST_METHOD': 'GET',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121] 'REQUEST_URI':
> '/wsgi/test3.wsgi/hw/getlist/homeworks/census',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'SCRIPT_FILENAME': '/var/www/wsgi-scripts/test3.wsgi',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121] 'SCRIPT_NAME':
> '/wsgi/test3.wsgi',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121] 'SERVER_ADDR':
> '192.168.201.247',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'SERVER_ADMIN': 'root@localhost',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121] 'SERVER_NAME':
> 'daffyduck.sunbelt.org',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121] 'SERVER_PORT':
> '80',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'SERVER_PROTOCOL': 'HTTP/1.1',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'SERVER_SIGNATURE': '<address>Apache/2.2.15 (Red Hat) Server at
> daffyduck.sunbelt.org Port 80</address>\\n',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'SERVER_SOFTWARE': 'Apache/2.2.15 (Red Hat)',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'mod_wsgi.application_group': 'daffyduck.sunbelt.org|/wsgi/test3.wsgi',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'mod_wsgi.callable_object': 'application',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'mod_wsgi.handler_script': '',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'mod_wsgi.input_chunked': '0',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'mod_wsgi.listener_host': '',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'mod_wsgi.listener_port': '80',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'mod_wsgi.process_group': '',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'mod_wsgi.request_handler': 'wsgi-script',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'mod_wsgi.script_reloading': '1',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'mod_wsgi.version': (3, 2),
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121] 'wsgi.errors':
> <mod_wsgi.Log object at 0xb6435d40>,
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'wsgi.file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter
> object at 0xb757c410>,
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121] 'wsgi.input':
> <mod_wsgi.Input object at 0xb6435d18>,
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'wsgi.multiprocess': True,
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'wsgi.multithread': False,
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'wsgi.run_once': False,
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'wsgi.url_scheme': 'http',
> [Fri Apr 01 12:46:04 2011] [error] [client 192.168.200.121]
> 'wsgi.version': (1, 1)})
>
>
> but control never gets to my django site, not even the url mapped as
> (r'^', 'census.views.index'),
>
> I appreciate your patience and support. I know there is something really
> simple I'm overlooking, but I just can't find it.
>
> Thanks,
> Fred.
>
> --
> You received this message because you are subscribed to the Google Groups
> "modwsgi" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/modwsgi?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/modwsgi?hl=en.