Forums

Django virtualenv admin css

I realize this has been asked (hyperbole alert) a MILLION TIMES, but I just can't see to get the admin css to work. Either the default or the installed django_admin_bootstrapped admin display.

I've run collectstatic and I see the css, etc file under the absolute path of:

/home/username/.virtualenvs/django19/tnr/static

Directory structure for collectstatic files:

(django19) 10:31 ~/.virtualenvs/django19/tnr/static $ ls
admin
(django19) 10:31 ~/.virtualenvs/django19/tnr/static $ ls admin/
admin bootstrap bootstrap-rtl css img js
(django19) 10:31 ~/.virtualenvs/django19/tnr/static $

settings.py for installed apps

INSTALLED_APPS = [ 'django_admin_bootstrapped', 'django.contrib.admin', . . .

settings.py for static files

STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static')

Advice on what I'm doing wrong?

Much thanks.

I think the thing you're missing is on the "Static files" section of the "Web" tab. If you create a row there with "URL" set to /static/ and "Directory" set to "/home/username/.virtualenvs/django19/tnr/static` then it should work.

Thank you so much for your reply, but that adding the above did not work either. The admin pages served do seem to have the correct link in the html head.

<link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
<link rel="stylesheet" type="text/css" href="/static/admin/css/overrides.css" />
<script type="text/javascript">
//<![CDATA[
    window.__admin_media_prefix__ = "/static/admin/";
    window.__admin_utc_offset__ = "\u002D28800";
//]]>
</script>
<script src="/static/admin/js/jquery-1.9.1.min.js"></script>
<script src="/static/admin/js/jquery-migrate-1.2.1.min.js"></script>
<script src="/static/bootstrap/js/bootstrap.min.js"></script>

Anything else I can try?

Much thanks.

Ah, sorry, I should have said -- you need to reload the web app after entering the static file details.