From e2053d9fa30a1e549b7e6691f4133005c55ea161 Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Wed, 7 Aug 2013 16:53:24 -0700 Subject: [PATCH] Add rest-framework plumbing. --- pip_requirements.txt | 1 + readthedocs/settings/base.py | 7 ++++++- readthedocs/urls.py | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pip_requirements.txt b/pip_requirements.txt index 3ed478497..2800e8ac8 100644 --- a/pip_requirements.txt +++ b/pip_requirements.txt @@ -30,6 +30,7 @@ virtualenv==1.8.4 doc2dash==1.1.0 beautifulsoup4==4.1.3 lxml==3.0.2 +djangorestframework==2.3.6 # Pegged git requirements git+git://github.com/toastdriven/django-haystack@259274e4127f723d76b893c87a82777f9490b960#egg=django_haystack diff --git a/readthedocs/settings/base.py b/readthedocs/settings/base.py index 1f95abf24..6831507b1 100644 --- a/readthedocs/settings/base.py +++ b/readthedocs/settings/base.py @@ -117,6 +117,7 @@ INSTALLED_APPS = [ 'guardian', 'django_gravatar', 'django_nose', + 'rest_framework', # Celery bits 'djcelery', @@ -134,10 +135,14 @@ INSTALLED_APPS = [ 'websupport', ] +REST_FRAMEWORK = { + 'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.IsAdminUser',), + 'PAGINATE_BY': 10 +} + if DEBUG: INSTALLED_APPS.append('django_extensions') - #CARROT_BACKEND = "ghettoq.taproot.Database" CELERY_ALWAYS_EAGER = True CELERYD_TASK_TIME_LIMIT = 60*60 # 60 minutes diff --git a/readthedocs/urls.py b/readthedocs/urls.py index 33e7faa26..16de1e1fa 100644 --- a/readthedocs/urls.py +++ b/readthedocs/urls.py @@ -95,6 +95,7 @@ urlpatterns = patterns( name='profiles_profile_edit'), url(r'^profiles/', include('profiles.urls')), url(r'^api/', include(v1_api.urls)), + url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')), url(r'^feeds/new/$', NewProjectsFeed(), name="new_feed"),