Fix issue with protocol
This commit is contained in:
@ -1,16 +1,18 @@
|
||||
""" customize the info available in context for rendering templates """
|
||||
from bookwyrm import models
|
||||
from bookwyrm.settings import SITE_PATH, STATIC_URL, STATIC_PATH, MEDIA_URL, MEDIA_PATH
|
||||
from bookwyrm.settings import STATIC_URL, STATIC_PATH, MEDIA_URL, MEDIA_PATH
|
||||
|
||||
|
||||
def site_settings(request): # pylint: disable=unused-argument
|
||||
"""include the custom info about the site"""
|
||||
request_protocol = "https://" if request.is_secure() else "http://"
|
||||
|
||||
return {
|
||||
"site": models.SiteSettings.objects.get(),
|
||||
"active_announcements": models.Announcement.active_announcements(),
|
||||
"site_path": SITE_PATH,
|
||||
"static_url": STATIC_URL,
|
||||
"media_url": MEDIA_URL,
|
||||
"static_path": STATIC_PATH,
|
||||
"media_path": MEDIA_PATH,
|
||||
"request_protocol": request_protocol,
|
||||
}
|
||||
|
Reference in New Issue
Block a user