[Answer]-Where to put templates and static assets for deployment

1👍

✅

For your templates you can make a new folder in you main static directory.

In your settings.py you can set the path like this.

TEMPLATE_DIRS = (
    os.path.join(os.path.dirname(__file__), 'static', 'templates'),
    )

You can also add in template loaders to your settings.py.

TEMPLATE_LOADERS = (

    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',

)

Now Django will look in static/static/templates for your templates (which are static files).

The rest looks good just make sure you have STATIC_URL = '/static/' above if Debug:

See: Django Project Loading Templates

Leave a comment