Search code examples
pythondjangocollectstatic

Why my django static file have number in the end


I have to debug some existing Django project build me other develeopers.

In my local developement environment all the static files have path like

/static/myapp/module/user.js

But when i see the html of testing on tetsing server then i can see the files like

static/myapp/module/user.42323gdb.js

Now i want to know why the system is using that file instead of user.js.

Is there any setting which i can fix or it is meant to do like that


Solution

  • Seems like your project uses one of the asset managers. I suspect you can find it in the INSTALLED_APPS setting.

    UPDATE: By default the django-pipeline does this magic then the DEBUG = False. Which is the case for your development environment.

    The other setting to enable/disable the pipeline is the PIPELINE_ENABLED. So you can have the "normal" file names on the production server too. But I suggest you to leave the pipeline enabled :-)