I use django, and when users go to www.website.com/, I want to point them to an index.
Now I am doing this:
(r'^$', 'ideas.idea.views.index'),
However, it does not work. I assume my regex is wrong. Can someone help me? I looked at python regexes but they didn't help me.
What you have should work (it is for me). Make sure it is at the top urls.pyand it should also be at the top of the list.
urls.py
Just enter an empty regex: r ''
, .
urlpatterns = patterns('', url(r'', include('homepage.urls')), )
, !
EDIT:
:
urlpatterns = patterns('', url(r'\?', include('homepage.urls')), )
.
Is there a way that you can just use the general view and go straight to the template for your index page ?:
urlpatterns += patterns('django.views.generic.simple', (r'', 'direct_to_template', {'template': 'index.html'}), )