Commit 3f6fc95d authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Merge branch 'feature/django-111' into 'develop'

Fixed #11: Upgraded to django 1.11

Closes #11

See merge request !4
parents 37ebde38 4cb2f53d
Pipeline #84 passed with stages
in 2 minutes and 10 seconds
BACKEND_URL=http://localhost:6001 BACKEND_URL=http://localhost:12081
YOUTUBE_API_KEY= YOUTUBE_API_KEY=
API_AUTHENTICATION_REQUIRED=False API_AUTHENTICATION_REQUIRED=False
...@@ -2,6 +2,8 @@ from rest_framework import routers ...@@ -2,6 +2,8 @@ from rest_framework import routers
from django.conf.urls import include, url from django.conf.urls import include, url
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 rest_framework_jwt import views as jwt_views
router = routers.SimpleRouter() router = routers.SimpleRouter()
router.register(r'tags', views.TagViewSet, 'tags') router.register(r'tags', views.TagViewSet, 'tags')
...@@ -21,6 +23,6 @@ urlpatterns += [ ...@@ -21,6 +23,6 @@ urlpatterns += [
url(r'^radios/', include('funkwhale_api.radios.urls', namespace='radios')), url(r'^radios/', include('funkwhale_api.radios.urls', namespace='radios')),
url(r'^history/', include('funkwhale_api.history.urls', namespace='history')), url(r'^history/', include('funkwhale_api.history.urls', namespace='history')),
url(r'^users/', include('funkwhale_api.users.api_urls', namespace='users')), url(r'^users/', include('funkwhale_api.users.api_urls', namespace='users')),
url(r'^token/', 'rest_framework_jwt.views.obtain_jwt_token'), url(r'^token/', jwt_views.obtain_jwt_token),
url(r'^token/refresh/', 'rest_framework_jwt.views.refresh_jwt_token'), url(r'^token/refresh/', jwt_views.refresh_jwt_token),
] ]
...@@ -121,13 +121,14 @@ class TrackViewSet(TagViewSetMixin, SearchMixin, viewsets.ReadOnlyModelViewSet): ...@@ -121,13 +121,14 @@ class TrackViewSet(TagViewSetMixin, SearchMixin, viewsets.ReadOnlyModelViewSet):
class TagViewSet(viewsets.ReadOnlyModelViewSet): class TagViewSet(viewsets.ReadOnlyModelViewSet):
queryset = Tag.objects.all() queryset = Tag.objects.all().order_by('name')
serializer_class = serializers.TagSerializer serializer_class = serializers.TagSerializer
permission_classes = [ConditionalAuthentication] permission_classes = [ConditionalAuthentication]
class Search(views.APIView): class Search(views.APIView):
max_results = 3 max_results = 3
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
query = request.GET['query'] query = request.GET['query']
results = { results = {
......
# Bleeding edge Django # Bleeding edge Django
django==1.8.7 django==1.11
# Configuration # Configuration
django-environ==0.4.0 django-environ==0.4.0
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
-r base.txt -r base.txt
coverage==4.0.3 coverage==4.0.3
django_coverage_plugin==1.1 django_coverage_plugin==1.1
Sphinx Sphinx==1.6.2
django-extensions==1.5.9 django-extensions==1.5.9
Werkzeug==0.11.2 Werkzeug==0.11.2
django-test-plus==1.0.11 django-test-plus==1.0.11
factory_boy==2.6.0 factory_boy>=2.8.1
# django-debug-toolbar that works with Django 1.5+ # django-debug-toolbar that works with Django 1.5+
django-debug-toolbar>=1.5,<1.6 django-debug-toolbar>=1.5,<1.6
......
# Test dependencies go here. # Test dependencies go here.
-r base.txt -r local.txt
coverage==4.0.3
django_coverage_plugin==1.1
flake8==2.5.0 flake8==2.5.0
django-test-plus==1.0.11 model-mommy==1.3.2
factory_boy>=2.8.1 tox==2.7.0
model_mommy
tox
...@@ -36,17 +36,18 @@ services: ...@@ -36,17 +36,18 @@ services:
- C_FORCE_ROOT=true - C_FORCE_ROOT=true
volumes: volumes:
- ./api:/app - ./api:/app
- ./data/music:/music
api: api:
env_file: .env.dev env_file: .env.dev
build: build:
context: ./api context: ./api
dockerfile: docker/Dockerfile.local dockerfile: docker/Dockerfile.test
command: python /app/manage.py runserver 0.0.0.0:12081 command: python /app/manage.py runserver 0.0.0.0:12081
volumes: volumes:
- ./api:/app - ./api:/app
- ./data/music:/music
ports: ports:
- "12081" - "12081:12081"
links: links:
- postgres - postgres
- redis - redis
......
Supports Markdown
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