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
426493a7
Commit
426493a7
authored
Feb 15, 2012
by
Tom Christie
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #162 from poswald/master
Remove robots.txt, favicon.ico; namespace static files
parents
ba1e3b46
78daa325
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
42 additions
and
77 deletions
+42
-77
AUTHORS
+1
-0
djangorestframework/static/djangorestframework/css/style.css
+36
-36
djangorestframework/static/favicon.ico
+0
-0
djangorestframework/static/robots.txt
+0
-2
djangorestframework/templates/api_login.html
+1
-1
djangorestframework/templates/renderer.html
+1
-1
djangorestframework/tests/views.py
+0
-14
djangorestframework/urls.py
+0
-10
djangorestframework/utils/staticviews.py
+0
-9
docs/howto/setup.rst
+3
-4
No files found.
AUTHORS
View file @
426493a7
...
@@ -30,6 +30,7 @@ Chris Pickett <bunchesofdonald>
...
@@ -30,6 +30,7 @@ Chris Pickett <bunchesofdonald>
Ben Timby <btimby>
Ben Timby <btimby>
Michele Lazzeri <michelelazzeri-nextage>
Michele Lazzeri <michelelazzeri-nextage>
Camille Harang <mammique>
Camille Harang <mammique>
Paul Oswald <poswald>
THANKS TO:
THANKS TO:
...
...
djangorestframework/static/
css/djangorestframework
.css
→
djangorestframework/static/
djangorestframework/css/style
.css
View file @
426493a7
...
@@ -257,7 +257,7 @@ tfoot td {
...
@@ -257,7 +257,7 @@ tfoot td {
color
:
#666
;
color
:
#666
;
padding
:
2px
5px
;
padding
:
2px
5px
;
font-size
:
11px
;
font-size
:
11px
;
background
:
#e1e1e1
url(../img/admin/nav-bg.gif)
top
left
repeat-x
;
background
:
#e1e1e1
url(../
../admin/
img/admin/nav-bg.gif)
top
left
repeat-x
;
border-left
:
1px
solid
#ddd
;
border-left
:
1px
solid
#ddd
;
border-bottom
:
1px
solid
#ddd
;
border-bottom
:
1px
solid
#ddd
;
}
}
...
@@ -317,11 +317,11 @@ table thead th.sorted a {
...
@@ -317,11 +317,11 @@ table thead th.sorted a {
}
}
table
thead
th
.ascending
a
{
table
thead
th
.ascending
a
{
background
:
url(../img/admin/arrow-up.gif)
right
.4em
no-repeat
;
background
:
url(../
../admin/
img/admin/arrow-up.gif)
right
.4em
no-repeat
;
}
}
table
thead
th
.descending
a
{
table
thead
th
.descending
a
{
background
:
url(../img/admin/arrow-down.gif)
right
.4em
no-repeat
;
background
:
url(../
../admin/
img/admin/arrow-down.gif)
right
.4em
no-repeat
;
}
}
/* ORDERABLE TABLES */
/* ORDERABLE TABLES */
...
@@ -332,7 +332,7 @@ table.orderable tbody tr td:hover {
...
@@ -332,7 +332,7 @@ table.orderable tbody tr td:hover {
table
.orderable
tbody
tr
td
:first-child
{
table
.orderable
tbody
tr
td
:first-child
{
padding-left
:
14px
;
padding-left
:
14px
;
background-image
:
url(../img/admin/nav-bg-grabber.gif)
;
background-image
:
url(../
../admin/
img/admin/nav-bg-grabber.gif)
;
background-repeat
:
repeat-y
;
background-repeat
:
repeat-y
;
}
}
...
@@ -362,7 +362,7 @@ input[type=text], input[type=password], textarea, select, .vTextField {
...
@@ -362,7 +362,7 @@ input[type=text], input[type=password], textarea, select, .vTextField {
/* FORM BUTTONS */
/* FORM BUTTONS */
.button
,
input
[
type
=
submit
],
input
[
type
=
button
],
.submit-row
input
{
.button
,
input
[
type
=
submit
],
input
[
type
=
button
],
.submit-row
input
{
background
:
white
url(../img/admin/nav-bg.gif)
bottom
repeat-x
;
background
:
white
url(../
../admin/
img/admin/nav-bg.gif)
bottom
repeat-x
;
padding
:
3px
5px
;
padding
:
3px
5px
;
color
:
black
;
color
:
black
;
border
:
1px
solid
#bbb
;
border
:
1px
solid
#bbb
;
...
@@ -370,31 +370,31 @@ input[type=text], input[type=password], textarea, select, .vTextField {
...
@@ -370,31 +370,31 @@ input[type=text], input[type=password], textarea, select, .vTextField {
}
}
.button
:active
,
input
[
type
=
submit
]
:active
,
input
[
type
=
button
]
:active
{
.button
:active
,
input
[
type
=
submit
]
:active
,
input
[
type
=
button
]
:active
{
background-image
:
url(../img/admin/nav-bg-reverse.gif)
;
background-image
:
url(../
../admin/
img/admin/nav-bg-reverse.gif)
;
background-position
:
top
;
background-position
:
top
;
}
}
.button
[
disabled
],
input
[
type
=
submit
][
disabled
],
input
[
type
=
button
][
disabled
]
{
.button
[
disabled
],
input
[
type
=
submit
][
disabled
],
input
[
type
=
button
][
disabled
]
{
background-image
:
url(../img/admin/nav-bg.gif)
;
background-image
:
url(../
../admin/
img/admin/nav-bg.gif)
;
background-position
:
bottom
;
background-position
:
bottom
;
opacity
:
0.4
;
opacity
:
0.4
;
}
}
.button.default
,
input
[
type
=
submit
]
.default
,
.submit-row
input
.default
{
.button.default
,
input
[
type
=
submit
]
.default
,
.submit-row
input
.default
{
border
:
2px
solid
#5b80b2
;
border
:
2px
solid
#5b80b2
;
background
:
#7CA0C7
url(../img/admin/default-bg.gif)
bottom
repeat-x
;
background
:
#7CA0C7
url(../
../admin/
img/admin/default-bg.gif)
bottom
repeat-x
;
font-weight
:
bold
;
font-weight
:
bold
;
color
:
white
;
color
:
white
;
float
:
right
;
float
:
right
;
}
}
.button.default
:active
,
input
[
type
=
submit
]
.default
:active
{
.button.default
:active
,
input
[
type
=
submit
]
.default
:active
{
background-image
:
url(../img/admin/default-bg-reverse.gif)
;
background-image
:
url(../
../admin/
img/admin/default-bg-reverse.gif)
;
background-position
:
top
;
background-position
:
top
;
}
}
.button
[
disabled
]
.default
,
input
[
type
=
submit
][
disabled
]
.default
,
input
[
type
=
button
][
disabled
]
.default
{
.button
[
disabled
]
.default
,
input
[
type
=
submit
][
disabled
]
.default
,
input
[
type
=
button
][
disabled
]
.default
{
background-image
:
url(../img/admin/default-bg.gif)
;
background-image
:
url(../
../admin/
img/admin/default-bg.gif)
;
background-position
:
bottom
;
background-position
:
bottom
;
opacity
:
0.4
;
opacity
:
0.4
;
}
}
...
@@ -431,7 +431,7 @@ input[type=text], input[type=password], textarea, select, .vTextField {
...
@@ -431,7 +431,7 @@ input[type=text], input[type=password], textarea, select, .vTextField {
font-size
:
11px
;
font-size
:
11px
;
text-align
:
left
;
text-align
:
left
;
font-weight
:
bold
;
font-weight
:
bold
;
background
:
#7CA0C7
url(../img/admin/default-bg.gif)
top
left
repeat-x
;
background
:
#7CA0C7
url(../
../admin/
img/admin/default-bg.gif)
top
left
repeat-x
;
color
:
white
;
color
:
white
;
}
}
...
@@ -453,15 +453,15 @@ ul.messagelist li {
...
@@ -453,15 +453,15 @@ ul.messagelist li {
margin
:
0
0
3px
0
;
margin
:
0
0
3px
0
;
border-bottom
:
1px
solid
#ddd
;
border-bottom
:
1px
solid
#ddd
;
color
:
#666
;
color
:
#666
;
background
:
#ffc
url(../img/admin/icon_success.gif)
5px
.3em
no-repeat
;
background
:
#ffc
url(../
../admin/
img/admin/icon_success.gif)
5px
.3em
no-repeat
;
}
}
ul
.messagelist
li
.warning
{
ul
.messagelist
li
.warning
{
background-image
:
url(../img/admin/icon_alert.gif)
;
background-image
:
url(../
../admin/
img/admin/icon_alert.gif)
;
}
}
ul
.messagelist
li
.error
{
ul
.messagelist
li
.error
{
background-image
:
url(../img/admin/icon_error.gif)
;
background-image
:
url(../
../admin/
img/admin/icon_error.gif)
;
}
}
.errornote
{
.errornote
{
...
@@ -471,7 +471,7 @@ ul.messagelist li.error{
...
@@ -471,7 +471,7 @@ ul.messagelist li.error{
margin
:
0
0
3px
0
;
margin
:
0
0
3px
0
;
border
:
1px
solid
red
;
border
:
1px
solid
red
;
color
:
red
;
color
:
red
;
background
:
#ffc
url(../img/admin/icon_error.gif)
5px
.3em
no-repeat
;
background
:
#ffc
url(../
../admin/
img/admin/icon_error.gif)
5px
.3em
no-repeat
;
}
}
ul
.errorlist
{
ul
.errorlist
{
...
@@ -486,7 +486,7 @@ ul.errorlist {
...
@@ -486,7 +486,7 @@ ul.errorlist {
margin
:
0
0
3px
0
;
margin
:
0
0
3px
0
;
border
:
1px
solid
red
;
border
:
1px
solid
red
;
color
:
white
;
color
:
white
;
background
:
red
url(../img/admin/icon_alert.gif)
5px
.3em
no-repeat
;
background
:
red
url(../
../admin/
img/admin/icon_alert.gif)
5px
.3em
no-repeat
;
}
}
.errorlist
li
a
{
.errorlist
li
a
{
...
@@ -522,7 +522,7 @@ div.system-message p.system-message-title {
...
@@ -522,7 +522,7 @@ div.system-message p.system-message-title {
padding
:
4px
5px
4px
25px
;
padding
:
4px
5px
4px
25px
;
margin
:
0
;
margin
:
0
;
color
:
red
;
color
:
red
;
background
:
#ffc
url(../img/admin/icon_error.gif)
5px
.3em
no-repeat
;
background
:
#ffc
url(../
../admin/
img/admin/icon_error.gif)
5px
.3em
no-repeat
;
}
}
.description
{
.description
{
...
@@ -533,7 +533,7 @@ div.system-message p.system-message-title {
...
@@ -533,7 +533,7 @@ div.system-message p.system-message-title {
/* BREADCRUMBS */
/* BREADCRUMBS */
div
.breadcrumbs
{
div
.breadcrumbs
{
background
:
white
url(../img/admin/nav-bg-reverse.gif)
0
-10px
repeat-x
;
background
:
white
url(../
../admin/
img/admin/nav-bg-reverse.gif)
0
-10px
repeat-x
;
padding
:
2px
8px
3px
8px
;
padding
:
2px
8px
3px
8px
;
font-size
:
11px
;
font-size
:
11px
;
color
:
#999
;
color
:
#999
;
...
@@ -546,17 +546,17 @@ div.breadcrumbs {
...
@@ -546,17 +546,17 @@ div.breadcrumbs {
.addlink
{
.addlink
{
padding-left
:
12px
;
padding-left
:
12px
;
background
:
url(../img/admin/icon_addlink.gif)
0
.2em
no-repeat
;
background
:
url(../
../admin/
img/admin/icon_addlink.gif)
0
.2em
no-repeat
;
}
}
.changelink
{
.changelink
{
padding-left
:
12px
;
padding-left
:
12px
;
background
:
url(../img/admin/icon_changelink.gif)
0
.2em
no-repeat
;
background
:
url(../
../admin/
img/admin/icon_changelink.gif)
0
.2em
no-repeat
;
}
}
.deletelink
{
.deletelink
{
padding-left
:
12px
;
padding-left
:
12px
;
background
:
url(../img/admin/icon_deletelink.gif)
0
.25em
no-repeat
;
background
:
url(../
../admin/
img/admin/icon_deletelink.gif)
0
.25em
no-repeat
;
}
}
a
.deletelink
:link
,
a
.deletelink
:visited
{
a
.deletelink
:link
,
a
.deletelink
:visited
{
...
@@ -591,14 +591,14 @@ a.deletelink:hover {
...
@@ -591,14 +591,14 @@ a.deletelink:hover {
.object-tools
li
{
.object-tools
li
{
display
:
block
;
display
:
block
;
float
:
left
;
float
:
left
;
background
:
url(../img/admin/tool-left.gif)
0
0
no-repeat
;
background
:
url(../
../admin/
img/admin/tool-left.gif)
0
0
no-repeat
;
padding
:
0
0
0
8px
;
padding
:
0
0
0
8px
;
margin-left
:
2px
;
margin-left
:
2px
;
height
:
16px
;
height
:
16px
;
}
}
.object-tools
li
:hover
{
.object-tools
li
:hover
{
background
:
url(../img/admin/tool-left_over.gif)
0
0
no-repeat
;
background
:
url(../
../admin/
img/admin/tool-left_over.gif)
0
0
no-repeat
;
}
}
.object-tools
a
:link
,
.object-tools
a
:visited
{
.object-tools
a
:link
,
.object-tools
a
:visited
{
...
@@ -607,29 +607,29 @@ a.deletelink:hover {
...
@@ -607,29 +607,29 @@ a.deletelink:hover {
color
:
white
;
color
:
white
;
padding
:
.1em
14px
.1em
8px
;
padding
:
.1em
14px
.1em
8px
;
height
:
14px
;
height
:
14px
;
background
:
#999
url(../img/admin/tool-right.gif)
100%
0
no-repeat
;
background
:
#999
url(../
../admin/
img/admin/tool-right.gif)
100%
0
no-repeat
;
}
}
.object-tools
a
:hover
,
.object-tools
li
:hover
a
{
.object-tools
a
:hover
,
.object-tools
li
:hover
a
{
background
:
#5b80b2
url(../img/admin/tool-right_over.gif)
100%
0
no-repeat
;
background
:
#5b80b2
url(../
../admin/
img/admin/tool-right_over.gif)
100%
0
no-repeat
;
}
}
.object-tools
a
.viewsitelink
,
.object-tools
a
.golink
{
.object-tools
a
.viewsitelink
,
.object-tools
a
.golink
{
background
:
#999
url(../img/admin/tooltag-arrowright.gif)
top
right
no-repeat
;
background
:
#999
url(../
../admin/
img/admin/tooltag-arrowright.gif)
top
right
no-repeat
;
padding-right
:
28px
;
padding-right
:
28px
;
}
}
.object-tools
a
.viewsitelink
:hover
,
.object-tools
a
.golink
:hover
{
.object-tools
a
.viewsitelink
:hover
,
.object-tools
a
.golink
:hover
{
background
:
#5b80b2
url(../img/admin/tooltag-arrowright_over.gif)
top
right
no-repeat
;
background
:
#5b80b2
url(../
../admin/
img/admin/tooltag-arrowright_over.gif)
top
right
no-repeat
;
}
}
.object-tools
a
.addlink
{
.object-tools
a
.addlink
{
background
:
#999
url(../img/admin/tooltag-add.gif)
top
right
no-repeat
;
background
:
#999
url(../
../admin/
img/admin/tooltag-add.gif)
top
right
no-repeat
;
padding-right
:
28px
;
padding-right
:
28px
;
}
}
.object-tools
a
.addlink
:hover
{
.object-tools
a
.addlink
:hover
{
background
:
#5b80b2
url(../img/admin/tooltag-add_over.gif)
top
right
no-repeat
;
background
:
#5b80b2
url(../
../admin/
img/admin/tooltag-add_over.gif)
top
right
no-repeat
;
}
}
/* OBJECT HISTORY */
/* OBJECT HISTORY */
...
@@ -764,7 +764,7 @@ table#change-history tbody th {
...
@@ -764,7 +764,7 @@ table#change-history tbody th {
}
}
#content-related
.module
h2
{
#content-related
.module
h2
{
background
:
#eee
url(../img/admin/nav-bg.gif)
bottom
left
repeat-x
;
background
:
#eee
url(../
../admin/
img/admin/nav-bg.gif)
bottom
left
repeat-x
;
color
:
#666
;
color
:
#666
;
}
}
...
@@ -910,7 +910,7 @@ fieldset.collapsed h2, fieldset.collapsed {
...
@@ -910,7 +910,7 @@ fieldset.collapsed h2, fieldset.collapsed {
}
}
fieldset
.collapsed
h2
{
fieldset
.collapsed
h2
{
background-image
:
url(../img/admin/nav-bg.gif)
;
background-image
:
url(../
../admin/
img/admin/nav-bg.gif)
;
background-position
:
bottom
left
;
background-position
:
bottom
left
;
color
:
#999
;
color
:
#999
;
}
}
...
@@ -931,7 +931,7 @@ fieldset.monospace textarea {
...
@@ -931,7 +931,7 @@ fieldset.monospace textarea {
.submit-row
{
.submit-row
{
padding
:
5px
7px
;
padding
:
5px
7px
;
text-align
:
right
;
text-align
:
right
;
background
:
white
url(../img/admin/nav-bg.gif)
0
100%
repeat-x
;
background
:
white
url(../
../admin/
img/admin/nav-bg.gif)
0
100%
repeat-x
;
border
:
1px
solid
#ccc
;
border
:
1px
solid
#ccc
;
margin
:
5px
0
;
margin
:
5px
0
;
overflow
:
hidden
;
overflow
:
hidden
;
...
@@ -950,7 +950,7 @@ fieldset.monospace textarea {
...
@@ -950,7 +950,7 @@ fieldset.monospace textarea {
}
}
.submit-row
.deletelink
{
.submit-row
.deletelink
{
background
:
url(../img/admin/icon_deletelink.gif)
0
50%
no-repeat
;
background
:
url(../
../admin/
img/admin/icon_deletelink.gif)
0
50%
no-repeat
;
padding-left
:
14px
;
padding-left
:
14px
;
}
}
...
@@ -1017,7 +1017,7 @@ fieldset.monospace textarea {
...
@@ -1017,7 +1017,7 @@ fieldset.monospace textarea {
color
:
#666
;
color
:
#666
;
padding
:
3px
5px
;
padding
:
3px
5px
;
font-size
:
11px
;
font-size
:
11px
;
background
:
#e1e1e1
url(../img/admin/nav-bg.gif)
top
left
repeat-x
;
background
:
#e1e1e1
url(../
../admin/
img/admin/nav-bg.gif)
top
left
repeat-x
;
border-bottom
:
1px
solid
#ddd
;
border-bottom
:
1px
solid
#ddd
;
}
}
...
@@ -1102,7 +1102,7 @@ fieldset.monospace textarea {
...
@@ -1102,7 +1102,7 @@ fieldset.monospace textarea {
color
:
#666
;
color
:
#666
;
padding
:
3px
5px
;
padding
:
3px
5px
;
border-bottom
:
1px
solid
#ddd
;
border-bottom
:
1px
solid
#ddd
;
background
:
#e1e1e1
url(../img/admin/nav-bg.gif)
top
left
repeat-x
;
background
:
#e1e1e1
url(../
../admin/
img/admin/nav-bg.gif)
top
left
repeat-x
;
}
}
.inline-group
.tabular
tr
.add-row
td
{
.inline-group
.tabular
tr
.add-row
td
{
...
@@ -1113,7 +1113,7 @@ fieldset.monospace textarea {
...
@@ -1113,7 +1113,7 @@ fieldset.monospace textarea {
.inline-group
ul
.tools
a
.add
,
.inline-group
ul
.tools
a
.add
,
.inline-group
div
.add-row
a
,
.inline-group
div
.add-row
a
,
.inline-group
.tabular
tr
.add-row
td
a
{
.inline-group
.tabular
tr
.add-row
td
a
{
background
:
url(../img/admin/icon_addlink.gif)
0
50%
no-repeat
;
background
:
url(../
../admin/
img/admin/icon_addlink.gif)
0
50%
no-repeat
;
padding-left
:
14px
;
padding-left
:
14px
;
font-size
:
11px
;
font-size
:
11px
;
outline
:
0
;
/* Remove dotted border around link */
outline
:
0
;
/* Remove dotted border around link */
...
...
djangorestframework/static/favicon.ico
deleted
100644 → 0
View file @
ba1e3b46
File deleted
djangorestframework/static/robots.txt
deleted
100644 → 0
View file @
ba1e3b46
User-agent: *
Disallow: /
djangorestframework/templates/api_login.html
View file @
426493a7
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<html>
<html>
<head>
<head>
<link
rel=
"stylesheet"
type=
"text/css"
href=
'{% get_static_prefix %}
css/djangorestframework
.css'
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
'{% get_static_prefix %}
djangorestframework/css/style
.css'
/>
</head>
</head>
<body
class=
"login"
>
<body
class=
"login"
>
...
...
djangorestframework/templates/renderer.html
View file @
426493a7
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
{% load static %}
{% load static %}
<html
xmlns=
"http://www.w3.org/1999/xhtml"
>
<html
xmlns=
"http://www.w3.org/1999/xhtml"
>
<head>
<head>
<link
rel=
"stylesheet"
type=
"text/css"
href=
'{% get_static_prefix %}
css/djangorestframework
.css'
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
'{% get_static_prefix %}
djangorestframework/css/style
.css'
/>
<title>
Django REST framework - {{ name }}
</title>
<title>
Django REST framework - {{ name }}
</title>
</head>
</head>
<body>
<body>
...
...
djangorestframework/tests/views.py
View file @
426493a7
...
@@ -46,8 +46,6 @@ class MockResource(ModelResource):
...
@@ -46,8 +46,6 @@ class MockResource(ModelResource):
fields
=
(
'foo'
,
'bar'
,
'baz'
)
fields
=
(
'foo'
,
'bar'
,
'baz'
)
urlpatterns
=
patterns
(
'djangorestframework.utils.staticviews'
,
urlpatterns
=
patterns
(
'djangorestframework.utils.staticviews'
,
url
(
r'^robots.txt$'
,
'deny_robots'
),
url
(
r'^favicon.ico$'
,
'favicon'
),
url
(
r'^accounts/login$'
,
'api_login'
),
url
(
r'^accounts/login$'
,
'api_login'
),
url
(
r'^accounts/logout$'
,
'api_logout'
),
url
(
r'^accounts/logout$'
,
'api_logout'
),
url
(
r'^mock/$'
,
MockView
.
as_view
()),
url
(
r'^mock/$'
,
MockView
.
as_view
()),
...
@@ -123,18 +121,6 @@ class ExtraViewsTests(TestCase):
...
@@ -123,18 +121,6 @@ class ExtraViewsTests(TestCase):
"""Test the extra views djangorestframework provides"""
"""Test the extra views djangorestframework provides"""
urls
=
'djangorestframework.tests.views'
urls
=
'djangorestframework.tests.views'
def
test_robots_view
(
self
):
"""Ensure the robots view exists"""
response
=
self
.
client
.
get
(
'/robots.txt'
)
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertEqual
(
response
[
'Content-Type'
],
'text/plain'
)
def
test_favicon_view
(
self
):
"""Ensure the favicon view exists"""
response
=
self
.
client
.
get
(
'/favicon.ico'
)
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertEqual
(
response
[
'Content-Type'
],
'image/vnd.microsoft.icon'
)
def
test_login_view
(
self
):
def
test_login_view
(
self
):
"""Ensure the login view exists"""
"""Ensure the login view exists"""
response
=
self
.
client
.
get
(
'/accounts/login'
)
response
=
self
.
client
.
get
(
'/accounts/login'
)
...
...
djangorestframework/urls.py
View file @
426493a7
from
django.conf.urls.defaults
import
patterns
from
django.conf.urls.defaults
import
patterns
from
django.conf
import
settings
urlpatterns
=
patterns
(
'djangorestframework.utils.staticviews'
,
urlpatterns
=
patterns
(
'djangorestframework.utils.staticviews'
,
(
r'robots.txt'
,
'deny_robots'
),
(
r'^accounts/login/$'
,
'api_login'
),
(
r'^accounts/login/$'
,
'api_login'
),
(
r'^accounts/logout/$'
,
'api_logout'
),
(
r'^accounts/logout/$'
,
'api_logout'
),
)
)
# Only serve favicon in production because otherwise chrome users will pretty much
# permanantly have the django-rest-framework favicon whenever they navigate to
# 127.0.0.1:8000 or whatever, which gets annoying
if
not
settings
.
DEBUG
:
urlpatterns
+=
patterns
(
'djangorestframework.utils.staticviews'
,
(
r'favicon.ico'
,
'favicon'
),
)
djangorestframework/utils/staticviews.py
View file @
426493a7
...
@@ -6,15 +6,6 @@ from django.template import RequestContext
...
@@ -6,15 +6,6 @@ from django.template import RequestContext
import
base64
import
base64
def
deny_robots
(
request
):
return
HttpResponse
(
'User-agent: *
\n
Disallow: /'
,
mimetype
=
'text/plain'
)
def
favicon
(
request
):
data
=
'AAABAAEAEREAAAEAIADwBAAAFgAAACgAAAARAAAAIgAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADLy8tLy8vL3svLy1QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAy8vLBsvLywkAAAAATkZFS1xUVPqhn57/y8vL0gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJmVlQ/GxcXiy8vL88vLy4FdVlXzTkZF/2RdXP/Ly8vty8vLtMvLy5DLy8vty8vLxgAAAAAAAAAAAAAAAAAAAABORkUJTkZF4lNMS/+Lh4f/cWtq/05GRf9ORkX/Vk9O/3JtbP+Ef3//Vk9O/2ljYv/Ly8v5y8vLCQAAAAAAAAAAAAAAAE5GRQlORkX2TkZF/05GRf9ORkX/TkZF/05GRf9ORkX/TkZF/05GRf9ORkX/UElI/8PDw5cAAAAAAAAAAAAAAAAAAAAAAAAAAE5GRZZORkX/TkZF/05GRf9ORkX/TkZF/05GRf9ORkX/TkZF/05GRf+Cfn3/y8vLvQAAAAAAAAAAAAAAAAAAAADLy8tIaWNi805GRf9ORkX/YVpZ/396eV7Ly8t7qaen9lZOTu5ORkX/TkZF/25oZ//Ly8v/y8vLycvLy0gAAAAATkZFSGNcXPpORkX/TkZF/05GRf+ysLDzTkZFe1NLSv6Oior/raur805GRf9ORkX/TkZF/2hiYf+npaX/y8vL5wAAAABORkXnTkZF/05GRf9ORkX/VU1M/8vLy/9PR0b1TkZF/1VNTP/Ly8uQT0dG+E5GRf9ORkX/TkZF/1hRUP3Ly8tmAAAAAE5GRWBORkXkTkZF/05GRf9ORkX/t7a2/355eOpORkX/TkZFkISAf1BORkX/TkZF/05GRf9XT075TkZFZgAAAAAAAAAAAAAAAAAAAABORkXDTkZF/05GRf9lX17/ubi4/8vLy/+2tbT/Yltb/05GRf9ORkX/a2Vk/8vLy5MAAAAAAAAAAAAAAAAAAAAAAAAAAFNLSqNORkX/TkZF/05GRf9ORkX/TkZF/05GRf9ORkX/TkZF/05GRf+Cfn3/y8vL+cvLyw8AAAAAAAAAAAAAAABORkUSTkZF+U5GRf9ORkX/TkZF/05GRf9ORkX/TkZF/05GRf9ORkX/TkZF/1BJSP/CwsLmy8vLDwAAAAAAAAAAAAAAAE5GRRJORkXtTkZF9FFJSJ1ORkXJTkZF/05GRf9ORkX/ZF5d9k5GRZ9ORkXtTkZF5HFsaxUAAAAAAAAAAAAAAAAAAAAAAAAAAE5GRQxORkUJAAAAAAAAAABORkXhTkZF/2JbWv7Ly8tgAAAAAAAAAABORkUGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE5GRWBORkX2TkZFYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//+AAP9/gAD+P4AA4AOAAMADgADAA4AAwAOAAMMBgACCAIAAAAGAAIBDgADAA4AAwAOAAMADgADAB4AA/H+AAP7/gAA='
return
HttpResponse
(
base64
.
b64decode
(
data
),
mimetype
=
'image/vnd.microsoft.icon'
)
# BLERGH
# BLERGH
# Replicate django.contrib.auth.views.login simply so we don't have get users to update TEMPLATE_CONTEXT_PROCESSORS
# Replicate django.contrib.auth.views.login simply so we don't have get users to update TEMPLATE_CONTEXT_PROCESSORS
# to add ADMIN_MEDIA_PREFIX to the RequestContext. I don't like this but really really want users to not have to
# to add ADMIN_MEDIA_PREFIX to the RequestContext. I don't like this but really really want users to not have to
...
...
docs/howto/setup.rst
View file @
426493a7
...
@@ -37,16 +37,15 @@ The Python `markdown library <http://www.freewisdom.org/projects/python-markdown
...
@@ -37,16 +37,15 @@ The Python `markdown library <http://www.freewisdom.org/projects/python-markdown
If markdown is installed your :class:`.Resource` descriptions can include `markdown style formatting
If markdown is installed your :class:`.Resource` descriptions can include `markdown style formatting
<http://daringfireball.net/projects/markdown/syntax>`_ which will be rendered by the HTML documenting renderer.
<http://daringfireball.net/projects/markdown/syntax>`_ which will be rendered by the HTML documenting renderer.
robots.txt, favicon,
login/logout
login/logout
---------------------------------
---------------------------------
Django REST framework comes with a few views that can be useful including a deny robots view, a favicon view, and api login and logout views::
Django REST framework comes with a few views that can be useful including an api
login and logout views::
from django.conf.urls.defaults import patterns
from django.conf.urls.defaults import patterns
urlpatterns = patterns('djangorestframework.views',
urlpatterns = patterns('djangorestframework.views',
(r'robots.txt', 'deny_robots'),
(r'favicon.ico', 'favicon'),
# Add your resources here
# Add your resources here
(r'^accounts/login/$', 'api_login'),
(r'^accounts/login/$', 'api_login'),
(r'^accounts/logout/$', 'api_logout'),
(r'^accounts/logout/$', 'api_logout'),
...
...
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