3๐
โ
I would suggest doing whatever you can to get your prod and dev as identical as possible, however if thats not possible you could use separate urlpatterns for the development environment.
Assuming you have a settings.DEBUG set, try the following:
extra_patterns = patterns('',
(r'enroll/$', 'enroll'),
)
if settings.DEBUG:
urlpatterns = patterns('', (r'^', include(extra_patterns)))
else:
urlpatterns = patterns('', (r'^activity/', include(extra_patterns)))
๐คRobert Clark
3๐
django.core.urlresolvers.reverse()
or {% url %}
can be used to turn a view reference or named urlconf into a URL suitable for output.
- [Django]-Django โ Models โ Recursively retrieve parents of a leaf node
- [Django]-Passing context variable in generic.UpdateView
- [Django]-Forward declaration โ no admin page in django?
- [Django]-Django model pre_save Validation in Admin
Source:stackexchange.com