hash hash - 1 year ago 229
Python Question

static files not detected Django 1.10

Problem: javascript and css files doesn't load.

I am using Django 1.10, my

file looks like this:

STATIC_URL = "/static/"

os.path.join(BASE_DIR, "static")

STATIC_ROOT = os.path.join(BASE_DIR, "static_root")

I have my static files in the
static folder
and also have a static root, still the
not working

Answer Source

You need to specify it in urls.py file as well

# need these two additional imports
from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [

# add this extra line of code
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

Have you done that?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download