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.

this tree view html file , css files are.

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

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -