summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfengyuanxing <feng.yuanxing@zte.com.cn>2018-01-23 15:20:17 +0800
committerfengyuanxing <feng.yuanxing@zte.com.cn>2018-01-23 17:25:28 +0800
commit3c86cfe7354fe55ba98d35757b5ba0fa59e70d53 (patch)
treefbfb5a2eea9b54ed9208285096ab25889e710e26
parentcf7ecd570f0fd6b7f134cfaf0c2b17b2a0985ca3 (diff)
Modify code of requirement and settings
Change-Id: I52452ec36358c72e7188ee0bee3ea3d65a504637 Issue-ID: VFC-675 Signed-off-by: fengyuanxing <feng.yuanxing@zte.com.cn>
-rw-r--r--catalog/jobs/urls.py11
-rw-r--r--catalog/settings.py28
-rw-r--r--catalog/swagger/urls.py11
-rw-r--r--requirements.txt19
4 files changed, 51 insertions, 18 deletions
diff --git a/catalog/jobs/urls.py b/catalog/jobs/urls.py
index d2e000fd..ea1fcd64 100644
--- a/catalog/jobs/urls.py
+++ b/catalog/jobs/urls.py
@@ -11,13 +11,10 @@
# 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.conf.urls import patterns, url
-from rest_framework.urlpatterns import format_suffix_patterns
+from django.conf.urls import url
from catalog.jobs.views import JobView
-urlpatterns = patterns('',
- url(r'^api/catalog/v1/jobs/(?P<job_id>[0-9a-zA-Z_-]+)$', JobView.as_view()),
- )
-
-urlpatterns = format_suffix_patterns(urlpatterns)
+urlpatterns = [
+ url(r'^api/catalog/v1/jobs/(?P<job_id>[0-9a-zA-Z_-]+)$', JobView.as_view()),
+]
diff --git a/catalog/settings.py b/catalog/settings.py
index 3c13adeb..07132361 100644
--- a/catalog/settings.py
+++ b/catalog/settings.py
@@ -46,7 +46,33 @@ INSTALLED_APPS = [
'rest_framework',
'catalog.pub.database',
'catalog.samples',
- 'catalog.swagger'
+ 'catalog.swagger',
+
+ 'drf_yasg',
+]
+
+# drf-yasg
+SWAGGER_SETTINGS = {
+ 'LOGIN_URL': '/admin/login',
+ 'LOGOUT_URL': '/admin/logout',
+
+ 'DEFAULT_INFO': 'catalog.urls.swagger_info'
+}
+
+TEMPLATES = [
+ {
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
+ 'DIRS': [],
+ 'APP_DIRS': True,
+ 'OPTIONS': {
+ 'context_processors': [
+ 'django.template.context_processors.debug',
+ 'django.template.context_processors.request',
+ 'django.contrib.auth.context_processors.auth',
+ 'django.contrib.messages.context_processors.messages',
+ ],
+ },
+ },
]
MIDDLEWARE_CLASSES = [
diff --git a/catalog/swagger/urls.py b/catalog/swagger/urls.py
index a7da03d1..b5e91f07 100644
--- a/catalog/swagger/urls.py
+++ b/catalog/swagger/urls.py
@@ -12,13 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from django.conf.urls import patterns, url
-from rest_framework.urlpatterns import format_suffix_patterns
+from django.conf.urls import url
from catalog.swagger.views import SwaggerJsonView
-urlpatterns = patterns('',
- url(r'^api/catalog/v1/swagger.json$', SwaggerJsonView.as_view())
- )
-
-urlpatterns = format_suffix_patterns(urlpatterns)
+urlpatterns = [
+ url(r'^api/catalog/v1/swagger.json$', SwaggerJsonView.as_view())
+]
diff --git a/requirements.txt b/requirements.txt
index db0014ec..10ad7a1c 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,6 +1,6 @@
# rest framework
-Django==1.9.6
-djangorestframework==3.3.3
+Django==1.11.9
+djangorestframework==3.7.7
# for access MySQL
MySQL-python==1.2.5
@@ -23,4 +23,17 @@ unittest_xml_reporting==1.12.0
# for parser
cryptography==2.0.3
paramiko==2.0.2
-nfv-toscaparser>=0.5.0 \ No newline at end of file
+nfv-toscaparser>=0.5.0
+
+# for auto swagger
+drf-yasg>=1.2.2
+Pillow>=4.3.0
+pygments>=2.2.0
+django-cors-headers>=2.1.0
+django-filter>=1.1.0,<2.0; python_version == "2.7"
+django-filter>=1.1.0; python_version >= "3.4"
+djangorestframework-camel-case>=0.2.0
+dj-database-url>=0.4.2
+user_agents>=1.1.0
+flex>=6.11.1
+swagger-spec-validator>=2.1.0 \ No newline at end of file