This adds a simple mechanism to view any template file directly in a browser. The intention is that we can use this to build up reference HTML files which illustrate common UX patterns. We can then view the resulting pages without having to have a working implementation.
In development mode, the URL is /template followed by the path to the template file. For example, you can view the 404 page at:
/template/404.html
You can also supply string parameters to the template by specifying them as query parameters in the URL.
e.g. /template/my_template?name=Foo
12 lines
377 B
Python
12 lines
377 B
Python
"""
|
|
URLconf for development-only views.
|
|
This gets imported by urls.py and added to its URLconf if we are running in
|
|
development mode; otherwise, it is ignored.
|
|
"""
|
|
from django.conf.urls import url
|
|
|
|
urlpatterns = (
|
|
url(r'^dev_mode$', 'contentstore.views.dev.dev_mode', name='dev_mode'),
|
|
url(r'^template/(?P<template>.+)$', 'contentstore.views.dev.dev_show_template'),
|
|
)
|