wrong (same) django template returned for every url -


for url type browser, same template returned. template in question index.html.

if send request 172.0.0.1:8000/login or 172.0.0.1:8000/sign-up, same html. if try 172.0.0.1:8000/sadsajdpojsapfpojpa same template rendered.

so if has idea problem is, please help!

this urls.py:

    django.conf.urls import url     django.contrib import admin     adventureapp import views      urlpatterns = [         url(r'^sign-up/$', views.signup),         url(r'^sign-up-2/$', views.signup2),         url(r'^sign-up-3/$', views.signup3),         url(r'^$', views.home),         url(r'^admin/', admin.site.urls),         url(r'^login/$', views.login),     ] 

this views.py file:

def home(request):     return render(request, "index.html")   def login(request):     return render(request, "login.html")   def signup(request):     return render(request, "sign-up.html")   def signup2(request):     return render(request, "sign-up-2.html")   def signup3(request):     return render(request, "sign-up-3.html") 

and of course, have of these templates (html files) in templates directory.

i think it's regex on urls.py, you're forcing urls end trailing slash

change them to:

url(r'^sign-up/?$', views.signup), 

hope helps


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -