On Sunday, 15 September 2013 07:05:19 UTC+1, hung david wrote: > I've been working with Django like 3 months and I'm trying to get my site > online with Apache2. So please forgive if this is a stupid question. > I'm gonna make this short. > On development server, when I go to, like, > http://localhost:8000/my-function , it works ( since I have a my-function > view in views.py, and a mount point in urls.py to point to it) > > # views.py > def my-function(request): > #do something > # urls.py > urlpatterns = patterns('', > > url(r'^my-function/$', views.my-function ), > ) > Those things work well on development server. > I've been working with mod_wsgi and WSGI application script file and I've > made them work alright on my production server. It's just as easy to make > some directives change (WSGIScriptAlias, Alias, <Directory></Directory>) in > apache's httpd.conf file. (for example : > http://www.my-domain.com/my-wsgi-app ) > > *But how make it work on a production server by going to ** > http://www.my-domain.com/my-function* to make my my-function work like it > does on development server? > Thank you. > > > It's not a stupid question, but it is a bit of a strange one. You don't have to do anything to make this work: that's how it works already. You choose the point at which you mount your app, and WSGI takes care of routing all URLs from there via your Django urlconf. Normally, you would set the WSGIScriptAlias up simply at the root, /, so that all URLs go via Django. -- DR.
-- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.

