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
751d77cd
Kaydet (Commit)
751d77cd
authored
Ock 27, 2017
tarafından
Ed Morley
Kaydeden (comit)
Tim Graham
Ock 27, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #27537 -- Added default_addr(_ipv6) attributes to runserver command.
üst
0cbfc844
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
runserver.py
django/core/management/commands/runserver.py
+3
-1
tests.py
tests/admin_scripts/tests.py
+12
-0
No files found.
django/core/management/commands/runserver.py
Dosyayı görüntüle @
751d77cd
...
...
@@ -29,6 +29,8 @@ class Command(BaseCommand):
requires_system_checks
=
False
leave_locale_alone
=
True
default_addr
=
'127.0.0.1'
default_addr_ipv6
=
'::1'
default_port
=
'8000'
protocol
=
'http'
server_cls
=
WSGIServer
...
...
@@ -94,7 +96,7 @@ class Command(BaseCommand):
elif
self
.
use_ipv6
and
not
_fqdn
:
raise
CommandError
(
'"
%
s" is not a valid IPv6 address.'
%
self
.
addr
)
if
not
self
.
addr
:
self
.
addr
=
'::1'
if
self
.
use_ipv6
else
'127.0.0.1'
self
.
addr
=
self
.
default_addr_ipv6
if
self
.
use_ipv6
else
self
.
default_addr
self
.
_raw_ipv6
=
self
.
use_ipv6
self
.
run
(
**
options
)
...
...
tests/admin_scripts/tests.py
Dosyayı görüntüle @
751d77cd
...
...
@@ -1311,6 +1311,18 @@ class ManageRunserver(AdminScriptTestCase):
call_command
(
self
.
cmd
,
addrport
=
"test.domain.local:7000"
,
use_ipv6
=
True
)
self
.
assertServerSettings
(
'test.domain.local'
,
'7000'
,
ipv6
=
True
)
def
test_runner_custom_defaults
(
self
):
self
.
cmd
.
default_addr
=
'0.0.0.0'
self
.
cmd
.
default_port
=
'5000'
call_command
(
self
.
cmd
)
self
.
assertServerSettings
(
'0.0.0.0'
,
'5000'
)
@unittest.skipUnless
(
socket
.
has_ipv6
,
"platform doesn't support IPv6"
)
def
test_runner_custom_defaults_ipv6
(
self
):
self
.
cmd
.
default_addr_ipv6
=
'::'
call_command
(
self
.
cmd
,
use_ipv6
=
True
)
self
.
assertServerSettings
(
'::'
,
'8000'
,
ipv6
=
True
,
raw_ipv6
=
True
)
def
test_runner_ambiguous
(
self
):
# Only 4 characters, all of which could be in an ipv6 address
call_command
(
self
.
cmd
,
addrport
=
"beef:7654"
)
...
...
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