title: How to fix problem with DJANGO_SETTINGS_MODULE?
body: <p>I am pretty beginner in django and in coding too. Stuck for a while with an error. Will really appreciate if someone's help me!I tried to google it and it gave me a lot of solutions, I tried them but it gave errors too. What should I write to make things done? I took this code from <a href="https://www.youtube.com/watch?v=a48xeeo5Vnk&amp;list=PL-osiE80TeTtoQCKZ03TU5fNfx2UY6U4p&amp;index=2" rel="nofollow noreferrer">https://www.youtube.com/watch?v=a48xeeo5Vnk&amp;list=PL-osiE80TeTtoQCKZ03TU5fNfx2UY6U4p&amp;index=2</a></p>
  
  <pre><code>from django.contrib import admin
  from django.urls import path, include
  
  urlpatterns = [
      path('admin/', admin.site.urls),
      path('blog/', include('blog.urls')),
  ]
  </code></pre>
  
  <p>And it gave me this error:</p>
  
  <pre><code>  File "urls.py", line 21, in &lt;module&gt;
      path('admin/', admin.site.urls),
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/utils/functional.py", line 256, in inner
      self._setup()
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/contrib/admin/sites.py", line 529, in _setup
      AdminSiteClass = import_string(apps.get_app_config('admin').default_site)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/apps/registry.py", line 153, in get_app_config
      self.check_apps_ready()
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/apps/registry.py", line 134, in check_apps_ready
      settings.INSTALLED_APPS
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/conf/__init__.py", line 79, in __getattr__
      self._setup(name)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/conf/__init__.py", line 64, in _setup
      % (desc, ENVIRONMENT_VARIABLE))
  django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.```
  </code></pre>