0

my settings.py static settings are

STATIC_URL = 'static/'
STATIC_ROOT = '/home/mywebsite/public_html/dj/static/'

I have run: manage.py collectstatic successfully.
I restarted the app.
But when i hit the URL http://mywebsite/admin there is no CSS.

Maybe there's something to do with .htaccess somewhere. I need help

P.S. I'm using shared hosting with cPanel and without Terminal access

2
  • Please open the console and check the response's status code for static file requests. It helps us where to search for the actual problem from
    – Doni
    Commented Jun 29 at 16:13
  • I don't have terminal access. When I run manage.py collectstatic in cPanel's interface there was no errors.
    – Nadirspam
    Commented Jun 30 at 12:08

1 Answer 1

0

I solved the problem by creating a directory named static inside public_html and putting all my static files there either manually or using manage collectstatic.
So instead of

STATIC_ROOT = '/home/mywebsite/public_html/dj/static/'``` 
I made 

STATIC_ROOT = '/home/mywebsite/public_html/static/'

In other words the static folder needs to be directly inside public_html and not inside another folder. I don't know wether this is a general rule for cPanel or just happened in my configuration.

Not the answer you're looking for? Browse other questions tagged or ask your own question.