Django general and app templates
<p>I want to customize my Django project, I will have a dashboard app and a home site app (you can enter from this home site to the dashboard with a URL).
I want to save a template for the HTML and css so both apps can use them.</p>

<p>I followed <a href="https://docs.djangoproject.com/en/1.10/intro/tutorial07/#customizing-your-project-s-templates" rel="nofollow">this</a> tutorial on django official site, but I think I missed a setup because. This is the error: <code>Not Found: /css/style.css</code>. </p>

<p>At this point, my django project is structured this way, I think that I will add another app (module) to serve the home page:</p>

<pre><code>mysite/
    manage.py
    mysite/
        __init__.py
        settings.py
        urls.py
        wsgi.py
    dashboard/
        __init__.py
        admin.py
        migrations/
            __init__.py
            0001_initial.py
        models.py
        static/
        templates/
            polls/
                index.html
        tests.py
        urls.py
        views.py
    templates/
        css/
            style.css
</code></pre>

<p>And my settings.py is like this:</p>

<pre><code>TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, 'mysite/templates/'), os.path.join(BASE_DIR, 'templates')],
        '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>I found a way to do this. The problem isn't with the templates settings, the problem is with the <code>staticfiles_dir</code>.</p>

<pre><code>STATICFILES_DIRS = [
    os.path.join(BASE_DIR, "static"),
    'var/css/style.css'
]
</code></pre>

<p>It is important to remark that the templates should have <code>&lt;link rel="stylesheet" href={% static 'css/style.css' %}&gt;</code></p>

<p>I also loaded HTML files that are general templates for various apps.</p>

python django django-templates