2009/10/14 Jani Tiainen <rede...@gmail.com>: > > Chris Withers kirjoitti: >> Hi All, >> >> I need to host my django project from /some/folder in my apache instance. >> >> I have the following: >> >> WSGIScriptAlias /some/folder /path/to/django.wsgi >> >> Does this now mean I have to prefix all my entries in urls.py with >> /some/folder? >> >> I hope not, but give that going to: >> >> http://myserver/some/folder >> >> ...gives me a 404 unless I do, I'm not hopeful. >> >> What am I doing wrong? > > "nothing". > > Term is called "suburl deployment" and I've done it (for testing purposes). > > Apache config: > > RewriteEngine On > > #add missing trailing slash if needed > RewriteRule ^/<suburl>$ /<suburl>/ [R] > > #WSGI alias[[BR]] > WSGIScriptAlias /<suburl> absolute_path_to_wsgi_file.wsgi[[BR]] > > And if you're using authentication in your app you must provided full > absolutely URL to login page, I've done it settings.py: > > LOGIN_URL='/<suburl>/login/' > > And that's it. Of course you have to keep all your apps using hardcoded > urls but use reverse url finding always. > Does this enable you to run a django project only on a certain url?
So, say for example you've got a legacy php site that has the siteroot, could you run a django app off of /<app>/ ? Many Thanks, Dan > -- > Jani Tiainen > > > > -- Dan Hilton ============================ www.twitter.com/danhilton www.DanHilton.co.uk ============================ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---