[Answer]-Setting an Individual Media Folder for Django App

1πŸ‘

βœ…

The common solution to this is the same as with the application templates: use a directory named for the app to namespace the static resources. Here the directory would look like

myapp/
    __init__.py
    models.py
    views.py
    static/
        myapp/
            js/site.js
            css/site.css

In the template they would be referenced with {{ STATIC_URL }} as usual

<script src="{{ STATIC_URL }}myapp/js/site.js"></script>
πŸ‘€Mark Lavin

Leave a comment