Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Use a template dir structure like this:</p> <pre><code>awesome_app_name/ templates/ awesome_app_name/ base.html cool_template.html </code></pre> <p>This allows someone to extend your templates with:</p> <pre><code>{% extends 'awesome_app_name/cool_template.html' %} </code></pre> <p>OR they could just swap it out with their own template like this:</p> <pre><code>my_app_name/ templates/ my_app_name/ my_template.html awesome_app_name/ cool_template.html &lt;-- this overloads your template with their own </code></pre> <p>This makes for very flexible templates in shared packages.</p> <p><strong>EDIT:</strong></p> <p>This works if you configure django with both a template directory for your project and the <a href="https://docs.djangoproject.com/en/dev/ref/templates/api/#loader-types" rel="nofollow">app_directories.Loader template loader</a>. I believe this to be the configuration used by most:</p> <pre><code>TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', ) TEMPLATE_DIRS = ( # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. os.path.join(PROJECT_DIR, 'templates'), ) </code></pre> <p>Template loading is then done in the following order:</p> <ol> <li>Resolve template from project directory</li> <li>Resolve template from app directories</li> </ol> <p>Here's an example project that follows this structure: <a href="https://github.com/brutasse/django-password-reset" rel="nofollow">https://github.com/brutasse/django-password-reset</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload