Hi guys!

I've got a little problem with my url "generating". Everytime I try to run 
my testserver and move through pages, that I've linked there it goes like 
this:

http://testserver.local/home #(this is totally fine)
(click on another page)
http://testserver.local/home/page1
(click on another page besides home)
http://testserver.local/home/page1/page2
(if I click again to previous by clicking menu button it goes like this)
http://testserver.local/home/page1/page2/page1

page1, etc. are examples here which helps me to present the problem.

Any help for this one? I'll paste my urls.py and views.py below:


from django.conf.urls import url
from sivusto import views

urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^tekninen.html/$', views.tekninen, name='tekninen'), #(this would be 
page1)
url(r'^johdon_tyokalut.html/$', views.johdon_tyokalut, 
name='johdon_tyokalut'), #(this would be page2)
]


from django.shortcuts import render

def index(request):
return render(request, 'sivusto/index.html',) #(homepage)
def tekninen(request):
return render(request, 'sivusto/tekninen.html',) #(page1)
def johdon_tyokalut(request):
return render(request, 'sivusto/johdon_tyokalut.html',) #(page2)


This is the main main urls.py, if it helps:


from django.conf.urls import include, url
from django.contrib import admin

urlpatterns = [
    url(r'^admin/', admin.site.urls),
url(r'^sivusto/', include('sivusto.urls', namespace="sivusto")),
]


Thank you very much in advance, I know this sounds like a noob problem but 
that's pretty much what I'm dealing with here :D

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c6d46bee-5274-4bf6-acb1-2cbfd12ac876%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to