python - How to link html files together using Django 1.9? -
i programming in atom code editor , python 3.4.0 django 1.9. new django coding.
i have managed link html files , css files, don't know how link html files together.
i have tried <a href=" ">
code because works (i have previous knowledge in html) however, everytime click on link, says webpage not found.
i trying link base.html file generalq.html file.
does know tips?
you have put url in href
of <a>
element handled urls.py
, views.py
files:
in blog/templates/blog/base.html
:
<a href="/blog/general/">my link</a>
in compproject/urls.py
:
from django.conf.urls import include, url urlpatterns = [ url(r'^blog/', include('blog.urls')), ]
in blog/urls.py
:
from django.conf.urls import url . import views urlpatterns = [ url(r'^general/$', views.general, name='general'), ]
in blog/views.py
:
from django.shortcuts import render def general(request): return render(request, 'blog/generalq.html', {})
Comments
Post a Comment