From 6904ff011a0417350b362fc3b74f2a76e2f3794d Mon Sep 17 00:00:00 2001 From: pylixm Date: Fri, 29 Jun 2018 10:06:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AF=B9django=202.x=20?= =?UTF-8?q?=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mdeditor/urls.py | 13 ++++++++++--- setup.py | 4 +--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/mdeditor/urls.py b/mdeditor/urls.py index 961cb2c..ecccfab 100644 --- a/mdeditor/urls.py +++ b/mdeditor/urls.py @@ -1,7 +1,14 @@ # -*- coding:utf-8 -*- -from django.conf.urls import url +import django + from .views import UploadView +if django.VERSION[0] > 1: + from django.urls import re_path as url_func +else: + from django.conf.urls import url as url_func + + urlpatterns = [ - url(r'^uploads/$', UploadView.as_view(), name='uploads'), -] + url_func(r'^uploads/$', UploadView.as_view(), name='uploads'), +] \ No newline at end of file diff --git a/setup.py b/setup.py index 4b84fe3..6af5b78 100644 --- a/setup.py +++ b/setup.py @@ -18,9 +18,6 @@ url='', author='pylixm', author_email='pyli.xm@gmail.com', - install_requires=[ - 'django==1.11.10', - ], classifiers=[ 'Environment :: Web Environment', 'Framework :: Django', @@ -29,6 +26,7 @@ 'Framework :: Django :: 1.9', 'Framework :: Django :: 1.10', 'Framework :: Django :: 1.11', + 'Framework :: Django :: 2.0', 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', 'Operating System :: OS Independent',