im trying to get my url named, so it can be reversed in my django app.
mysite/urls.py:
urlpatterns = patterns('',
# Examples:
url(r'^$', 'myapp.views.redirect_to_home'),
url(r'^admin/', include(admin.site.urls)),
url(r'^myapp/', include('myapp.urls')),)
myapp/urls.py
urlpatterns = patterns('',
url(r'(?i)^$', views.redirect_to_home),
url(r'(?i)^Login/$', views.home, name="home"),
url(r'(?i)^Logout/$', views.logout_user, name="logout_user"),)
be minded that i had purpusly added the '(?i)^' in the beggining of every regex, to make the urls in-case sensitive.
but, having this string '(?i)^' had made my reverse function to fail saying
Reverse for 'home' with arguments '()' and keyword arguments '{}' not found. 1 pattern(s) tried: ['myapp/(?i)^Login/$']
after trying to remove the (?i)^ , i noticed the reverse succeeds.
What can i do to make my urls in-case sensitive, and still reversable?
Thanks.