From e60d5fedfae23284107f277afe65c6d832c816f4 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Wed, 9 Jul 2014 14:23:45 -0400 Subject: [PATCH] Add django rest swagger to the requirements --- mayan/settings.py | 19 ++++++++++++-- mayan/urls.py | 1 + requirements/common.txt | 1 + setup.py | 58 ++++++++++++++++++++--------------------- 4 files changed, 48 insertions(+), 31 deletions(-) diff --git a/mayan/settings.py b/mayan/settings.py index eb4a3386c1..46f1c303a1 100644 --- a/mayan/settings.py +++ b/mayan/settings.py @@ -45,9 +45,8 @@ INSTALLED_APPS = ( 'django.contrib.comments', 'django.contrib.staticfiles', # 3rd party -# South 'south', -# Others + 'rest_framework_swagger', 'filetransfers', 'taggit', 'mptt', @@ -268,6 +267,22 @@ REST_FRAMEWORK = { 'PAGINATE_BY_PARAM': 'page_size', 'MAX_PAGINATE_BY': 100, } +# ---------- Swagger --------------- +SWAGGER_SETTINGS = { + #"exclude_namespaces": [], # List URL namespaces to ignore + #"api_version": '0.1', # Specify your API's version + #"api_path": "/", # Specify the path to your API not a root level + #"enabled_methods": [ # Specify which methods to enable in Swagger UI + # 'get', + # 'post', + # 'put', + # 'patch', + # 'delete' + #], + #"api_key": '', # An API key + #"is_authenticated": False, # Set to True to enforce user authentication, + #"is_superuser": False, # Set to True to enforce admin only access +} try: from settings_local import * diff --git a/mayan/urls.py b/mayan/urls.py index f984cf53e0..a01a8486cb 100644 --- a/mayan/urls.py +++ b/mayan/urls.py @@ -10,6 +10,7 @@ urlpatterns = patterns('', (r'^', include('common.urls')), (r'^', include('main.urls')), + url(r'^docs/', include('rest_framework_swagger.urls')), (r'^documents/', include('documents.urls')), (r'^folders/', include('folders.urls')), (r'^search/', include('dynamic_search.urls')), diff --git a/requirements/common.txt b/requirements/common.txt index 9ab2e2b0bb..75d23ac2e3 100644 --- a/requirements/common.txt +++ b/requirements/common.txt @@ -8,6 +8,7 @@ django-pagination==1.0.7 django-compressor==1.4 django-taggit==0.12 django-mptt==0.6.0 +django-rest-swagger==0.1.14 django-sendfile==0.3.4 djangorestframework==2.3.13 diff --git a/setup.py b/setup.py index 979f4028db..277b6b923c 100644 --- a/setup.py +++ b/setup.py @@ -51,35 +51,35 @@ def find_packages(directory): data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]]) return packages -install_requires = [ -'APScheduler==2.0.3', -'cssmin==0.1.4', -'Django==1.6.5', -'django-filetransfers==0.1.0', -'django-pagination==1.0.7', -'django-compressor==1.4', -'django-taggit==0.12', -'django-mptt==0.6.0', -'django-sendfile==0.3.4', -'djangorestframework==2.3.13', -'GitPython==0.3.2.RC1', -'ghostscript==0.4.1', -'Pillow==2.4.0', -'PyYAML==3.10', -'pbs==0.105', -'pdfminer==20110227', -'psutil==0.5.1', -'python-gnupg==0.3.6', -'python-hkp==0.1.3', -'python-magic==0.4.6', -'pytz==2014.4', -'requests==0.14.1', -'South==0.8.4', -'sh==1.09', -'slate==0.3', -'unicode-slugify==0.1', -'wsgiref==0.1.2', -] +install_requires = """ +APScheduler==2.0.3 +cssmin==0.1.4 +Django==1.6.5 +django-filetransfers==0.1.0 +django-pagination==1.0.7 +django-compressor==1.4 +django-taggit==0.12 +django-mptt==0.6.0 +django-rest-swagger==0.1.14 +django-sendfile==0.3.4 +djangorestframework==2.3.13 +GitPython==0.3.2.RC1 +ghostscript==0.4.1 +Pillow==2.4.0 +PyYAML==3.10 +pdfminer==20110227 +psutil==0.5.1 +pytz==2014.4 +python-gnupg==0.3.6 +python-hkp==0.1.3 +python-magic==0.4.6 +requests==0.14.1 +sh==1.09 +slate==0.3 +South==0.8.4 +unicode-slugify==0.1 +wsgiref==0.1.2 +""".split() with open('README.rst') as f: readme = f.read()