mirror of
https://github.com/github/codeql.git
synced 2025-12-18 09:43:15 +01:00
Except for dataflow (where we have a lot of changes, and I don't want to introduce lots of merge conflicts right now).
42 lines
924 B
Python
42 lines
924 B
Python
from django.urls import path
|
|
from django.http import HttpResponse
|
|
from django.template import Template, Context, Engine, engines
|
|
|
|
|
|
def dj(request):
|
|
# Load the template
|
|
template = request.GET['template']
|
|
t = Template(template)
|
|
ctx = Context(locals())
|
|
html = t.render(ctx)
|
|
return HttpResponse(html)
|
|
|
|
|
|
def djEngine(request):
|
|
# Load the template
|
|
template = request.GET['template']
|
|
|
|
django_engine = engines['django']
|
|
t = django_engine.from_string(template)
|
|
ctx = Context(locals())
|
|
html = t.render(ctx)
|
|
return HttpResponse(html)
|
|
|
|
|
|
def djEngineJinja(request):
|
|
# Load the template
|
|
template = request.GET['template']
|
|
|
|
django_engine = engines['jinja']
|
|
t = django_engine.from_string(template)
|
|
ctx = Context(locals())
|
|
html = t.render(ctx)
|
|
return HttpResponse(html)
|
|
|
|
|
|
urlpatterns = [
|
|
path('', dj),
|
|
path('', djEngine),
|
|
path('', djEngineJinja),
|
|
]
|