urlresolver and custom Site model?

27 views
Skip to first unread message

aleksandra...@gmail.com

unread,
Dec 7, 2011, 12:49:47 PM12/7/11
to Django users
Hello everyone

Becuase I do not use django database at all my application currently
can't be deployed to a custom location different from "/" quite
simply. I use {% url ... %} template tags within templates and
django.core.urlresolvers.reverse to populate urls. The problem is that
if I deploy myapp under http://host:port/MYSAPCE/myapp and site_id is
not defined in db the url is not picking "MYSAPCE".

What I am trying to do now is to write my own site model (without
using django database) that would be used by urlresolver. I was
wondering if someone could point me how that should be done.

Thanks
Alex

Daniel Roseman

unread,
Dec 7, 2011, 2:06:21 PM12/7/11
to django...@googlegroups.com
How are you deploying your application? There should be no need for a custom urlresolver - Django uses the SCRIPT_NAME value which should be set by your webserver. If that's not working for you, you may have something wrong in your hosting setup.
--
DR.

Andres Reyes

unread,
Dec 7, 2011, 2:15:38 PM12/7/11
to django...@googlegroups.com
Also you can use FORCE_SCRIPT_NAME in your settings 

2011/12/7 Daniel Roseman <dan...@roseman.org.uk>

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/IF09jV7YDwkJ.

To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



--
Andrés Reyes Monge
arm...@gmail.com
+(505)-8873-7217

aleksandra...@gmail.com

unread,
Dec 9, 2011, 3:46:08 PM12/9/11
to Django users
Great thanks for that. It definitely works now.
Reply all
Reply to author
Forward
0 new messages