On Jun 12, 4:23 am, peta <wha...@gmail.com> wrote:
> I have django running under apache+mod-wsgi with...
>
>       WSGIScriptAlias /tools     /blah/blah/blah/tools.wsgi
>
> so http:server/tools/thingy cranks up the thingy tool.  Because
> mod_wsgi strips off the /tools part the urlpatterns just have to match
> the tool name, i.e.
>
>           (r'^thingy/',         include('tools.thingy.urls')),
>
> All well and good.
>
> Now I want to develop using the built in server, but it doesn't strip
> off the /tools part.  I can get around this by adding more
> urlpatterns
>
>             (r'^thingy/',                 include
> ('tools.thingy.urls')),   # For apache
>             (r'^tools/thingy/',         include
> ('tools.thingy.urls')),   # For runserver
>
> which is kludgy, and I'm not sure what is going to happen with the
> reverse url mappings.
>
> Is there someway to handle this situation gracefully.  The examples
> for mod_wsgi all put the WSGIAlias at / so it doesn't come up.

If you use all the appropriate functions for constructing URLs in
pages based on the context application is run, you should be able to
use the same urls.py for both. In this case though when working under
development server the application will be mounted at root URL where
as for mod_wsgi it will be a sub URL. The application though, if you
are doing everything right, shouldn't care where it is mounted.

So, just don't include 'tools/' in urls.py and access application
under development server from root URL rather than sub URL.

Graham
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to