From 4bb4f7cbdd145d967d32fc326a8185d326e477c5 Mon Sep 17 00:00:00 2001 From: Graham Ullrich Date: Sat, 24 Mar 2018 14:36:11 -0600 Subject: [PATCH] Keep imports sorted correctly Use two separate conditionals for Django version-specific imports in order for imports to show in correct sort order. --- project_name/urls.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/project_name/urls.py b/project_name/urls.py index 0f564ce..1c6144f 100644 --- a/project_name/urls.py +++ b/project_name/urls.py @@ -1,6 +1,7 @@ from django.conf import settings -{% if django_version >= "2" %}from django.urls import include, path{% else %}from django.conf.urls import include, url{% endif %} +{% if django_version < "2" %}from django.conf.urls import include, url{% endif %} from django.conf.urls.static import static +{% if django_version >= "2" %}from django.urls import include, path{% endif %} from django.views.generic import TemplateView from django.contrib import admin