python - Django urls straight to html template -


Learning DJ & amp; Python.

Just after the tutorial, establish a new site. Let's say for the debate now that I want to add a bunch about us, the basic HTML pages of frequently asked questions with very little dynamic elements do you write a new line in my urls.py file for each page ? Or some of them can clearly map the map * * .html to the relevant .html file directly?

In general, if it needs to be seen then I have to write a new line in the URL. The py file for each page

Unless there is a certain identification section in the URL, There is no need to create an entry in urls.py for the template url. For example, you can say that all URL templates that end in ".html" are referencing a direct file.

  urlpatterns = pattern ('django.views.generic.simple', (r '(. + \ .html) $', 'direct_to_template'), # ...)  

Take a look for the details.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -