[Answer]-After installing app TemplateDoesNotExist error

1👍

You said you followed the tutorial, but I have to ask, did you create the manifest file? You didn’t mention it, and only Python is included by default.

Create myapp/MANIFEST.in and inside it add recursive-include myapp/templates *

That should ensure that python setup.py sdist creates the package with your templates directory recursively.

edit

Ok, so I’ve just tested this on a project of mine.

- proj
  - setup.py
  - MANIFEST.in
  - injurytracker
    - init.py
    - templates
    - etc

In setup.py I’ve got packages=['injurytracker'], to include my package, and in MANIFEST.in I’ve got recursive-include injurytracker/templates * And when I check the dist.gz I’ve got my templates included.

As you’ve mentioned include_package_data, setting that either way, doesn’t effect the template directory inclusion.

In your setup.py also import find_packages from setuptools, and in your setup method add somthing like this;

packages=find_packages(exclude=["project", "project.*"]),

For me that picks out all my python modules & files that I expect, migrations included.

0👍

Do you have this in your settings.py?

TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader', # <--
)

Leave a comment