Django Templates and Apps Not Loading
<p>The title says most of it. I'm running Unittests.py in PyCharm on a tutorial and my templates folder is nested directly beneath my app folder (superlists/lists/templates/home.html). 
So here's the test I'm running superlists/lists/tests.py:</p>

<pre><code>def test_home_page_returns_correct_html(self):
    request = HttpRequest()

    response = home_page(request)
    expected_html = render_to_string('home.html')

    self.assertEqual(response.content.decode(), expected_html)
</code></pre>

<p>And here's the code it's being run on (superlists/lists/views.py)</p>

<pre><code>def home_page(request):
    return render(request, 'home.html')
</code></pre>

<p>And here's the error:</p>

<pre><code>   Error
Traceback (most recent call last):
  File "C:\Users\Me\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\template\utils.py", line 86, in __getitem__
    return self._engines[alias]
KeyError: 'django'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Me\PycharmProjects\superlists\lists\tests.py", line 19, in test_home_page_returns_correct_html
    response = home_page(request)
  File "C:\Users\Me\PycharmProjects\superlists\lists\views.py", line 8, in home_page
    return render(request, 'home.html')
  File "C:\Users\Me\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\shortcuts.py", line 67, in render
    template_name, context, request=request, using=using)
  File "C:\Users\Me\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\template\loader.py", line 96, in render_to_string
    template = get_template(template_name, using=using)
  File "C:\Users\Me\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\template\loader.py", line 26, in get_template
    engines = _engine_list(using)
  File "C:\Users\Me\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\template\loader.py", line 143, in _engine_list
    return engines.all() if using is None else [engines[using]]
  File "C:\Users\Me\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\template\utils.py", line 110, in all
    return [self[alias] for alias in self]
  File "C:\Users\Me\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\template\utils.py", line 110, in &lt;listcomp&gt;
    return [self[alias] for alias in self]
  File "C:\Users\Me\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\template\utils.py", line 101, in __getitem__
    engine = engine_cls(params)
  File "C:\Users\Me\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\template\backends\django.py", line 31, in __init__
    options['libraries'] = self.get_templatetag_libraries(libraries)
  File "C:\Users\Me\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\template\backends\django.py", line 49, in get_templatetag_libraries
    libraries = get_installed_libraries()
  File "C:\Users\Me\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\template\backends\django.py", line 121, in get_installed_libraries
    for app_config in apps.get_app_configs())
  File "C:\Users\Me\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\apps\registry.py", line 137, in get_app_configs
    self.check_apps_ready()
  File "C:\Users\Me\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\apps\registry.py", line 124, in check_apps_ready
    **raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.**
</code></pre>

<p>So, I checked two places in settings.py, INSTALLED_APPS and TEMPLATES.</p>

<p>Here's both sections:</p>

<pre><code>    INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'lists',
]
</code></pre>

<p>and</p>

<pre><code>    TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        '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',
            ],
        },
    },
]
</code></pre>

<p>Here's a short list of things I've tried:<br>
*Changing the source code of <code>tests.py</code> and <code>views.py</code> to have most combinations of the path to home.html
*Changing the path listed in INSTALLED_APPS and TEMPLATES to have most combinations of varying lengths to the paths of <code>lists</code> and <code>home.html</code>
*Changing <code>'DIRS': []</code> to <code>'DIRS': [os.path.join(BASE_DIR, 'templates')],</code></p>

<p>Sidenote:  I've also had to repeatedly put <code>DJANGO_SETTINGS_MODULE=(project directory name).settings</code> as an environment variable in PyCharm, using the solution to an error, <a href="https://stackoverflow.com/questions/15556499/django-db-settings-improperly-configured-error">here</a>, because the other solutions didn't work, so, I recognize that my setup may be just a tad buggy.</p>