N
N
Nikolai Getmanov2020-11-03 20:24:40
Django
Nikolai Getmanov, 2020-11-03 20:24:40

How to load styles and pictures when DEBUG = False?

On the site DEBUG = False in order to display their site error pages. But the styles don't work (Type in text/css code, but text/html in browser) and images don't load (404: Not Found). Styling and image issues were fixed with DEBUG = True, and Django displays behind its site's error pages. How to load pictures, styles with DEBUG = False?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Legalas61, 2020-11-03
@Kolya_Get

First of all, you need to collect all the files through collectstatic and set the paths to it in settings

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question