L
L
leha782016-02-18 09:14:57
Django
leha78, 2016-02-18 09:14:57

What method to write for static pages?

Created a separate app in the project for static pages like: About Us, Buyers, Sellers, About the Company.
In the view, create a method for each page like
def about ()
def about_company ()
def for_seller ()
or can you create one method and somehow pull it out by ID already? How can this be implemented?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2016-02-18
@leha78

Use TemplateView
urls.py:

from django.views.generic import TemplateView
urlpatterns = patterns('',
    url(r'^about/$', TemplateView.as_view(template_name='about.html')),
)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question