Expose static & media paths

This commit is contained in:
Joachim
2021-05-26 17:54:59 +02:00
parent 7ea3153026
commit e362c82495
5 changed files with 18 additions and 10 deletions

View File

@ -1,6 +1,6 @@
""" customize the info available in context for rendering templates """
from bookwyrm import models
from bookwyrm.settings import DOMAIN
from bookwyrm.settings import SITE_PATH, STATIC_URL, STATIC_PATH, MEDIA_URL, MEDIA_PATH
def site_settings(request): # pylint: disable=unused-argument
@ -8,5 +8,9 @@ def site_settings(request): # pylint: disable=unused-argument
return {
"site": models.SiteSettings.objects.get(),
"active_announcements": models.Announcement.active_announcements(),
"site_path": "https://%s" % DOMAIN,
"site_path": SITE_PATH,
"static_url": STATIC_URL,
"media_url": MEDIA_URL,
"static_path": STATIC_PATH,
"media_path": MEDIA_PATH,
}