Created
July 14, 2015 06:26
-
-
Save leonardoo/1efe80ce868198dda2ea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from django.conf import settings | |
from django.shortcuts import render | |
from django.test.utils import override_settings | |
@override_settings(STATIC_URL="{}/".format(os.path.abspath(settings.STATIC_ROOT))) | |
def html_for_print(request, context_object_name, instance, template): | |
data = {context_object_name: instance} | |
return render(request, template, data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment