L
L
leha782016-02-05 20:46:03
Django
leha78, 2016-02-05 20:46:03

Little question about static files?

Такой вопрос. В проекте, в директории папки есть папка static, куда по идее кладется все js, css файлы
В настройках указал вот это
TATIC_URL = '/static/'
STATIC_ROOT = 'C:/DjangoProjects/stroy/project/static/'
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'bootstrap'),
)
STATICFILES_FINDERS = (
"django.contrib.staticfiles.finders.FileSystemFinder",
"django.contrib.staticfiles.finders.AppDirectoriesFinder"
)
Я сначала поместил файлы бутстрапа в папку bootstrap, сделал collectstatic, файлы скопировались в папку static
В шаблоне указал это
После этого, если в коде посмотреть, то указан адрес (все как надо):
127.0.0.1:8000/static/css/bootstrap.css
And everything seemed to work.
But, when I decided to delete the bootstrap folder, all the styles of the site went astray. As it turned out, the template took styles from the bootstrap folder, although 127.0.0.1:8000/static/css/bootstrap.css
was specified . How can I make sure that the files are taken from the static folder?
After all, I will still create my own style files and put them in the static folder. + I will put the logo.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question