title: Syntax Error in urls.py path upgrading to Django 2.1
body: <p>While manually upgrading to Django 2.1, I have Syntax Error in urls.py. I have removed regex characters the error persists. What's wrong? I have checked that that I didn't miss <code>,</code> or braces, but still no idea what is causing the error.</p>
  
  <pre><code>from django.conf.urls import url
  from django.contrib.auth import views as auth_views
  from django.views.generic.base import RedirectView
  
  from django.conf import settings
  from django.conf.urls.static import static
  
  import app.forms
  import app.views
  
  from django.urls import include,path
  from django.contrib import admin
  admin.autodiscover()
  
  urlpatterns = [
      path('', app.views.gallery, name='gallery'),
      path('favicon\.ico', RedirectView.as_view(url='/static/icons/favicon.ico', permanent=True)),
      path('&lt;slug:album_slug&gt;', app.views.AlbumDetail.as_view(), name='album'), #app.views.AlbumView.as_view()
  
      # Auth related urls
      path('accounts/login/', auth_views.LoginView.as_view(template_name='registration\login.html'), name='login'),
      path('logout', auth_views.LogOutView.as_view(next_page,template_name='registration\logged_out.html', name='logout'),
  
      # Uncomment the next line to enable the admin:
      path('admin/', admin.site.urls),
  
  
      # Uncomment the admin/doc line below to enable admin documentation:
      path('admin/doc/', include('django.contrib.admindocs.urls')),
      ]
      +static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
  
  handler404 = 'app.views.handler404'
  </code></pre>
  
  <p>Error trace:</p>
  
  <pre><code>(Django11) C:\Users\Kaleab\Desktop\Photo_Gallery\django-photo-gallery\django_pho
  to_gallery&gt;py -3.7 manage.py runserver
  Performing system checks...
  
  Unhandled exception in thread started by &lt;function check_errors.&lt;locals&gt;.wrapper
   at 0x000000D918D0E268&gt;
  Traceback (most recent call last):
    File "C:\Python37\lib\site-packages\django\utils\autoreload.py", line 225, in
  wrapper
      fn(*args, **kwargs)
    File "C:\Python37\lib\site-packages\django\core\management\commands\runserver.
  py", line 117, in inner_run
      self.check(display_num_errors=True)
    File "C:\Python37\lib\site-packages\django\core\management\base.py", line 379,
   in check
      include_deployment_checks=include_deployment_checks,
    File "C:\Python37\lib\site-packages\django\core\management\base.py", line 366,
   in _run_checks
      return checks.run_checks(**kwargs)
    File "C:\Python37\lib\site-packages\django\core\checks\registry.py", line 71,
  in run_checks
      new_errors = check(app_configs=app_configs)
    File "C:\Python37\lib\site-packages\django\core\checks\urls.py", line 40, in c
  heck_url_namespaces_unique
      all_namespaces = _load_all_namespaces(resolver)
    File "C:\Python37\lib\site-packages\django\core\checks\urls.py", line 57, in _
  load_all_namespaces
      url_patterns = getattr(resolver, 'url_patterns', [])
    File "C:\Python37\lib\site-packages\django\utils\functional.py", line 37, in _
  _get__
      res = instance.__dict__[self.name] = self.func(instance)
    File "C:\Python37\lib\site-packages\django\urls\resolvers.py", line 533, in ur
  l_patterns
      patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
    File "C:\Python37\lib\site-packages\django\utils\functional.py", line 37, in _
  _get__
      res = instance.__dict__[self.name] = self.func(instance)
    File "C:\Python37\lib\site-packages\django\urls\resolvers.py", line 526, in ur
  lconf_module
      return import_module(self.urlconf_name)
    File "C:\Python37\lib\importlib\__init__.py", line 127, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File "&lt;frozen importlib._bootstrap&gt;", line 994, in _gcd_import
    File "&lt;frozen importlib._bootstrap&gt;", line 971, in _find_and_load
    File "&lt;frozen importlib._bootstrap&gt;", line 955, in _find_and_load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 665, in _load_unlocked
    File "&lt;frozen importlib._bootstrap_external&gt;", line 675, in exec_module
    File "&lt;frozen importlib._bootstrap_external&gt;", line 782, in get_code
    File "&lt;frozen importlib._bootstrap_external&gt;", line 742, in source_to_code
    File "&lt;frozen importlib._bootstrap&gt;", line 219, in _call_with_frames_removed
    File "C:\Users\Kaleab\Desktop\Photo_Gallery\django-photo-gallery\django_photo_
  gallery\django_photo_gallery\urls.py", line 30
      ]
      ^
  SyntaxError: invalid syntax
  </code></pre>