Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
765ec0b7
Commit
765ec0b7
authored
Jan 28, 2012
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `staticfiles` for serving css. Fixes #116.
parent
f34ed6d1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
26 deletions
+12
-26
djangorestframework/static/css/djangorestframework.css
+0
-0
djangorestframework/templates/renderer.html
+6
-17
examples/settings.py
+4
-9
examples/urls.py
+2
-0
No files found.
djangorestframework/static/css/djangorestframework.css
0 → 100644
View file @
765ec0b7
This diff is collapsed.
Click to expand it.
djangorestframework/templates/renderer.html
View file @
765ec0b7
{% load urlize_quoted_links %}{% load add_query_param %}
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
{% load urlize_quoted_links %}
{% load add_query_param %}
{% load static %}
<html
xmlns=
"http://www.w3.org/1999/xhtml"
>
<html
xmlns=
"http://www.w3.org/1999/xhtml"
>
<head>
<head>
<style>
<link
rel=
"stylesheet"
type=
"text/css"
href=
'{% get_static_prefix %}css/djangorestframework.css'
/>
/* Override some of the Django admin styling */
#site-name
a
{
color
:
#F4F379
!important
;}
.errorlist
{
display
:
inline
!important
}
.errorlist
li
{
display
:
inline
!important
;
background
:
white
!important
;
color
:
black
!important
;
border
:
0
!important
;}
/* 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>
<title>
Django REST framework - {{ name }}
</title>
</head>
</head>
<body>
<body>
...
@@ -34,7 +23,7 @@
...
@@ -34,7 +23,7 @@
<div
class=
"breadcrumbs"
>
<div
class=
"breadcrumbs"
>
{% for breadcrumb_name, breadcrumb_url in breadcrumblist %}
{% for breadcrumb_name, breadcrumb_url in breadcrumblist %}
<a
href=
"{{
breadcrumb_url}}"
>
{{breadcrumb_name
}}
</a>
{% if not forloop.last %}
›
{% endif %}
<a
href=
"{{
breadcrumb_url }}"
>
{{ breadcrumb_name
}}
</a>
{% if not forloop.last %}
›
{% endif %}
{% endfor %}
{% endfor %}
</div>
</div>
...
...
examples/settings.py
View file @
765ec0b7
...
@@ -53,16 +53,10 @@ MEDIA_ROOT = os.path.join(os.getenv('EPIO_DATA_DIRECTORY', '.'), 'media')
...
@@ -53,16 +53,10 @@ MEDIA_ROOT = os.path.join(os.getenv('EPIO_DATA_DIRECTORY', '.'), 'media')
# trailing slash if there is a path component (optional in other cases).
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
# Examples: "http://media.lawrence.com", "http://example.com/media/"
# NOTE: None of the djangorestframework examples serve media content via MEDIA_URL.
# NOTE: None of the djangorestframework examples serve media content via MEDIA_URL.
MEDIA_URL
=
''
MEDIA_URL
=
'/uploads/'
STATIC_URL
=
'/static/'
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
# NOTE: djangorestframework does not require the admin app to be installed,
# but it does require the admin media be served. Django's test server will do
# this for you automatically, but in production you'll want to make sure you
# serve the admin media from somewhere.
ADMIN_MEDIA_PREFIX
=
'/static/admin'
# Make this unique, and don't share it with anybody.
# Make this unique, and don't share it with anybody.
SECRET_KEY
=
't&9mru2_k$t8e2-9uq-wu2a1)9v*us&j3i#lsqkt(lbx*vh1cu'
SECRET_KEY
=
't&9mru2_k$t8e2-9uq-wu2a1)9v*us&j3i#lsqkt(lbx*vh1cu'
...
@@ -102,6 +96,7 @@ INSTALLED_APPS = (
...
@@ -102,6 +96,7 @@ INSTALLED_APPS = (
'django.contrib.contenttypes'
,
'django.contrib.contenttypes'
,
'django.contrib.sessions'
,
'django.contrib.sessions'
,
'django.contrib.sites'
,
'django.contrib.sites'
,
'django.contrib.staticfiles'
,
'django.contrib.messages'
,
'django.contrib.messages'
,
'djangorestframework'
,
'djangorestframework'
,
...
...
examples/urls.py
View file @
765ec0b7
from
django.conf.urls.defaults
import
patterns
,
include
,
url
from
django.conf.urls.defaults
import
patterns
,
include
,
url
from
django.conf
import
settings
from
django.conf
import
settings
from
sandbox.views
import
Sandbox
from
sandbox.views
import
Sandbox
from
django.contrib.staticfiles.urls
import
staticfiles_urlpatterns
urlpatterns
=
patterns
(
''
,
urlpatterns
=
patterns
(
''
,
(
r'^$'
,
Sandbox
.
as_view
()),
(
r'^$'
,
Sandbox
.
as_view
()),
...
@@ -15,3 +16,4 @@ urlpatterns = patterns('',
...
@@ -15,3 +16,4 @@ urlpatterns = patterns('',
(
r'^'
,
include
(
'djangorestframework.urls'
)),
(
r'^'
,
include
(
'djangorestframework.urls'
)),
)
)
urlpatterns
+=
staticfiles_urlpatterns
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment