How to Render CSS with Python Django

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

Thanks a lot, man. I was tired of following so many videos, articles, and documents and nothing working. You saved me. I needed to include a CSS folder inside the static one.

AnanyaSingh-jqpp
Автор

CLEAR AND SIMPLE, i watched another video and still didnt understand

farlanded
Автор

you can also do ../static in the settings.py

NiekHM
Автор

Thank you so much. I was struggling with this a lot.

yalcinimeryuz
Автор

THANK YOU SIR, did not know i had to add the static location to settings

kfouladi
Автор

This is the clearest tutorial on getting css to render but it still doesnt work.

nathanwhite
Автор

thanks man really appreciate your efforts and your "not complex " way of teaching

numairnakhwa
Автор

Thank you bro you solve my problem ✔️✔️👍✔️😊✔️😊😊

TURKISTONIM
Автор

Had a trouble starting with CSS, Thanks Man!

bijudonbosco
Автор

did exactly the same, doesnt work for me

hellionaires_sniping
Автор

Hello I have a question, being in base.html and using I can use django and html very well but the css does not recognize. What is the problem


{% extends "admin/base.html" %}

{% block title %}{{ title }} | {{ site_title|default:_('Django site admin') }}{% endblock %}

{% block extrastyle %}
<style>

this is what you don't recognize

#header {
background-color:
}

</style>
{% endblock extrastyle %}

{% block branding %}
<h1 id="site-name"><a href="{% url 'admin:index' %}">{{ site_header|default:_('Django administration') }}</a></h1>
{% endblock %}

{% block nav-global %}{% endblock %}

alexissuarezalvarez
Автор

Thank you . I was having trouble rendering the css file, adding the static dirs solved the issue.

snapeos
Автор

Dude, thank you so much, so much bs out there on how to get this to work with django. Static files dirs was all that was needed. Stackoverflow post, django docs, all of it was full of crap, this worked. In production I guess I'll need to do some additional work but just needed this for now.

patrickfagel
Автор

THANKS, BRO. Finally got it working. THUMBS UP

christianbegg
Автор

many thanks finally solved by using your method :)

SyedVkax
Автор

iT'S STILL NOT WORKING FOR ME!. wHAT DO I DO?

keerthinandigam
Автор

thanks man, the staticfiles_dirs was the problem for me!

Boolentin
Автор

The static should not be defined there, it should be here:

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [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',
],
},
},
]

Thanks for the video, it helped me

arturo
Автор

this video worked for me only in the settings I had to add the entire address STATICFILES_DIRS = [

"/ Users / DISTELSA / Desktop / pd100 / Src / static",

MrYadim
welcome to shbcf.ru