From 9ddccf7d96ce02a8a38f0585fa1f500bdb4cb0f2 Mon Sep 17 00:00:00 2001 From: vorujack Date: Mon, 28 Nov 2016 18:54:08 +0330 Subject: [PATCH] Update urls.py --- ajaximage/urls.py | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/ajaximage/urls.py b/ajaximage/urls.py index b262e96..52ecb0e 100644 --- a/ajaximage/urls.py +++ b/ajaximage/urls.py @@ -1,13 +1,17 @@ -try: # pre 1.6 - from django.conf.urls.defaults import url, patterns -except ImportError: - from django.conf.urls import url, patterns +try: + try: # pre 1.6 + from django.conf.urls.defaults import url, patterns + except ImportError: + from django.conf.urls import url, patterns -urlpatterns = patterns( - '', - url( - '^upload/(?P.*)/(?P\d+)/(?P\d+)/(?P\d+)', - 'ajaximage.views.ajaximage', - name='ajaximage' - ), -) + urlpatterns = patterns('', + url('^upload/(?P.*)/(?P\d+)/(?P\d+)/(?P\d+)', + 'ajaximage.views.ajaximage', + name='ajaximage' + ), + ) +except ImportError: # Django 1.10 + from .views import * + urlpatterns = [ + url('^upload/(?P.*)/(?P\d+)/(?P\d+)/(?P\d+)', ajaximage, name='ajaximage'), + ]