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
bfc75996
Kaydet (Commit)
bfc75996
authored
Kas 30, 2014
tarafından
wrwrwr
Kaydeden (comit)
Tim Graham
Ara 02, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #23945 -- Made default site use the configured SITE_ID.
üst
1739ae9e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
management.py
django/contrib/sites/management.py
+2
-1
tests.py
django/contrib/sites/tests.py
+8
-0
1.8.txt
docs/releases/1.8.txt
+4
-0
No files found.
django/contrib/sites/management.py
Dosyayı görüntüle @
bfc75996
...
...
@@ -3,6 +3,7 @@ Creates the default Site object.
"""
from
django.apps
import
apps
from
django.conf
import
settings
from
django.core.management.color
import
no_style
from
django.db
import
DEFAULT_DB_ALIAS
,
connections
,
router
...
...
@@ -24,7 +25,7 @@ def create_default_site(app_config, verbosity=2, interactive=True, db=DEFAULT_DB
# can also crop up outside of tests - see #15346.
if
verbosity
>=
2
:
print
(
"Creating example.com Site object"
)
Site
(
pk
=
1
,
domain
=
"example.com"
,
name
=
"example.com"
)
.
save
(
using
=
db
)
Site
(
pk
=
settings
.
SITE_ID
,
domain
=
"example.com"
,
name
=
"example.com"
)
.
save
(
using
=
db
)
# We set an explicit pk instead of relying on auto-incrementation,
# so we need to reset the database sequence. See #17415.
...
...
django/contrib/sites/tests.py
Dosyayı görüntüle @
bfc75996
...
...
@@ -176,6 +176,14 @@ class CreateDefaultSiteTests(TestCase):
post_migrate
.
send
(
sender
=
self
.
app_config
,
app_config
=
self
.
app_config
,
verbosity
=
0
)
self
.
assertTrue
(
Site
.
objects
.
exists
())
@override_settings
(
SITE_ID
=
35696
)
def
test_custom_site_id
(
self
):
"""
#23945 - The configured ``SITE_ID`` should be respected.
"""
create_default_site
(
self
.
app_config
,
verbosity
=
0
)
self
.
assertEqual
(
Site
.
objects
.
get
()
.
pk
,
35696
)
class
MiddlewareTest
(
TestCase
):
...
...
docs/releases/1.8.txt
Dosyayı görüntüle @
bfc75996
...
...
@@ -168,6 +168,10 @@ Minor features
<django.http.HttpRequest.get_host>` if the :setting:`SITE_ID` setting is not
defined.
* The default :class:`~django.contrib.sites.models.Site` created when running
``migrate`` now respects the :setting:`SITE_ID` setting (instead of always
using ``pk=1``).
:mod:`django.contrib.staticfiles`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
...
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