Setup Django REST Framework.
This commit is contained in:
parent
579e4b325e
commit
7ed5d2fc43
@ -88,6 +88,7 @@ INSTALLED_APPS = (
|
||||
'mptt',
|
||||
'haystack', # full-text-search
|
||||
'ckeditor',
|
||||
'rest_framework',
|
||||
'openslides.poll',
|
||||
'openslides.core',
|
||||
'openslides.account',
|
||||
|
@ -3,6 +3,7 @@ from django.conf.urls import include, patterns, url
|
||||
|
||||
from openslides.core.views import ErrorView
|
||||
from openslides.utils.plugins import get_urlpatterns
|
||||
from openslides.utils.rest_api import router
|
||||
|
||||
handler403 = ErrorView.as_view(status_code=403)
|
||||
handler404 = ErrorView.as_view(status_code=404)
|
||||
@ -31,6 +32,13 @@ urlpatterns += patterns(
|
||||
(r'^ckeditor/', include('ckeditor.urls')),
|
||||
)
|
||||
|
||||
urlpatterns += patterns(
|
||||
'',
|
||||
url(r'^api/', include(router.urls)),
|
||||
# TODO: Remove the next line if you are sure.
|
||||
# url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
|
||||
)
|
||||
|
||||
# TODO: move this patterns into core or the participant app
|
||||
from openslides.users.views import UserSettingsView, UserPasswordSettingsView
|
||||
urlpatterns += patterns(
|
||||
|
3
openslides/utils/rest_api.py
Normal file
3
openslides/utils/rest_api.py
Normal file
@ -0,0 +1,3 @@
|
||||
from rest_framework import permissions, routers, viewsets
|
||||
|
||||
router = routers.DefaultRouter()
|
@ -5,6 +5,7 @@ bleach>=1.4,<1.5
|
||||
django-ckeditor-updated>=4.2.3,<4.4
|
||||
django-haystack>=2.1,<2.4
|
||||
django-mptt>=0.6,<0.7
|
||||
djangorestframework>=3.0.1,<3.1
|
||||
jsonfield>=0.9.19,<1.1
|
||||
natsort>=3.2,<3.6
|
||||
reportlab>=3.0,<3.2
|
||||
|
Loading…
Reference in New Issue
Block a user