summaryrefslogtreecommitdiffstats
path: root/takahe
diff options
context:
space:
mode:
Diffstat (limited to 'takahe')
-rw-r--r--takahe/settings/base.py3
-rw-r--r--takahe/urls.py17
2 files changed, 19 insertions, 1 deletions
diff --git a/takahe/settings/base.py b/takahe/settings/base.py
index e45133d..b98b9a0 100644
--- a/takahe/settings/base.py
+++ b/takahe/settings/base.py
@@ -107,3 +107,6 @@ STATICFILES_DIRS = [
]
ALLOWED_HOSTS = ["*"]
+
+MEDIA_ROOT = BASE_DIR / "media"
+MEDIA_URL = "/media/"
diff --git a/takahe/urls.py b/takahe/urls.py
index 638dabd..5f5d5c5 100644
--- a/takahe/urls.py
+++ b/takahe/urls.py
@@ -1,5 +1,9 @@
+import re
+
+from django.conf import settings as djsettings
from django.contrib import admin as djadmin
-from django.urls import path
+from django.urls import path, re_path
+from django.views.static import serve
from activities.views import posts, timelines
from core import views as core
@@ -19,6 +23,11 @@ urlpatterns = [
name="settings",
),
path(
+ "settings/profile/",
+ settings.ProfilePage.as_view(),
+ name="settings_profile",
+ ),
+ path(
"settings/interface/",
settings.InterfacePage.as_view(),
name="settings_interface",
@@ -87,4 +96,10 @@ urlpatterns = [
path(".stator/runner/", stator.RequestRunner.as_view()),
# Django admin
path("djadmin/", djadmin.site.urls),
+ # Media files
+ re_path(
+ r"^%s(?P<path>.*)$" % re.escape(djsettings.MEDIA_URL.lstrip("/")),
+ serve,
+ kwargs={"document_root": djsettings.MEDIA_ROOT},
+ ),
]