Merge pull request #138 from mjumbewu/feature/admin_static_files

Support both staticfiles and ADMIN_MEDIA_PREFIX styles.
This commit is contained in:
Tom Christie 2012-01-21 02:39:02 -08:00
commit 7a87fc87c2
2 changed files with 21 additions and 10 deletions

View File

@ -1,8 +1,14 @@
<html>
<head>
{% if ADMIN_MEDIA_PREFIX %}
<link rel="stylesheet" type="text/css" href='{{ADMIN_MEDIA_PREFIX}}css/base.css'/>
<link rel="stylesheet" type="text/css" href='{{ADMIN_MEDIA_PREFIX}}css/forms.css'/>
<link rel="stylesheet" type="text/css" href='{{ADMIN_MEDIA_PREFIX}}css/login.css' />
{% else %}
<link rel="stylesheet" type="text/css" href='{{STATIC_URL}}admin/css/base.css'/>
<link rel="stylesheet" type="text/css" href='{{STATIC_URL}}admin/css/forms.css'/>
<link rel="stylesheet" type="text/css" href='{{STATIC_URL}}admin/css/login.css' />
{% endif %}
<style>
.form-row {border-bottom: 0.25em !important}</style>
</head>

View File

@ -11,8 +11,13 @@
/* Custom styles */
.version{font-size:8px;}
</style>
{% if ADMIN_MEDIA_PREFIX %}
<link rel="stylesheet" type="text/css" href='{{ADMIN_MEDIA_PREFIX}}css/base.css'/>
<link rel="stylesheet" type="text/css" href='{{ADMIN_MEDIA_PREFIX}}css/forms.css'/>
{% else %}
<link rel="stylesheet" type="text/css" href='{{STATIC_URL}}admin/css/base.css'/>
<link rel="stylesheet" type="text/css" href='{{STATIC_URL}}admin/css/forms.css'/>
{% endif %}
<title>Django REST framework - {{ name }}</title>
</head>
<body>