title: Django project to .exe with Pyinstaller - Missing modules, ModuleNotFoundError
body: <p>I am working to convert my Django project to a .exe file using Pyinstaller. I want to be able to just click an icon and open the project in a browser. Here is my folder structure:</p>
  
  <pre><code>proj
      __pycache__
      proj
          __pycache__
          __init__.py
          manage.py
          Dashboard
              __pycache__
              __init__.py
              urls.py
          proj
              __pycache__
              __init__.py
              settings.py
              urls.py
              wsgi.py
      static_cdn
  </code></pre>
  
  <p>And here is my manage.py file:</p>
  
  <pre><code># -*- coding: utf-8 -*-
  import os
  import sys
  
  if __name__ == "__main__":
      os.environ.setdefault("DJANGO_SETTINGS_MODULE", "proj.settings")
      print("here")
      try:
          from django.core.management import execute_from_command_line
      except ImportError as exc:
          raise ImportError(
              "Couldn't import Django. Are you sure it's installed and "
              "available on your PYTHONPATH environment variable? Did you "
              "forget to activate a virtual environment?"
          ) from exc
  
      import django.test
      from html.parser import HTMLParser
      execute_from_command_line(sys.argv)
  </code></pre>
  
  <p>Currently I cd to C:...\proj, then run <code>pyinstaller --name=Dashboard proj/manage.py</code>. Then when I click on Dashboard.exe in C:...\proj\dist\Dashboard, an error comes up.<a href="https://i.stack.imgur.com/CHS7B.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CHS7B.png" alt="errorMessage"></a></p>
  
  <p>I'm not sure what is going wrong here. I think I may either have something wrong with my folder structure, or I may be calling the pyinstaller in the wrong folder. Any help is super appreciated!</p>
  
  <p>Additional information:</p>
  
  <ul>
  <li>I am following directions from <a href="https://github.com/pyinstaller/pyinstaller/wiki/Recipe-Executable-From-Django" rel="nofollow noreferrer">this tutorial</a> on how to make a .exe</li>
  <li>A <a href="https://stackoverflow.com/questions/30001009/django-import-error-no-module-named-apps/30001066?utm_medium=organic&amp;utm_source=google_rich_qa&amp;utm_campaign=google_rich_qa">similar question</a> suggested adding an <code>__init__.py</code> file to C:...\proj\proj, however this makes the pyinstaller function fail with the error <code>ModuleNotFoundError: No module named 'proj.settings'</code>.</li>
  <li>I followed the answer of <a href="https://stackoverflow.com/questions/18494620/django-to-desktop-app-with-pyinstaller?rq=1">this question</a> in my manage.py file.</li>
  </ul>