summaryrefslogtreecommitdiffstats
path: root/pages/views.py
blob: 7a44701737a26c75d9f981536c521ca7ae563c32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import os.path

from django.http import Http404
from django.views.generic.simple import direct_to_template

from settings import DEPLOY_PATH

def index(request, page):

    template = 'html_pages/%s/index.html' % page
    if not os.path.exists('%s/templates/%s' % (DEPLOY_PATH, template)):
        raise Http404

    c = {
        "page": template,
    }

    return direct_to_template(request, "pages/index.html", c)