Yesterday Ofri and I talked about the Kneset project. It reminded me an issue we had. The site url seems different with "runserver" then through the apache. when I run the ./manage.py the request url is processed according to the urls.py. example: http://127.0.0.1:8080/ping/
for detecting it is django we used /serve/ as url (our project is also called serve). but while running the server in standalone it had no meaning. http://myapache:80/serve/ping/ but that can't work since my django does not know the /serve/ We want to swallow that "/serve/" prefix so everything would be as "usual" thought the url is a bit different. so in settings.py we directed to a different urls.py # ROOT_URLCONF = 'serve.urls' # skip the prefix /serve/ ROOT_URLCONF = 'serve.prefixurls' which in turns delegated to the usual urls.py # prefixurls.py import os from django.conf.urls.defaults import * from django.conf import settings import serve.proxy.views urlpatterns = patterns('', (r'^serve/', include('serve.urls')), ) Now the standalone server: example: http://127.0.0.1:8080/serve/ping/ and the apache http://myapache:80/serve/ping/ Saffi & Ze'ev --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "PyWeb-IL" 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/pyweb-il?hl=en -~----------~----~----~----~------~----~------~--~---
_______________________________________________ Python-il mailing list [email protected] http://hamakor.org.il/cgi-bin/mailman/listinfo/python-il
