Finally got a big relief from css tension. From last 3 or 4 days i was trying to apply css file on admin site every time I failed. Finally I found a solution for  that. Just give a alias path where your media folder is in “abc” text file ( here “abc” file is a file which i used to place in /etc/apache2/sites-available/ so that i run on localhost without using localhost:8000 i.e there is no need to runserver in terminal just open browser and type localhost/souvenir). As my media folder is in /usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/ so I use  alias /media/ /usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/. And in settings.py folder i give MEDIA_URL = /media/. Also i put media folder in public_html.
                                                      
Open browser type “localhost/media” go to desirable file (in my case file is base.css). Copy that path and paste in to base.html which is present in  /usr/local/lib/python2.7/dist-packages/django/contrib/admin/templates/admin and i am done.

admin site with css

Advertisements