Verified Commit ab80dffe authored by Agate's avatar Agate 💬

See #297: sorted config imports

parent 799386c2
from django.conf.urls import include, url
from dynamic_preferences.api.viewsets import GlobalPreferencesViewSet
from dynamic_preferences.users.viewsets import UserPreferencesViewSet
from rest_framework import routers from rest_framework import routers
from rest_framework.urlpatterns import format_suffix_patterns from rest_framework.urlpatterns import format_suffix_patterns
from django.conf.urls import include, url from rest_framework_jwt import views as jwt_views
from funkwhale_api.activity import views as activity_views from funkwhale_api.activity import views as activity_views
from funkwhale_api.instance import views as instance_views from funkwhale_api.instance import views as instance_views
from funkwhale_api.music import views from funkwhale_api.music import views
from funkwhale_api.playlists import views as playlists_views from funkwhale_api.playlists import views as playlists_views
from funkwhale_api.subsonic.views import SubsonicViewSet from funkwhale_api.subsonic.views import SubsonicViewSet
from rest_framework_jwt import views as jwt_views
from dynamic_preferences.api.viewsets import GlobalPreferencesViewSet
from dynamic_preferences.users.viewsets import UserPreferencesViewSet
router = routers.SimpleRouter() router = routers.SimpleRouter()
router.register(r"settings", GlobalPreferencesViewSet, base_name="settings") router.register(r"settings", GlobalPreferencesViewSet, base_name="settings")
......
import django
import os import os
import django
from .routing import application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production") os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production")
django.setup() django.setup()
from .routing import application
from django.conf.urls import url
from channels.auth import AuthMiddlewareStack from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter from channels.routing import ProtocolTypeRouter, URLRouter
from django.conf.urls import url
from funkwhale_api.common.auth import TokenAuthMiddleware from funkwhale_api.common.auth import TokenAuthMiddleware
from funkwhale_api.instance import consumers from funkwhale_api.instance import consumers
application = ProtocolTypeRouter( application = ProtocolTypeRouter(
{ {
# Empty for now (http->django views is added by default) # Empty for now (http->django views is added by default)
......
...@@ -10,8 +10,10 @@ https://docs.djangoproject.com/en/dev/ref/settings/ ...@@ -10,8 +10,10 @@ https://docs.djangoproject.com/en/dev/ref/settings/
""" """
from __future__ import absolute_import, unicode_literals from __future__ import absolute_import, unicode_literals
from urllib.parse import urlsplit import datetime
import os import os
from urllib.parse import urlparse, urlsplit
import environ import environ
from celery.schedules import crontab from celery.schedules import crontab
...@@ -315,7 +317,6 @@ CACHE_DEFAULT = "redis://127.0.0.1:6379/0" ...@@ -315,7 +317,6 @@ CACHE_DEFAULT = "redis://127.0.0.1:6379/0"
CACHES = {"default": env.cache_url("CACHE_URL", default=CACHE_DEFAULT)} CACHES = {"default": env.cache_url("CACHE_URL", default=CACHE_DEFAULT)}
CACHES["default"]["BACKEND"] = "django_redis.cache.RedisCache" CACHES["default"]["BACKEND"] = "django_redis.cache.RedisCache"
from urllib.parse import urlparse
cache_url = urlparse(CACHES["default"]["LOCATION"]) cache_url = urlparse(CACHES["default"]["LOCATION"])
CHANNEL_LAYERS = { CHANNEL_LAYERS = {
...@@ -351,8 +352,6 @@ CELERYBEAT_SCHEDULE = { ...@@ -351,8 +352,6 @@ CELERYBEAT_SCHEDULE = {
} }
} }
import datetime
JWT_AUTH = { JWT_AUTH = {
"JWT_ALLOW_REFRESH": True, "JWT_ALLOW_REFRESH": True,
"JWT_EXPIRATION_DELTA": datetime.timedelta(days=7), "JWT_EXPIRATION_DELTA": datetime.timedelta(days=7),
......
...@@ -13,7 +13,6 @@ from __future__ import absolute_import, unicode_literals ...@@ -13,7 +13,6 @@ from __future__ import absolute_import, unicode_literals
from django.utils import six from django.utils import six
from .common import * # noqa from .common import * # noqa
# SECRET CONFIGURATION # SECRET CONFIGURATION
......
...@@ -5,8 +5,8 @@ from django.conf import settings ...@@ -5,8 +5,8 @@ from django.conf import settings
from django.conf.urls import include, url from django.conf.urls import include, url
from django.conf.urls.static import static from django.conf.urls.static import static
from django.contrib import admin from django.contrib import admin
from django.views.generic import TemplateView
from django.views import defaults as default_views from django.views import defaults as default_views
from django.views.generic import TemplateView
urlpatterns = [ urlpatterns = [
# Django Admin, use {% url 'admin:index' %} # Django Admin, use {% url 'admin:index' %}
......
...@@ -15,11 +15,9 @@ framework. ...@@ -15,11 +15,9 @@ framework.
""" """
import os import os
from django.core.wsgi import get_wsgi_application from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise from whitenoise.django import DjangoWhiteNoise
# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks # We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
# if running multiple sites in the same mod_wsgi process. To fix this, use # if running multiple sites in the same mod_wsgi process. To fix this, use
# mod_wsgi daemon mode with each site in its own daemon process, or use # mod_wsgi daemon mode with each site in its own daemon process, or use
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment