Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
funkwhale
funkwhale
Commits
3f6fc95d
Commit
3f6fc95d
authored
Jun 26, 2017
by
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
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.env.dev
View file @
3f6fc95d
BACKEND_URL=http://localhost:
600
1
BACKEND_URL=http://localhost:
1208
1
YOUTUBE_API_KEY=
API_AUTHENTICATION_REQUIRED=False
api/config/api_urls.py
View file @
3f6fc95d
...
...
@@ -2,6 +2,8 @@ from rest_framework import routers
from
django.conf.urls
import
include
,
url
from
funkwhale_api.music
import
views
from
funkwhale_api.playlists
import
views
as
playlists_views
from
rest_framework_jwt
import
views
as
jwt_views
router
=
routers
.
SimpleRouter
()
router
.
register
(
r
'tags'
,
views
.
TagViewSet
,
'tags'
)
...
...
@@ -21,6 +23,6 @@ urlpatterns += [
url
(
r
'^radios/'
,
include
(
'funkwhale_api.radios.urls'
,
namespace
=
'radios'
)),
url
(
r
'^history/'
,
include
(
'funkwhale_api.history.urls'
,
namespace
=
'history'
)),
url
(
r
'^users/'
,
include
(
'funkwhale_api.users.api_urls'
,
namespace
=
'users'
)),
url
(
r
'^token/'
,
'rest_framework_
jwt
.
views.obtain_jwt_token
'
),
url
(
r
'^token/refresh/'
,
'rest_framework_
jwt
.
views.refresh_jwt_token
'
),
url
(
r
'^token/'
,
jwt
_
views
.
obtain_jwt_token
),
url
(
r
'^token/refresh/'
,
jwt
_
views
.
refresh_jwt_token
),
]
api/funkwhale_api/music/views.py
View file @
3f6fc95d
...
...
@@ -121,13 +121,14 @@ class TrackViewSet(TagViewSetMixin, SearchMixin, viewsets.ReadOnlyModelViewSet):
class
TagViewSet
(
viewsets
.
ReadOnlyModelViewSet
):
queryset
=
Tag
.
objects
.
all
()
queryset
=
Tag
.
objects
.
all
()
.
order_by
(
'name'
)
serializer_class
=
serializers
.
TagSerializer
permission_classes
=
[
ConditionalAuthentication
]
class
Search
(
views
.
APIView
):
max_results
=
3
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
query
=
request
.
GET
[
'query'
]
results
=
{
...
...
api/requirements/base.txt
View file @
3f6fc95d
# Bleeding edge Django
django==1.
8.7
django==1.
11
# Configuration
django-environ==0.4.0
...
...
api/requirements/local.txt
View file @
3f6fc95d
...
...
@@ -2,11 +2,11 @@
-r base.txt
coverage==4.0.3
django_coverage_plugin==1.1
Sphinx
Sphinx
==1.6.2
django-extensions==1.5.9
Werkzeug==0.11.2
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>=1.5,<1.6
...
...
api/requirements/test.txt
View file @
3f6fc95d
# Test dependencies go here.
-r
base
.txt
-r
local
.txt
coverage==4.0.3
django_coverage_plugin==1.1
flake8==2.5.0
django-test-plus==1.0.11
factory_boy>=2.8.1
model_mommy
tox
model-mommy==1.3.2
tox==2.7.0
dev.yml
View file @
3f6fc95d
...
...
@@ -36,17 +36,18 @@ services:
-
C_FORCE_ROOT=true
volumes
:
-
./api:/app
-
./data/music:/music
api
:
env_file
:
.env.dev
build
:
context
:
./api
dockerfile
:
docker/Dockerfile.
local
dockerfile
:
docker/Dockerfile.
test
command
:
python /app/manage.py runserver 0.0.0.0:12081
volumes
:
-
./api:/app
-
./data/music:/music
ports
:
-
"
12081"
-
"
12081
:12081
"
links
:
-
postgres
-
redis
...
...
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