diff options
author | 2011-11-04 22:10:49 +0100 | |
---|---|---|
committer | 2011-11-04 22:10:49 +0100 | |
commit | 3ec79710ca046b2c172eb77679eb5e2983460a1a (patch) | |
tree | cc028ab2f6ac96d4ec8f50019c2b4609fb4e948b /pages/views.py | |
parent | e533b3b82e254e2c22ed40a570b5e8b31a1f126b (diff) | |
download | dotfiles-3ec79710ca046b2c172eb77679eb5e2983460a1a.tar.gz dotfiles-3ec79710ca046b2c172eb77679eb5e2983460a1a.zip |
Render html pages in templates/html_pages
Diffstat (limited to 'pages/views.py')
-rw-r--r-- | pages/views.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pages/views.py b/pages/views.py new file mode 100644 index 0000000..2f902a6 --- /dev/null +++ b/pages/views.py @@ -0,0 +1,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) |