title: Server Error (500) when trying to log in in Django admin page
body: <p>I am having a little project and am trying to set up a website using Django, Apache 2 and mod_wsgi. Everything runs fine in the Django development server, and I can also open the front page of my site using apache. </p>
  
  <p>However, when I try to log in into the admin page, or use my own custom log in page, I get a Server error (500). Can anyone tell me what I am doing wrong?</p>
  
  <p>settings.py:</p>
  
  <pre><code>import os
  
  BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  
  SECRET_KEY = ...
  
  DEBUG = True
  
  ALLOWED_HOSTS = ["localhost", "192.168.0.121", "127.0.0.1"]
  
  LOGIN_REDIRECT_URL='/account'
  LOGOUT_REDIRECT_URL='/login'
  
  INSTALLED_APPS = [
      'account.apps.AccountConfig',
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
  ]
  
  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 = 'kraken.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',
              ],
          },
      },
  ]
  
  WSGI_APPLICATION = 'kraken.wsgi.application'
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.sqlite3',
          'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
      }
  }
  
  AUTH_PASSWORD_VALIDATORS = [
      {
          'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
      },
      {
          'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
      },
      {
          'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
      },
      {
          'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
      },
  ]
  
  LANGUAGE_CODE = 'en-us'
  
  TIME_ZONE = 'UTC'
  
  USE_I18N = True
  
  USE_L10N = True
  
  USE_TZ = True
  
  STATIC_URL = '/static/'
  STATIC_ROOT = os.path.join(BASE_DIR, "static/")
  </code></pre>
  
  <p>000-default.conf:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      ServerAdmin webmaster@localhost
      DocumentRoot /var/www/html        
      Alias /static /home/pi/kraken/static
      Alias /favicon.ico /home/pi/kraken/static/favicon.ico
      &lt;Directory /home/pi/kraken/static&gt;
              Require all granted
      &lt;/Directory&gt;
  
      &lt;Directory /home/pi/kraken/kraken&gt;
              &lt;Files wsgi.py&gt;
                      Require all granted
              &lt;/Files&gt;
      &lt;/Directory&gt;
      WSGIDaemonProcess kraken python-path=/home/pi/kraken python-home=/home/pi/.conda/envs/django
      WSGIProcessGroup kraken
      WSGIScriptAlias / /home/pi/kraken/kraken/wsgi.py
  
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>I used chown :www-data on my database and my project folder</p>