Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Julien Veyssier
funkwhale
Commits
ab80dffe
Verified
Commit
ab80dffe
authored
Jun 10, 2018
by
Eliot Berriot
Browse files
See #297: sorted config imports
parent
799386c2
Changes
7
Hide whitespace changes
Inline
Side-by-side
api/config/api_urls.py
View file @
ab80dffe
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.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.instance
import
views
as
instance_views
from
funkwhale_api.music
import
views
from
funkwhale_api.playlists
import
views
as
playlists_views
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
.
register
(
r
"settings"
,
GlobalPreferencesViewSet
,
base_name
=
"settings"
)
...
...
api/config/asgi.py
View file @
ab80dffe
import
django
import
os
import
django
from
.routing
import
application
os
.
environ
.
setdefault
(
"DJANGO_SETTINGS_MODULE"
,
"config.settings.production"
)
django
.
setup
()
from
.routing
import
application
api/config/routing.py
View file @
ab80dffe
from
django.conf.urls
import
url
from
channels.auth
import
AuthMiddlewareStack
from
channels.routing
import
ProtocolTypeRouter
,
URLRouter
from
django.conf.urls
import
url
from
funkwhale_api.common.auth
import
TokenAuthMiddleware
from
funkwhale_api.instance
import
consumers
application
=
ProtocolTypeRouter
(
{
# Empty for now (http->django views is added by default)
...
...
api/config/settings/common.py
View file @
ab80dffe
...
...
@@ -10,8 +10,10 @@ https://docs.djangoproject.com/en/dev/ref/settings/
"""
from
__future__
import
absolute_import
,
unicode_literals
from
urllib.parse
import
urlsplit
import
datetime
import
os
from
urllib.parse
import
urlparse
,
urlsplit
import
environ
from
celery.schedules
import
crontab
...
...
@@ -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"
][
"BACKEND"
]
=
"django_redis.cache.RedisCache"
from
urllib.parse
import
urlparse
cache_url
=
urlparse
(
CACHES
[
"default"
][
"LOCATION"
])
CHANNEL_LAYERS
=
{
...
...
@@ -351,8 +352,6 @@ CELERYBEAT_SCHEDULE = {
}
}
import
datetime
JWT_AUTH
=
{
"JWT_ALLOW_REFRESH"
:
True
,
"JWT_EXPIRATION_DELTA"
:
datetime
.
timedelta
(
days
=
7
),
...
...
api/config/settings/production.py
View file @
ab80dffe
...
...
@@ -13,7 +13,6 @@ from __future__ import absolute_import, unicode_literals
from
django.utils
import
six
from
.common
import
*
# noqa
# SECRET CONFIGURATION
...
...
api/config/urls.py
View file @
ab80dffe
...
...
@@ -5,8 +5,8 @@ from django.conf import settings
from
django.conf.urls
import
include
,
url
from
django.conf.urls.static
import
static
from
django.contrib
import
admin
from
django.views.generic
import
TemplateView
from
django.views
import
defaults
as
default_views
from
django.views.generic
import
TemplateView
urlpatterns
=
[
# Django Admin, use {% url 'admin:index' %}
...
...
api/config/wsgi.py
View file @
ab80dffe
...
...
@@ -15,11 +15,9 @@ framework.
"""
import
os
from
django.core.wsgi
import
get_wsgi_application
from
whitenoise.django
import
DjangoWhiteNoise
# 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
# mod_wsgi daemon mode with each site in its own daemon process, or use
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment