mirror of
https://github.com/DarrenOfficial/dpaste.git
synced 2024-11-15 08:02:54 +11:00
Expose base_url
in global context for templates
Since `DPASTE_BASE_URL` is a dynamic setting that can be changed when the application is self-hosted, the templates need to have access to the variable when rendering the templates so that they do not erroneously display the dpaste.de url.
This commit is contained in:
parent
780aaa8315
commit
e6781d9dbc
1 changed files with 1 additions and 0 deletions
|
@ -2,6 +2,7 @@ from django.conf import settings
|
||||||
|
|
||||||
def dpaste_globals(request):
|
def dpaste_globals(request):
|
||||||
return {
|
return {
|
||||||
|
'base_url': getattr(settings, 'DPASTE_BASE_URL', 'https://dpaste.de'),
|
||||||
'site_name': getattr(settings, 'DPASTE_SITE_NAME', 'dpaste.de'),
|
'site_name': getattr(settings, 'DPASTE_SITE_NAME', 'dpaste.de'),
|
||||||
'jquery_url': getattr(settings, 'DPASTE_JQUERY_URL',
|
'jquery_url': getattr(settings, 'DPASTE_JQUERY_URL',
|
||||||
'https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js'),
|
'https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js'),
|
||||||
|
|
Loading…
Reference in a new issue