0

I have problem with Django static files. Everything works fine but when I want to change something in CSS or an image or JS nothing is happening.

In settings.py I have this

# https://docs.djangoproject.com/en/3.0/howto/static-files/
STATIC_URL = '/static/'
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static'),]
STATIC_ROOT  = os.path.join(BASE_DIR, 'staticfiles')

I have 2 folder of static files, first is static and second one I get after manage.py collecstatic I get another folder (staticfiles) so even when I'm deleting both folders my website files not breaking, I need to restart my Mac. Plus I cannot change elements in CSS because I'm working on both folders but nothing happens.

Directory structure

jdehesa
  • 58,456
  • 7
  • 77
  • 121
  • Are your static folders in the project directory? In your screenshot it looks different. BASE_DIR is usually set to the project directory. And then static will be the directory where you put your static files (e.g. for testing) and staticfiles will be the folder where they will end up after collectstatic. – ger.s.brett Feb 24 '20 at 12:04
  • this is my main directory in Astronaut Folder . Astronaut ---Saas----db.sqlite3---manage.py----static-----staticfiles----templates Astronaut is Project and Saas is Application – George V The Developer Feb 24 '20 at 12:24
  • does this mean your staticfiles folder is in your static folder? – ger.s.brett Feb 24 '20 at 13:40

0 Answers0