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
42cdd005
Commit
42cdd005
authored
Dec 09, 2011
by
Tom Christie
Browse files
Options
Browse Files
Download
Plain Diff
Merge meurig's absolute_url fix.
parents
325ee1e3
e7047053
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
AUTHORS
+1
-0
djangorestframework/views.py
+7
-5
No files found.
AUTHORS
View file @
42cdd005
...
@@ -18,6 +18,7 @@ Tom Drummond <devioustree>
...
@@ -18,6 +18,7 @@ Tom Drummond <devioustree>
Danilo Bargen <gwrtheyrn>
Danilo Bargen <gwrtheyrn>
Andrew McCloud <amccloud>
Andrew McCloud <amccloud>
Thomas Steinacher <thomasst>
Thomas Steinacher <thomasst>
Meurig Freeman <meurig>
THANKS TO:
THANKS TO:
...
...
djangorestframework/views.py
View file @
42cdd005
...
@@ -5,7 +5,7 @@ be subclassing in your implementation.
...
@@ -5,7 +5,7 @@ be subclassing in your implementation.
By setting or modifying class attributes on your view, you change it's predefined behaviour.
By setting or modifying class attributes on your view, you change it's predefined behaviour.
"""
"""
from
django.core.urlresolvers
import
set_script_prefix
from
django.core.urlresolvers
import
set_script_prefix
,
get_script_prefix
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
django.views.decorators.csrf
import
csrf_exempt
from
django.views.decorators.csrf
import
csrf_exempt
...
@@ -114,8 +114,9 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView):
...
@@ -114,8 +114,9 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView):
self
.
headers
=
{}
self
.
headers
=
{}
# Calls to 'reverse' will not be fully qualified unless we set the scheme/host/port here.
# Calls to 'reverse' will not be fully qualified unless we set the scheme/host/port here.
orig_prefix
=
get_script_prefix
()
prefix
=
'
%
s://
%
s'
%
(
request
.
is_secure
()
and
'https'
or
'http'
,
request
.
get_host
())
prefix
=
'
%
s://
%
s'
%
(
request
.
is_secure
()
and
'https'
or
'http'
,
request
.
get_host
())
set_script_prefix
(
prefix
)
set_script_prefix
(
prefix
+
orig_prefix
)
try
:
try
:
self
.
initial
(
request
,
*
args
,
**
kwargs
)
self
.
initial
(
request
,
*
args
,
**
kwargs
)
...
@@ -162,13 +163,14 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView):
...
@@ -162,13 +163,14 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView):
# merge with headers possibly set at some point in the view
# merge with headers possibly set at some point in the view
response
.
headers
.
update
(
self
.
headers
)
response
.
headers
.
update
(
self
.
headers
)
return
self
.
render
(
response
)
set_script_prefix
(
orig_prefix
)
return
self
.
render
(
response
)
def
options
(
self
,
request
,
*
args
,
**
kwargs
):
def
options
(
self
,
request
,
*
args
,
**
kwargs
):
response_obj
=
{
response_obj
=
{
'name'
:
get_name
(
self
),
'name'
:
get_name
(
self
),
'description'
:
get_description
(
self
),
'description'
:
get_description
(
self
),
'renders'
:
self
.
_rendered_media_types
,
'renders'
:
self
.
_rendered_media_types
,
'parses'
:
self
.
_parsed_media_types
,
'parses'
:
self
.
_parsed_media_types
,
}
}
...
...
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