S_M S_M - 11 days ago 6
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:

in

setting.py
I have:

INSTALLED_APPS = [
...
django.contrib.staticfiles',
...
]

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
etc/apache2/sites-available/000-default.conf
I added:

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


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.

S_M S_M
Answer

"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.