0

First I created a "static" folder and added a css file in this folder. Then I added STATIC_ROOT = BASE_DIR / 'myStaticFiles' in the 'settings.py'. I followed a tutorial.

I run this command: py manage.py collectstatic

All the files copied to 'myStaticFiles'. Now, it's my question: Should I add more css files in the 'static' folder or 'myStaticFiles'? It's a bit confusing to me. Django Tutorials

I followed the tutorials step by step, but didn't get the result. Explained as above.

Nurjalol N
  • 21
  • 1
  • 8
  • 1
    Does this answer your question? [django html template can't find static css and js files](https://stackoverflow.com/questions/66437690/django-html-template-cant-find-static-css-and-js-files) – Ivan Starostin Jan 13 '23 at 12:01

1 Answers1

1

You should:

STATIC_URL = 'static/'

STATIC_ROOT = 'static/'
STATICFILES_DIRS = [
    BASE_DIR / 'YourProjectName/static'
]

In settings.py

And the "myStaticFiles" folder should be inside your project

Nurjalol N
  • 21
  • 1
  • 8