Django URL.py and the index

Asinox picture Asinox · Aug 22, 2009 · Viewed 13k times · Source

I want to know what is the best way to write in the URL.py. I am trying to get the index in this way: www.example.com with (r'',index). But when I try r'', all pages in the website are going to the home page.

Part of my url.py:

(r'^index',homepages),
(r'',homepages),

Thanks :)

Answer

Brian R. Bondy picture Brian R. Bondy · Aug 22, 2009

Like this:

 #...
 (r'^$', index),
 #...