S_M S_M - 1 year ago 132
CSS Question

django admin css on apache server

I need to solve the missing admin page css problem. I have tested almost all the solutions on the web with no luck! (I'm using django 1.8 on apache2.4)

Here's what I've done so far:


I have:


STATIC_URL = '/static/'
PROJECT_DIR = os.path.dirname(os.path.abspath(__file__))
STATIC_ROOT = os.path.join(PROJECT_DIR, 'static')

I did
python manage.py collectstatic
. It created the static folder: 63 static files copied to '/var/www/mysite/mysite/static'.

and then in
I added:

Alias /static /var/www/mysite/mysit/static
<Directory /var/www/mysite/mysite/static>
Require all granted

I also reloaded the apache.

It seems that I'm doing something wrong since the django admin doesn't show the css.

Any help would be appreciated.

Answer Source

"The steps presented in the question is actually correct to set the static files on apache server."

The problem was the typo I made in my apache server thread (the correct one is: Alias /static /var/www/mysite/mysite/static). Thanks to @Zagorodniy Olexiy for pointing it out.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download