Sunday, March 12, 2023

Re: static files

Static files outside apps are not served by default. Have you added the main directory static directory to settings yet?

https://docs.djangoproject.com/en/4.1/ref/settings/#std-setting-STATICFILES_DIRS

Something like this is typically done in project settings:

STATICFILES_DIRS = [BASE_DIR / "static"]

- Sandip

On Mar 10, 2023, at 1:29 PM, Usra Saeed <usrasaeed222@gmail.com> wrote:

Hi,  I am uing django 3.2. My template and static folder are in the main directory.  But my static files are not loading.
I have one app. In this I have one template name "signin.html". I am using
{% extends "base.html" %}
{% load static %}
{% block content %}
<h1> Hello World </h1>

{% endblock %}

In main directory template folder I have base.html .





--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/759ee88b-13f6-457b-8abf-1212b30b6628n%40googlegroups.com.
<Screenshot from 2023-03-10 23-28-20.png>

No comments:

Post a Comment