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
e5e37473
Kaydet (Commit)
e5e37473
authored
Ock 09, 2017
tarafından
David Sanders
Kaydeden (comit)
Tim Graham
Ock 09, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #27705 -- Added protocol/server_cls attributes to runserver for extensibility.
üst
0a47b675
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
runserver.py
django/core/management/commands/runserver.py
+8
-3
basehttp.py
django/core/servers/basehttp.py
+3
-3
No files found.
django/core/management/commands/runserver.py
Dosyayı görüntüle @
e5e37473
...
...
@@ -9,7 +9,9 @@ from datetime import datetime
from
django.conf
import
settings
from
django.core.management.base
import
BaseCommand
,
CommandError
from
django.core.servers.basehttp
import
get_internal_wsgi_application
,
run
from
django.core.servers.basehttp
import
(
WSGIServer
,
get_internal_wsgi_application
,
run
,
)
from
django.utils
import
autoreload
,
six
from
django.utils.encoding
import
force_text
,
get_system_encoding
...
...
@@ -30,6 +32,8 @@ class Command(BaseCommand):
leave_locale_alone
=
True
default_port
=
'8000'
protocol
=
'http'
server_cls
=
WSGIServer
def
add_arguments
(
self
,
parser
):
parser
.
add_argument
(
...
...
@@ -128,11 +132,12 @@ class Command(BaseCommand):
self
.
stdout
.
write
(
now
)
self
.
stdout
.
write
((
"Django version
%(version)
s, using settings
%(settings)
r
\n
"
"Starting development server at
http
://
%(addr)
s:
%(port)
s/
\n
"
"Starting development server at
%(protocol)
s
://
%(addr)
s:
%(port)
s/
\n
"
"Quit the server with
%(quit_command)
s.
\n
"
)
%
{
"version"
:
self
.
get_version
(),
"settings"
:
settings
.
SETTINGS_MODULE
,
"protocol"
:
self
.
protocol
,
"addr"
:
'[
%
s]'
%
self
.
addr
if
self
.
_raw_ipv6
else
self
.
addr
,
"port"
:
self
.
port
,
"quit_command"
:
quit_command
,
...
...
@@ -141,7 +146,7 @@ class Command(BaseCommand):
try
:
handler
=
self
.
get_handler
(
*
args
,
**
options
)
run
(
self
.
addr
,
int
(
self
.
port
),
handler
,
ipv6
=
self
.
use_ipv6
,
threading
=
threading
)
ipv6
=
self
.
use_ipv6
,
threading
=
threading
,
server_cls
=
self
.
server_cls
)
except
socket
.
error
as
e
:
# Use helpful error messages instead of ugly tracebacks.
ERRORS
=
{
...
...
django/core/servers/basehttp.py
Dosyayı görüntüle @
e5e37473
...
...
@@ -160,12 +160,12 @@ class WSGIRequestHandler(simple_server.WSGIRequestHandler, object):
handler
.
run
(
self
.
server
.
get_app
())
def
run
(
addr
,
port
,
wsgi_handler
,
ipv6
=
False
,
threading
=
False
):
def
run
(
addr
,
port
,
wsgi_handler
,
ipv6
=
False
,
threading
=
False
,
server_cls
=
WSGIServer
):
server_address
=
(
addr
,
port
)
if
threading
:
httpd_cls
=
type
(
str
(
'WSGIServer'
),
(
socketserver
.
ThreadingMixIn
,
WSGIServer
),
{})
httpd_cls
=
type
(
str
(
'WSGIServer'
),
(
socketserver
.
ThreadingMixIn
,
server_cls
),
{})
else
:
httpd_cls
=
WSGIServer
httpd_cls
=
server_cls
httpd
=
httpd_cls
(
server_address
,
WSGIRequestHandler
,
ipv6
=
ipv6
)
if
threading
:
# ThreadingMixIn.daemon_threads indicates how threads will behave on an
...
...
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