Skip to content

Commit

Permalink
Use render() in the view
Browse files Browse the repository at this point in the history
  • Loading branch information
yakky committed Jan 24, 2016
1 parent cf56f12 commit 2ee4bb4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions statictemplate/management/commands/statictemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
except ImportError: # NOQA
from django.conf.urls import patterns, url, include
from django.core.management.base import BaseCommand
from django.shortcuts import render_to_response
from django.shortcuts import render_to_response, render
from django.template.context import RequestContext
from django.test.client import Client
try:
Expand Down Expand Up @@ -104,12 +104,12 @@ def handle(self, template, language=None, extra_request=None, **options):
self.stdout.write(output)


def render(request):
def render_view(request):
template_name = request.GET['template']
return render_to_response(template_name)
return render(request, template_name)


urlpatterns = [
url('^$', render),
url('^$', render_view),
url('^', include(settings.ROOT_URLCONF))
]

0 comments on commit 2ee4bb4

Please sign in to comment.