You need to set your static in settings.py and I am giving you simplest idea you can implement with no issues.
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static', 'static-only')
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'static', 'media')
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static', 'static'),
]
Now in your project source folder create a new folder named 'static' which will refer to values in blue.
In your 'static' in blue folder create subfolders with names 'media', static-only', 'templates' and 'static' again. So hierarchy should look like this:
static
----static
----media
----static-only
----templates
In your settings.py in "TEMPLATE" section find simalr line like below and change it as I did.
'DIRS': [os.path.join(BASE_DIR, 'static', 'templates')],
Now go to your terminal (command shell) and run following command.
./manage.py collectstatic
It will ask you are you sure you want to do this. Type "yes" and press enter.
.manage.py runserver and refresh your page.
You will get all the css loaded.
Furthermore you can create three new folders in your /static/static/.
static
----static
|
-------css
|
-------js
|
-------images
----media
----static-only
----templates
In your static/static folder you can keep the project template related css/js/images. All your html based code will go to /static/templates folder. Read the link below thorough and in case of issues you can post another question or to same thread.
Regards,
Mudassar