Answer the question
In order to leave comments, you need to log in
Does it make sense to combine templates and static directories to implement a component approach in the front-end of Django and Flask projects?
The file structure recommended in the Flask and Django documentation separates HTML templates from their associated static files (CSS, JavaScript, and image files) into different directories.
This separation simplifies the HTTP server configuration:
location /static/ {
alias /home/project/project-env/project/static/;
}
Answer the question
In order to leave comments, you need to log in
In this case, it is better to use the Flask-Themes library to specify the location of the static and templates outside the module without polluting it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question