Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

402
Views
tiangolo/uwsgi-nginx-flask directory structure

What would be the directory structure required to successfully run a flask app inside a container using the base image tiangolo/uwsgi-nginx-flask.

The website mention only the location of the file main.py.

enter image description here

For more advance project

enter image description here

Where are we suppose to locate the folders 'Templates' and "Static' ?

Thanks a lot for your help.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

.
├── Dockerfile
└── app
    ├── app
    │   ├── __init__.py
    │   ├── main.py
    │   ├── static
    │   │   ├── script.js
    │   │   └── style.css
    │   └── templates
    │       └── index.html
    └── uwsgi.ini

4 directories, 7 files

You can locate templates & static wherever you like, however Flask will automatically know how to locate them if they are placed at the same path level as your app object creation script. If you decide to place them somewhere else, you may pass in static_folder and template_folder as keyword arguments with the absolute paths to these folders. If you want to see more details about the way in which Flask loads these files, you can set the EXPLAIN_TEMPLATE_LOADING config value to True (it defaults to False)

from flask import Flask
app = Flask(__name__)
app.config.update(EXPLAIN_TEMPLATE_LOADING=True)

This will log the output from the Jinja2 template loading engine, which is what Flask is using behind the scenes to locate its static files.

You find more details about advanced Flask patterns from the official documentation.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!