I
I
Iskander Mammadov2015-02-09 09:19:16
Django
Iskander Mammadov, 2015-02-09 09:19:16

How to render a static homepage in Django?

There is, for example, a site: example.com.
How to set a static page as the main one?
That is, when you go to example.com - index.html was displayed

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ilya, 2015-02-09
@Gugr

from django.conf.urls import patterns
from django.views.generic import TemplateView

urlpatterns = patterns('',
    (r'^$', TemplateView.as_view(template_name="index.html")),
)

X
xSkyFoXx, 2015-02-09
@xSkyFoXx

Make flatpage and url to view on "/"

A
Alexey Bukin, 2015-02-09
@abukin

Well, if you don’t have a template there, but just an html page, then it’s easier to just write a rule in nginx to immediately give the page.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question