Asked 1 years ago
20 Jul 2023
Views 338
eclipse-learner

eclipse-learner posted

Static files not loading on Django + Apache2

Static files not loading on Django + Apache2




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

#this code
STATICFILES_DIRS = [
    BASE_DIR / "static",
]


it show error like this
Using the URLconf defined in thomkell.urls, Django tried these URL patterns, in this order:

lain

lain
answered Jul 20 '23 00:00

change STATIC_URL = 'staticfiles/'
to the STATIC_URL = 'static/'
and restart apache by

  sudo service apache2 restart

or by another suitable command
Post Answer