diff --git a/webstrom/settings.py b/webstrom/settings.py index 07e517d..f5b3944 100644 --- a/webstrom/settings.py +++ b/webstrom/settings.py @@ -166,19 +166,21 @@ USE_TZ = True DATETIME_FORMAT = 'd.m.Y H:i:s' + +API_PREFIX = 'api/' + # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/3.0/howto/static-files/ STATIC_ROOT = os.path.join(BASE_DIR, 'static') -STATIC_URL = '/static/' - +STATIC_URL = 'static/' # Media files MEDIA_ROOT = os.path.join(BASE_DIR, 'media') -MEDIA_URL = '/media/' +MEDIA_URL = 'media/' PRIVATE_STORAGE_ROOT = os.path.join(BASE_DIR, 'protected_media/') SENDFILE_ROOT = PRIVATE_STORAGE_ROOT SENDFILE_BACKEND = "django_sendfile.backends.simple" diff --git a/webstrom/settings_test.py b/webstrom/settings_test.py index ff4dd14..0531638 100644 --- a/webstrom/settings_test.py +++ b/webstrom/settings_test.py @@ -8,12 +8,6 @@ "test.strom.sk", ] -APPEND_SLASH = False - -CSRF_TRUSTED_ORIGINS = [ - "https://test.strom.sk", -] - USE_X_FORWARDED_HOST = True SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") @@ -39,7 +33,3 @@ ("Martin Mihálik", "mihalik@strom.sk"), ("Peter Kovács", "kovacs@strom.sk"), ] - -MANAGERS = [ - ("Martin Mihálik", "mihalik@strom.sk"), -] diff --git a/webstrom/urls.py b/webstrom/urls.py index 5a51983..ed938ae 100644 --- a/webstrom/urls.py +++ b/webstrom/urls.py @@ -3,19 +3,24 @@ from django.contrib import admin from django.urls import include, path -urlpatterns = [ - path('django-admin/', admin.site.urls), +api_urlpatterns = [ path('user/', include('user.urls')), path('competition/', include('competition.urls')), path('cms/', include('cms.urls')), path('personal/', include('personal.urls')), path('base/', include('base.urls')), path('protected/', include('downloads.urls')), - # Dočasná cesta pre allauth bez rest frameworku +] + +urlpatterns = [ path('accounts/', include('allauth.urls')), + path('django-admin/', admin.site.urls), + path(settings.API_PREFIX, include(api_urlpatterns)), ] # Pri vývoji servuj media files priamo z djanga if settings.DEBUG: - urlpatterns += static(settings.MEDIA_URL, - document_root=settings.MEDIA_ROOT) + urlpatterns += static( + settings.MEDIA_URL, + document_root=settings.MEDIA_ROOT + )