I deployed my django app to pythonanywhere.com and my admin css not working http://directdirect.pythonanywhere.com/admin/login/?next=/admin/ what do I do? I use django 2.0 settings.py:
Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'django_direct/main_app/static'),
os.path.join(BASE_DIR, 'django_direct/main_app/static'),
http://directdirect.pythonanywhere.com/static/admin/css/dashboard.css
]
Check your settings.py
file.
DEBUG = True # debug true mod working admin css
DEBUG = False # debug false mod not working css
You can fix it using a proxy server or by running Django with the insecure parameter.
I assume you followed similar instructions to this page from help.pythonanywhere.com
.
There it says:
Go visit your site, it should be live! But it probably won't be using your CSS stylesheets, JavaScript and other things that are loaded from static files. To get those set up, check out the page configuring static files with Django.
And here is the link to get those static files up and running.
This should point you in the right direction.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With