Pulled out url fix into a util
This commit is contained in:
8
OACPL/utils.py
Normal file
8
OACPL/utils.py
Normal file
@ -0,0 +1,8 @@
|
||||
from django.template.loader import render_to_string
|
||||
|
||||
from OACPL import settings
|
||||
|
||||
|
||||
def url_fix_render_to_string(template, context):
|
||||
temp = render_to_string(template, context)
|
||||
return temp.replace('src="/', 'src="%s/' % settings.BASE_URL).replace('href="/', 'href="%s/' % settings.BASE_URL)
|
Reference in New Issue
Block a user