From f6c49c20d9ef757088d7f8a5992f27617efbb542 Mon Sep 17 00:00:00 2001 From: adriant Date: Wed, 5 Aug 2015 14:48:00 +1200 Subject: [PATCH] adding django rest swagger docs also removing pointless admin views and models Change-Id: If1dd178cac9d54f1a81f816b77708482e4d909b1 --- .gitignore | 1 + requirements.txt | 1 + setup.py | 3 ++- stacktask/api/admin.py | 19 ------------------- stacktask/base/admin.py | 18 ------------------ stacktask/openerp/admin.py | 3 --- stacktask/settings.py | 1 + stacktask/urls.py | 3 +-- 8 files changed, 6 insertions(+), 43 deletions(-) delete mode 100644 stacktask/api/admin.py delete mode 100644 stacktask/base/admin.py delete mode 100644 stacktask/openerp/admin.py diff --git a/.gitignore b/.gitignore index c78d202..f84b6ab 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ *.log stacktask.egg-info/* dist/* +.tox/* diff --git a/requirements.txt b/requirements.txt index c41d228..d0aebdd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ keystonemiddleware>=1.3.1 python-keystoneclient>=1.0.0 python-neutronclient>=2.3.10 jsonfield>=1.0.2 +django-rest-swagger>=0.3.3 diff --git a/setup.py b/setup.py index 9a829ea..2635168 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,8 @@ setup( 'keystonemiddleware>=1.3.1', 'python-keystoneclient>=1.0.0', 'python-neutronclient>=2.3.10', - 'pyyaml>=3.11' + 'pyyaml>=3.11', + 'django-rest-swagger>=0.3.3' ], entry_points={ 'console_scripts': [ diff --git a/stacktask/api/admin.py b/stacktask/api/admin.py deleted file mode 100644 index 253a1be..0000000 --- a/stacktask/api/admin.py +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (C) 2015 Catalyst IT Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -from django.contrib import admin -from stacktask.api.models import Token, Registration - -admin.site.register(Token) -admin.site.register(Registration) diff --git a/stacktask/base/admin.py b/stacktask/base/admin.py deleted file mode 100644 index 5afe807..0000000 --- a/stacktask/base/admin.py +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (C) 2015 Catalyst IT Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -from django.contrib import admin -from stacktask.base.models import Action - -admin.site.register(Action) diff --git a/stacktask/openerp/admin.py b/stacktask/openerp/admin.py deleted file mode 100644 index 8c38f3f..0000000 --- a/stacktask/openerp/admin.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.contrib import admin - -# Register your models here. diff --git a/stacktask/settings.py b/stacktask/settings.py index d99746f..95a27f0 100644 --- a/stacktask/settings.py +++ b/stacktask/settings.py @@ -50,6 +50,7 @@ INSTALLED_APPS = ( 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', + 'rest_framework_swagger', 'stacktask.base', 'stacktask.api', ) diff --git a/stacktask/urls.py b/stacktask/urls.py index edee564..a4d09b2 100644 --- a/stacktask/urls.py +++ b/stacktask/urls.py @@ -13,10 +13,9 @@ # under the License. from django.conf.urls import patterns, include, url -from django.contrib import admin urlpatterns = patterns( '', - url(r'^admin/', include(admin.site.urls)), + url(r'^docs/', include('rest_framework_swagger.urls')), url(r'^', include('stacktask.api.urls')), )