DEV Community

Ritik Soni
Ritik Soni

Posted on

2 1

Learn About Django `StaticFiles`.

definition of static_url, static_root, STATICFILES_DIRS.

static_url :

  • it does nothing other then prepending onto your static file url

static_root :

  • it is the root folder path where our static file will be saved after running collectstatic management command. it has nothing to do in our development server because runserver helps us to serve our static files easily. but in Production server you wont be running runserver. so thats where static_root comes into picture. if you are using any reverse proxy like nginx or apache then these proxy server needs some static root paths to serve static files.

STATICFILES_DIRS :

  • It can be a tupel or a list of extra-static-paths where you have placed some static-files for your project/app.
    • extra-static-paths : your static file folder other then folder named static

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay