Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
deed192d
Kaydet (Commit)
deed192d
authored
Haz 30, 2012
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Removed usage of mimetype kwarg of HttpResponse
Refs #16519.
üst
c446bdee
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
9 deletions
+9
-9
__init__.py
django/shortcuts/__init__.py
+1
-1
csrf.py
django/views/csrf.py
+1
-1
debug.py
django/views/debug.py
+4
-4
static.py
django/views/static.py
+2
-2
views.py
tests/regressiontests/test_client_regress/views.py
+1
-1
No files found.
django/shortcuts/__init__.py
Dosyayı görüntüle @
deed192d
...
@@ -16,7 +16,7 @@ def render_to_response(*args, **kwargs):
...
@@ -16,7 +16,7 @@ def render_to_response(*args, **kwargs):
Returns a HttpResponse whose content is filled with the result of calling
Returns a HttpResponse whose content is filled with the result of calling
django.template.loader.render_to_string() with the passed arguments.
django.template.loader.render_to_string() with the passed arguments.
"""
"""
httpresponse_kwargs
=
{
'
mime
type'
:
kwargs
.
pop
(
'mimetype'
,
None
)}
httpresponse_kwargs
=
{
'
content_
type'
:
kwargs
.
pop
(
'mimetype'
,
None
)}
return
HttpResponse
(
loader
.
render_to_string
(
*
args
,
**
kwargs
),
**
httpresponse_kwargs
)
return
HttpResponse
(
loader
.
render_to_string
(
*
args
,
**
kwargs
),
**
httpresponse_kwargs
)
def
render
(
request
,
*
args
,
**
kwargs
):
def
render
(
request
,
*
args
,
**
kwargs
):
...
...
django/views/csrf.py
Dosyayı görüntüle @
deed192d
...
@@ -101,4 +101,4 @@ def csrf_failure(request, reason=""):
...
@@ -101,4 +101,4 @@ def csrf_failure(request, reason=""):
'reason'
:
reason
,
'reason'
:
reason
,
'no_referer'
:
reason
==
REASON_NO_REFERER
'no_referer'
:
reason
==
REASON_NO_REFERER
})
})
return
HttpResponseForbidden
(
t
.
render
(
c
),
mime
type
=
'text/html'
)
return
HttpResponseForbidden
(
t
.
render
(
c
),
content_
type
=
'text/html'
)
django/views/debug.py
Dosyayı görüntüle @
deed192d
...
@@ -63,10 +63,10 @@ def technical_500_response(request, exc_type, exc_value, tb):
...
@@ -63,10 +63,10 @@ def technical_500_response(request, exc_type, exc_value, tb):
reporter
=
ExceptionReporter
(
request
,
exc_type
,
exc_value
,
tb
)
reporter
=
ExceptionReporter
(
request
,
exc_type
,
exc_value
,
tb
)
if
request
.
is_ajax
():
if
request
.
is_ajax
():
text
=
reporter
.
get_traceback_text
()
text
=
reporter
.
get_traceback_text
()
return
HttpResponseServerError
(
text
,
mime
type
=
'text/plain'
)
return
HttpResponseServerError
(
text
,
content_
type
=
'text/plain'
)
else
:
else
:
html
=
reporter
.
get_traceback_html
()
html
=
reporter
.
get_traceback_html
()
return
HttpResponseServerError
(
html
,
mime
type
=
'text/html'
)
return
HttpResponseServerError
(
html
,
content_
type
=
'text/html'
)
# Cache for the default exception reporter filter instance.
# Cache for the default exception reporter filter instance.
default_exception_reporter_filter
=
None
default_exception_reporter_filter
=
None
...
@@ -443,7 +443,7 @@ def technical_404_response(request, exception):
...
@@ -443,7 +443,7 @@ def technical_404_response(request, exception):
'request'
:
request
,
'request'
:
request
,
'settings'
:
get_safe_settings
(),
'settings'
:
get_safe_settings
(),
})
})
return
HttpResponseNotFound
(
t
.
render
(
c
),
mime
type
=
'text/html'
)
return
HttpResponseNotFound
(
t
.
render
(
c
),
content_
type
=
'text/html'
)
def
empty_urlconf
(
request
):
def
empty_urlconf
(
request
):
"Create an empty URLconf 404 error response."
"Create an empty URLconf 404 error response."
...
@@ -451,7 +451,7 @@ def empty_urlconf(request):
...
@@ -451,7 +451,7 @@ def empty_urlconf(request):
c
=
Context
({
c
=
Context
({
'project_name'
:
settings
.
SETTINGS_MODULE
.
split
(
'.'
)[
0
]
'project_name'
:
settings
.
SETTINGS_MODULE
.
split
(
'.'
)[
0
]
})
})
return
HttpResponse
(
t
.
render
(
c
),
mime
type
=
'text/html'
)
return
HttpResponse
(
t
.
render
(
c
),
content_
type
=
'text/html'
)
#
#
# Templates are embedded in the file so that we know the error handler will
# Templates are embedded in the file so that we know the error handler will
...
...
django/views/static.py
Dosyayı görüntüle @
deed192d
...
@@ -58,9 +58,9 @@ def serve(request, path, document_root=None, show_indexes=False):
...
@@ -58,9 +58,9 @@ def serve(request, path, document_root=None, show_indexes=False):
mimetype
=
mimetype
or
'application/octet-stream'
mimetype
=
mimetype
or
'application/octet-stream'
if
not
was_modified_since
(
request
.
META
.
get
(
'HTTP_IF_MODIFIED_SINCE'
),
if
not
was_modified_since
(
request
.
META
.
get
(
'HTTP_IF_MODIFIED_SINCE'
),
statobj
.
st_mtime
,
statobj
.
st_size
):
statobj
.
st_mtime
,
statobj
.
st_size
):
return
HttpResponseNotModified
(
mime
type
=
mimetype
)
return
HttpResponseNotModified
(
content_
type
=
mimetype
)
with
open
(
fullpath
,
'rb'
)
as
f
:
with
open
(
fullpath
,
'rb'
)
as
f
:
response
=
HttpResponse
(
f
.
read
(),
mime
type
=
mimetype
)
response
=
HttpResponse
(
f
.
read
(),
content_
type
=
mimetype
)
response
[
"Last-Modified"
]
=
http_date
(
statobj
.
st_mtime
)
response
[
"Last-Modified"
]
=
http_date
(
statobj
.
st_mtime
)
if
stat
.
S_ISREG
(
statobj
.
st_mode
):
if
stat
.
S_ISREG
(
statobj
.
st_mode
):
response
[
"Content-Length"
]
=
statobj
.
st_size
response
[
"Content-Length"
]
=
statobj
.
st_size
...
...
tests/regressiontests/test_client_regress/views.py
Dosyayı görüntüle @
deed192d
...
@@ -84,7 +84,7 @@ def return_json_file(request):
...
@@ -84,7 +84,7 @@ def return_json_file(request):
cls
=
DjangoJSONEncoder
,
cls
=
DjangoJSONEncoder
,
ensure_ascii
=
False
)
ensure_ascii
=
False
)
response
=
HttpResponse
(
obj_json
.
encode
(
charset
),
status
=
200
,
response
=
HttpResponse
(
obj_json
.
encode
(
charset
),
status
=
200
,
mime
type
=
'application/json; charset=
%
s'
%
charset
)
content_
type
=
'application/json; charset=
%
s'
%
charset
)
response
[
'Content-Disposition'
]
=
'attachment; filename=testfile.json'
response
[
'Content-Disposition'
]
=
'attachment; filename=testfile.json'
return
response
return
response
...
...
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