title: Django All-Auth django.contrib.auth.backends.ModelBackend invalid syntax
body: <p>I am fairly new to Django so I have been following tutorials and guides to learn as I go along. I am currently attempting to do a E-commerce Django project following a youtube tutorial by freeCodeCamp. </p>
  
  <p>In the beginning you need to install Django-AllAuth which I have done.</p>
  
  <p>The issue I am currently having is when you need to migrate the installed apps it throws me a 'Invalid Syntax Error' on the 'django.contrib.auth.backends.ModelBackend' in the Authentication_Backends section in settings.</p>
  
  <p>My settings.py</p>
  
  <pre><code>import os
  
  ENVIRONMENT = os.getenv('ENVIRONMENT', 'development')
  
  DEBUG = True
  BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  SECRET_KEY = '-05sgp9!deq=q1nltm@^^2cc+v29i(tyybv3v2t77qi66czazj'
  ALLOWED_HOSTS = []
  
  INSTALLED_APPS = [
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'django.contrib.sites',
  
      'allauth',
      'allauth.account',
      'allauth.socialaccount',
  
      'core'
  ]
  
  MIDDLEWARE = [
      'django.middleware.security.SecurityMiddleware',
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      'django.middleware.clickjacking.XFrameOptionsMiddleware'
  ]
  
  ROOT_URLCONF = 'ecommerce.urls'
  
  TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': [os.path.join(BASE_DIR, 'templates')],
          'APP_DIRS': True,
          'OPTIONS': {
              'context_processors': [
                  'django.template.context_processors.debug',
                  'django.template.context_processors.request',
                  'django.contrib.auth.context_processors.auth',
                  'django.contrib.messages.context_processors.messages',
              ],
          },
      },
  ]
  
  LANGUAGE_CODE = 'en-us'
  TIME_ZONE = 'UTC'
  USE_I18N = True
  USE_L10N = True
  USE_TZ = True
  
  STATIC_URL = '/static/'
  STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static_files')]
  STATIC_ROOT = os.path.join(BASE_DIR, 'static')
  MEDIA_URL = '/media/'
  MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
  
  DATABASES = {
      "default": {
          "ENGINE": "django.db.backends.sqlite3",
          "NAME": os.path.join(BASE_DIR, 'db.sqlite3')
      }
  }
  
  if ENVIRONMENT == 'production':
      DEBUG = False
      SECRET_KEY = os.getenv('SECRET_KEY')
      SESSION_COOKIE_SECURE = True
      SECURE_BROWSER_XSS_FILTER = True
      SECURE_CONTENT_TYPE_NOSNIFF = True
      SECURE_HSTS_INCLUDE_SUBDOMAINS = True
      SECURE_HSTS_SECONDS = 31536000
      SECURE_REDIRECT_EXEMPT = []
      SECURE_SSL_REDIRECT = True
      SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
  
  # Auth
  
  AUTHENTICATION_BACKENDS = (
      ...
      # Needed to login by username in Django admin, regardless of `allauth`
      'django.contrib.auth.backends.ModelBackend',
  
      # `allauth` specific authentication methods, such as login by e-mail
      'allauth.account.auth_backends.AuthenticationBackend',
      ...
  )
  SITE_ID = 1
  
  </code></pre>
  
  <p>The error I am getting</p>
  
  <pre><code>PS G:\Git\Django\ecommerce&gt; python manage.py migrate sites
  Traceback (most recent call last):
    File "manage.py", line 15, in &lt;module&gt;
      execute_from_command_line(sys.argv)
    File "C:\Users\dylan\Anaconda3\envs\djangoenv\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
      utility.execute()
    File "C:\Users\dylan\Anaconda3\envs\djangoenv\lib\site-packages\django\core\management\__init__.py", line 325, in execute
      settings.INSTALLED_APPS
    File "C:\Users\dylan\Anaconda3\envs\djangoenv\lib\site-packages\django\conf\__init__.py", line 79, in __getattr__
  
      self._setup(name)
    File "C:\Users\dylan\Anaconda3\envs\djangoenv\lib\site-packages\django\conf\__init__.py", line 66, in _setup
      self._wrapped = Settings(settings_module)
    File "C:\Users\dylan\Anaconda3\envs\djangoenv\lib\site-packages\django\conf\__init__.py", line 157, in __init__
      mod = importlib.import_module(self.SETTINGS_MODULE)
    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 674, in exec_module
    File "&lt;frozen importlib._bootstrap_external&gt;", line 781, in get_code
    File "&lt;frozen importlib._bootstrap_external&gt;", line 741, in source_to_code
    File "&lt;frozen importlib._bootstrap&gt;", line 219, in _call_with_frames_removed
    File "G:\Git\Django\ecommerce\ecommerce\settings.py", line 90
      'django.contrib.auth.backends.ModelBackend',
                                                ^
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>Any help will be greatly appreciated.</p>