Setup Django REST Framework.

This commit is contained in:
Norman Jäckel 2014-10-11 14:15:42 +02:00
parent 579e4b325e
commit 7ed5d2fc43
4 changed files with 13 additions and 0 deletions

View File

@ -88,6 +88,7 @@ INSTALLED_APPS = (
'mptt', 'mptt',
'haystack', # full-text-search 'haystack', # full-text-search
'ckeditor', 'ckeditor',
'rest_framework',
'openslides.poll', 'openslides.poll',
'openslides.core', 'openslides.core',
'openslides.account', 'openslides.account',

View File

@ -3,6 +3,7 @@ from django.conf.urls import include, patterns, url
from openslides.core.views import ErrorView from openslides.core.views import ErrorView
from openslides.utils.plugins import get_urlpatterns from openslides.utils.plugins import get_urlpatterns
from openslides.utils.rest_api import router
handler403 = ErrorView.as_view(status_code=403) handler403 = ErrorView.as_view(status_code=403)
handler404 = ErrorView.as_view(status_code=404) handler404 = ErrorView.as_view(status_code=404)
@ -31,6 +32,13 @@ urlpatterns += patterns(
(r'^ckeditor/', include('ckeditor.urls')), (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 # TODO: move this patterns into core or the participant app
from openslides.users.views import UserSettingsView, UserPasswordSettingsView from openslides.users.views import UserSettingsView, UserPasswordSettingsView
urlpatterns += patterns( urlpatterns += patterns(

View File

@ -0,0 +1,3 @@
from rest_framework import permissions, routers, viewsets
router = routers.DefaultRouter()

View File

@ -5,6 +5,7 @@ bleach>=1.4,<1.5
django-ckeditor-updated>=4.2.3,<4.4 django-ckeditor-updated>=4.2.3,<4.4
django-haystack>=2.1,<2.4 django-haystack>=2.1,<2.4
django-mptt>=0.6,<0.7 django-mptt>=0.6,<0.7
djangorestframework>=3.0.1,<3.1
jsonfield>=0.9.19,<1.1 jsonfield>=0.9.19,<1.1
natsort>=3.2,<3.6 natsort>=3.2,<3.6
reportlab>=3.0,<3.2 reportlab>=3.0,<3.2