diff options
author | Andrew Godwin | 2022-11-17 08:21:42 -0700 |
---|---|---|
committer | Andrew Godwin | 2022-11-17 12:21:44 -0700 |
commit | f5eafb0ca0af3ed064202abbe99bfbeef8bbb74d (patch) | |
tree | d01453e94f371956e7e989351b51e6ed6eb42541 /takahe | |
parent | 7f8e792402b66dbb4a721be4f44306d528931b86 (diff) | |
download | takahe-f5eafb0ca0af3ed064202abbe99bfbeef8bbb74d.tar.gz takahe-f5eafb0ca0af3ed064202abbe99bfbeef8bbb74d.tar.bz2 takahe-f5eafb0ca0af3ed064202abbe99bfbeef8bbb74d.zip |
Add image/icon upload
Diffstat (limited to 'takahe')
-rw-r--r-- | takahe/settings/base.py | 3 | ||||
-rw-r--r-- | takahe/urls.py | 17 |
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}, + ), ] |