Verified Commit ce5c00eb authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Add NamespaceVersioning to Django

parent 132422fe
...@@ -35,10 +35,10 @@ ...@@ -35,10 +35,10 @@
<script> <script>
$(document).ready(function() { $(document).ready(function() {
var sources = { var sources = {
events: "/api/events/calendarjs", events: "/api/v1/events/calendarjs",
birthdays: "/api/members/birthdays", birthdays: "/api/v1/members/birthdays",
partners: "/api/partners/events", partners: "/api/v1/partners/events",
unpublishedEvents: "/api/events/unpublished" unpublishedEvents: "/api/v1/events/unpublished"
}; };
......
...@@ -5,7 +5,6 @@ from . import views ...@@ -5,7 +5,6 @@ from . import views
app_name = "thaliapp" app_name = "thaliapp"
urlpatterns = [ urlpatterns = [
url(r'^token-auth/', rfviews.obtain_auth_token),
url(r'^login', views.login, url(r'^login', views.login,
name='thaliapp-login'), name='thaliapp-login'),
url(r'^app', views.app, url(r'^app', views.app,
......
...@@ -171,6 +171,8 @@ REST_FRAMEWORK = { ...@@ -171,6 +171,8 @@ REST_FRAMEWORK = {
), ),
'DEFAULT_PAGINATION_CLASS': 'DEFAULT_PAGINATION_CLASS':
'rest_framework.pagination.LimitOffsetPagination', 'rest_framework.pagination.LimitOffsetPagination',
'DEFAULT_VERSIONING_CLASS':
'rest_framework.versioning.NamespaceVersioning',
} }
# Internationalization # Internationalization
......
...@@ -32,23 +32,23 @@ import os.path ...@@ -32,23 +32,23 @@ import os.path
from django.conf import settings from django.conf import settings
from django.conf.urls import include, url from django.conf.urls import include, url
from django.conf.urls.static import static from django.conf.urls.static import static
from django.contrib.auth.views import login
from django.contrib import admin from django.contrib import admin
from django.contrib.auth.views import login
from django.contrib.sitemaps.views import sitemap from django.contrib.sitemaps.views import sitemap
from django.views.generic import TemplateView from django.views.generic import TemplateView
from django.views.i18n import JavaScriptCatalog from django.views.i18n import JavaScriptCatalog
from rest_framework.authtoken import views as rfviews
import members import members
from activemembers.sitemaps import sitemap as activemembers_sitemap from activemembers.sitemaps import sitemap as activemembers_sitemap
from documents.sitemaps import sitemap as documents_sitemap from documents.sitemaps import sitemap as documents_sitemap
from events.feeds import DeprecationFeed from events.feeds import DeprecationFeed
from events.sitemaps import sitemap as events_sitemap
from members.sitemaps import sitemap as members_sitemap from members.sitemaps import sitemap as members_sitemap
from partners.sitemaps import sitemap as partners_sitemap from partners.sitemaps import sitemap as partners_sitemap
from thabloid.sitemaps import sitemap as thabloid_sitemap from thabloid.sitemaps import sitemap as thabloid_sitemap
from events.sitemaps import sitemap as events_sitemap
from thaliawebsite.forms import AuthenticationForm from thaliawebsite.forms import AuthenticationForm
from utils.views import private_thumbnails, generate_thumbnail from utils.views import private_thumbnails, generate_thumbnail
from . import views from . import views
from .sitemaps import StaticViewSitemap from .sitemaps import StaticViewSitemap
...@@ -100,11 +100,14 @@ urlpatterns = [ ...@@ -100,11 +100,14 @@ urlpatterns = [
url(r'^private-thumbnails/(?P<size_fit>\d+x\d+_[01])/(?P<path>.*)', private_thumbnails, name='private-thumbnails'), url(r'^private-thumbnails/(?P<size_fit>\d+x\d+_[01])/(?P<path>.*)', private_thumbnails, name='private-thumbnails'),
url(r'^generate-thumbnail/(?P<size_fit>\d+x\d+_[01])/(?P<path>[^/]+)/(?P<thumbpath>[^/]+)', generate_thumbnail, name='generate-thumbnail'), url(r'^generate-thumbnail/(?P<size_fit>\d+x\d+_[01])/(?P<path>[^/]+)/(?P<thumbpath>[^/]+)', generate_thumbnail, name='generate-thumbnail'),
url(r'^api/', include([ url(r'^api/', include([
url(r'^', include('events.api.urls')),
url(r'^', include('members.api.urls')),
url(r'^', include('partners.api.urls')),
url(r'^', include('thaliapp.urls')),
url(r'wikilogin', views.wiki_login), url(r'wikilogin', views.wiki_login),
url(r'^v1/', include([
url(r'^token-auth', rfviews.obtain_auth_token),
url(r'^', include('events.api.urls')),
url(r'^', include('members.api.urls')),
url(r'^', include('partners.api.urls')),
], namespace='v1')),
url(r'^', include('thaliapp.urls')),
])), ])),
url(r'^education/', include('education.urls')), url(r'^education/', include('education.urls')),
url(r'^announcements/', include('announcements.urls')), url(r'^announcements/', include('announcements.urls')),
......
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