title: How to fix the error cause when execute manage.py runserver command in Django?
body: <p>I recently join with ongoing project which has done using Django framework and I am new to this framework. This code is not mine. When I run python manage.py runserver command I receive following error.  </p>
  
  <p>I have done all the configuration asked in readme file. </p>
  
  <p>This is the local.py file</p>
  
  <pre><code>try:
      from .base import *
  except ImportError:
      pass
  
  from configparser import RawConfigParser
  
  
  config = RawConfigParser()
  config.read('/etc/django_settings/hopster_settings.ini')
  
  SECRET_KEY = config.get('secrets', 'SECRET_KEY')
  
  # SECURITY WARNING: don't run with debug turned on in production!
  DEBUG = True
  
  ALLOWED_HOSTS = []
  
  INSTALLED_APPS += [
      'rest_framework_swagger',  # to enable swagger documentation for rest api
      'django_extensions',  # for print db schemas
  ]
  
  DATABASES = {
      'default': {
          'ENGINE': config.get('database', 'DATABASE_ENGINE'),
          'NAME': config.get('database', 'DATABASE_NAME'),
          'USER': config.get('database', 'DATABASE_USER'),
          'PASSWORD': config.get('database', 'DATABASE_PASSWORD'),
          'HOST': config.get('database', 'DATABASE_HOST'),
          'PORT': config.get('database', 'DATABASE_PORT'),
      }
  }
  
  SITE_ID = 1
  
  STATIC_URL = '/static/'
  
  STATIC_NAME = 'hopster_static_cdn'
  MEDIA_NAME = 'hopster_media_cdn'
  
  STATICFILES_DIRS = [
      os.path.join(os.path.dirname(BASE_DIR), "static"),
      # '/var/www/static/',
  
  ]
  
  STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), STATIC_NAME)
  
  
  # STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'images', 'static')
  
  # STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), "english_vlog_static_cdn")
  
  # media files on local server
  MEDIA_URL = "/media/"
  MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), MEDIA_NAME)
  
  STATICFILES_FINDERS = (
      'django.contrib.staticfiles.finders.FileSystemFinder',
      'django.contrib.staticfiles.finders.AppDirectoriesFinder',
      'django.contrib.staticfiles.finders.DefaultStorageFinder',
  )
  
  
  REST_FRAMEWORK = {
      'DEFAULT_RENDERER_CLASSES': (
          'rest_framework.renderers.JSONRenderer',  # convert rest output into json format by ignoring browsable API
          'rest_framework.renderers.BrowsableAPIRenderer',  # to get the browsable API in web
      ),
      # 'DEFAULT_PARSER_CLASSES': (
      #     'rest_framework.parsers.JSONParser',
      # )
      'DEFAULT_AUTHENTICATION_CLASSES': (
          'rest_framework.authentication.SessionAuthentication',
          'rest_framework.authentication.TokenAuthentication',
          # 'oauth2_provider.ext.rest_framework.OAuth2Authentication', Deprecated
          'oauth2_provider.contrib.rest_framework.OAuth2Authentication',
          # social authentication
          'rest_framework_social_oauth2.authentication.SocialAuthentication',
      ),
      'DEFAULT_PERMISSION_CLASSES': (
          'rest_framework.permissions.IsAuthenticatedOrReadOnly',
          'rest_framework.permissions.IsAuthenticated',
  
      )
  }
  
  OAUTH_SINGLE_ACCESS_TOKEN = True
  OAUTH2_PROVIDER = {
      'OAUTH_SINGLE_ACCESS_TOKEN': True,
      'OAUTH_DELETE_EXPIRED': True,
      # 'ACCESS_TOKEN_EXPIRE_SECONDS': 24 * 60 * 60,    # expires after 24 hours (default 10 hours = 36000s)
      # 'ACCESS_TOKEN_EXPIRE_SECONDS': 60 * 60,    # expires after 1 hour (default 10 hours = 36000s)
      'ACCESS_TOKEN_EXPIRE_SECONDS': 60 * 60 * 24 * 366,  # expires after 1 year
  
      'REFRESH_TOKEN_EXPIRE_SECONDS': 60,
      # this is the list of available scopes
      'SCOPES': {
          'read': 'Read scope',
          'write': 'Write scope',
          'groups': 'Access to your groups'
      }
  }
  
  
  AUTHENTICATION_BACKENDS = (
      # weixin a.k.a wechat oauth2
      # 'social_core.backends.weixin.WeixinOAuth2',
  
      # vk oauth2
      'social_core.backends.vk.VKOAuth2',
  
      # Others auth providers (e.g. Google, OpenId, etc)
  
      # Facebook OAuth2
      'social_core.backends.facebook.FacebookAppOAuth2',
      'social_core.backends.facebook.FacebookOAuth2',
  
      'oauth2_provider.backends.OAuth2Backend',
  
      # Google Oauth2
      'social_core.backends.google.GoogleOAuth2',
  
      # django-rest-framework-social-oauth2
      'rest_framework_social_oauth2.backends.DjangoOAuth2',
  
      # Django
      'django.contrib.auth.backends.ModelBackend',
  
      'oauth2_provider.backends.OAuth2Backend',
  
  )
  
  # fill these
  SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = ''
  SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = ''
  SOCIAL_AUTH_GOOGLE_CLIENT_ID = ''
  
  
  # for Gmail
  EMAIL_USE_TLS = True
  EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
  EMAIL_HOST = 'smtp.gmail.com'
  EMAIL_HOST_USER = 'hopster.dev@gmail.com'
  EMAIL_HOST_PASSWORD = 'Hopster@123'
  EMAIL_PORT = 587
  DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
  </code></pre>
  
  <p>This is the wsgi.py file </p>
  
  <pre><code>import os
  
  from django.core.wsgi import get_wsgi_application
  
  os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hopster.settings.local")
  
  application = get_wsgi_application()
  </code></pre>
  
  <p>This is the error</p>
  
  <p>Traceback (most recent call last):
    File "manage.py", line 22, in 
      execute_from_command_line(sys.argv)
    File "F:\Python Project\Hopster Mobile Application\Test\hopster\venv\lib\site-packages\django\core\management__init__.py", line 381, in execute_from_command_line
      utility.execute()</p>
  
  <p>File "F:\Python Project\Hopster Mobile Application\Test\hopster\venv\lib\site-packages\django\core\management__init__.py", line 375, in execute
      self.fetch_command(subcommand).run_from_argv(self.argv)</p>
  
  <p>File "F:\Python Project\Hopster Mobile Application\Test\hopster\venv\lib\site-packages\django\core\management\base.py", line 316, in run_from_argv
      self.execute(*args, **cmd_options)</p>
  
  <p>File "F:\Python Project\Hopster Mobile Application\Test\hopster\venv\lib\site-packages\django\core\management\commands\runserver.py", line 60, in execute
      super().execute(*args, **options)</p>
  
  <p>File "F:\Python Project\Hopster Mobile Application\Test\hopster\venv\lib\site-packages\django\core\management\base.py", line 353, in execute
      output = self.handle(*args, **options)</p>
  
  <p>File "F:\Python Project\Hopster Mobile Application\Test\hopster\venv\lib\site-packages\django\core\management\commands\runserver.py", line 67, in handle
      if not settings.DEBUG and not settings.ALLOWED_HOSTS:</p>
  
  <p>File "F:\Python Project\Hopster Mobile Application\Test\hopster\venv\lib\site-packages\django\conf__init__.py", line 57, in <strong>getattr</strong>
      self._setup(name)</p>
  
  <p>File "F:\Python Project\Hopster Mobile Application\Test\hopster\venv\lib\site-packages\django\conf__init__.py", line 44, in _setup
      self._wrapped = Settings(settings_module)</p>
  
  <p>File "F:\Python Project\Hopster Mobile Application\Test\hopster\venv\lib\site-packages\django\conf__init__.py", line 126, in <strong>init</strong>
      raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")</p>
  
  <p>django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.</p>