Thanks James for your quick answer, the problem occurred on dev server as I 
haven't deployed the site yet. But I figured out how to fix this, which was 
suitable for everybody. Just used multiple apps, instead of one.

Thanks a lot :)

-Ville

tiistai 12. heinäkuuta 2016 16.19.12 UTC+3 James Schneider kirjoitti:
>
>
> On Jul 12, 2016 4:27 AM, "VilleP" <pasone...@gmail.com <javascript:>> 
> wrote:
> >
> > 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
> >
>
> This is happening because your site is generating links using a short 
> relative path (href='page1'). Are you generating URL paths using the Django 
> methods such as reverse() and {% url %}?
>
> > 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)
> > ]
>
> Can you provide an example of a problematic {% url %} tag from your 
> template, and the generated HTML on the browser for that same anchor?
>
> Based on the urls.py files you posted, the behavior you describe shouldn't 
> be possible. Is this behavior seen using the dev server, or using a 
> production server like Apache?
>
> -James
>

-- 
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/a4c4b32e-1ba5-4885-b087-2a92b5faafdf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to