legacy-dotfiles/pages/views.py
2011-11-04 22:10:49 +01:00

18 lines
417 B
Python

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)