I have to page in my django powered website. index.html and books.html
I have this link to the books.html in my first page
<a href="books.html">books</a>
and this one is in books.html for getting back to the first page.
<a href="index.html">Home</a>
and my url conf is like this
urlpatterns = patterns('',
url(r'^$', 'mysite.views.home', name='home'),
url(r'^books.html/$', 'mysite.views.bookpage', name='books'),
url(r'index.html/$', 'mysite.views.home', name='home'),
)
and views.py
def home(request):
return render_to_response('index.html')
def bookpage(request):
return render_to_response('books.html')
When I click on the second link to get back home. my url address looks like this
mysite.com/books.html/index.html/
How can I change url back to mysite.com/ when clicking on the second link in books.html?
sorry if the title is not appropriate. i didn't know what would be my question title
Update
I've deleted url(r'^index.html/$', 'mysite.views.home', name='home') from my url patterns and used <a href="{% url 'home' %}"> in the second page. But nothing happens when I click on that link
mysite.views? orazahra.views?index.htmlto point to the home view instead of//doesn't work when I use it inhref/isn't working to get you back to the site root. That should work no problem.