Hello group,

I'm having some problems understanding the URL setup for mod_wsgi. The
documentation at [1] is excellent, but all of the examples of the
Apache configuration have a trailing slash appended to the Alias. In
my experience, that means that /my_app/foo results in a 404. All of my
url_patterns have an optional trailing slash, so my assumption is that
this is an Apache pattern-matching issue.

Even worse, when I browse to /my_app/foo/, I get a TypeError. Here's
the traceback:

-----
File "C:\Python25\lib\site-packages\django\core\handlers\base.py" in
get_response
  73.             callback, callback_args, callback_kwargs =
resolver.resolve(request.path)

Exception Type: TypeError at
Exception Value: 'NoneType' object is not iterable
-----

I get the best results by removing the trailing slash from the Apache
configuration. Then, the page loads correctly at /my_app/foo/, but I
get the same TypeError at /my_app/foo (without the slash).

Config files are below. The platform is Windows with 0.97-pre-SVN-7190
and Apache 2.2.6.

httpd.conf:
-----
Alias /my_app/foo/media "d:/www/media/foo/"
<Directory "d:/www/media">
Order allow,deny
Options Indexes FollowSymLinks
Allow from all
IndexOptions FancyIndexing
</Directory>

WSGIScriptAlias /my_app/foo "d:/Data/webdev/apache/foo.wsgi"

<Directory "d:/Data/webdev/apache">
Allow from all
</Directory>
-----

foo.wsgi:
-----
import os, sys

#Calculate the path based on the location of the WSGI script.
apache_configuration= os.path.dirname(__file__)
project = os.path.dirname(apache_configuration)
workspace = os.path.dirname(project)
sys.path.append(workspace)

#Add the path to 3rd party django application and to django itself.
sys.path.append('C:\\Python25\\Lib\\site-packages')
sys.path.append('D:\\Data\\webdev\\projects\\foo')

os.environ['DJANGO_SETTINGS_MODULE'] = 'src.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
-----

Can someone with a better understanding of mod_wsgi can explain why
the examples at [1] include trailing slashes on aliases? Does anyone
have any insight on the TypeError I'm experiencing?

Many thanks,
Matt.

[1] http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to