[Fixed]-Django CAN find my static files, Pycharm CANNOT resolve them


Here is the key to solving the problem: Pycharm needs to know where your settings files that you’re currently using is located. See the picture.

enter image description here

Also make sure that you have everything setup in your settings file correctly. See the picture.

enter image description here


In some situation this way can work:

<link href="{{ STATIC_URL }}" rel="stylesheet" type="text/css">

PyCharm static autocomplete


If you have setup everything correctly according to Django doc at:

Then you can try to explicitly set your static folders to help the IDE like:

    BASE_DIR / "app1/static",
    BASE_DIR / "app2/static",

this works for me many times. IntelliJ just could not automatically find my app’s static.


PyCharm recognises my static files for a configured settings.STATIC_ROOT as below

STATIC_URL = '/assets/'

STATIC_ROOT = os.path.join(BASE_DIR, 'static')


Try loading your staticfiles:

{% load staticfiles %}

And setting your link as:

<link rel="stylesheet" type="text/css" href="{% static "css/default.css" %}">


I used:

  1. STATIC_ROOT = os.path.join(BASE_DIR, "static_deployment")

  2. python manage.py collectstatic command

So I did what needs to be done to go from development to deployment configuration.

pyCharm now works fine and can see static files

Yes it is not the best solution if you change static files a lot but can help developing with pyCharm and Django…



Check in settins.py

    os.path.join(BASE_DIR, 'your_app/static/')

and add

STATIC_ROOT = os.path.join(BASE_DIR, '/static/')

Pycharm use this settings.

Leave a comment