Install mypy and make the minimum changes necessary for it to pass, albeit using --ignore-missing-imports

This commit is contained in:
Danielle McLean 2018-05-29 09:37:28 +10:00
parent 142e3eff2b
commit c9f66eb91c
Signed by untrusted user: 00dani
GPG key ID: 8EB789DDF3ABD240
6 changed files with 44 additions and 6 deletions

View file

@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/1.11/ref/settings/
"""
from os import path
from typing import List
APPEND_SLASH = False
@ -30,7 +31,7 @@ SECRET_KEY = '6riil57g@r^wprf7mdy((+bs&(6l*phcn9&fd$l0@t-kzj+xww'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
ALLOWED_HOSTS = [] # type: List[str]
INTERNAL_IPS = ['127.0.0.1', '::1']
# Settings to tighten up security - these can safely be on in dev mode too,

View file

@ -13,8 +13,11 @@ Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from typing import Tuple
from django.conf import settings
from django.urls import include, path
from django.urls.resolvers import URLPattern
from django.views.generic import RedirectView
from django.contrib import admin
@ -47,10 +50,10 @@ urlpatterns = (
path('sitemap.xml', sitemap.index, maps, name='sitemap'),
path('sitemaps/<section>.xml', sitemap.sitemap, maps,
name='django.contrib.sitemaps.views.sitemap'),
)
) # type: Tuple[URLPattern, ...]
if settings.DEBUG:
import debug_toolbar
urlpatterns = (
urlpatterns += (
path('__debug__/', include(debug_toolbar.urls)),
) + urlpatterns
)