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
617eff41
Kaydet (Commit)
617eff41
authored
Nis 30, 2015
tarafından
Ryan Hiebert
Kaydeden (comit)
Tim Graham
Eyl 07, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #24857 -- Added "python -m django" entry point.
üst
1743efbe
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
1 deletion
+28
-1
__main__.py
django/__main__.py
+9
-0
django-admin.txt
docs/ref/django-admin.txt
+7
-1
1.9.txt
docs/releases/1.9.txt
+3
-0
tests.py
tests/admin_scripts/tests.py
+9
-0
No files found.
django/__main__.py
0 → 100644
Dosyayı görüntüle @
617eff41
"""
Invokes django-admin when the django module is run as a script.
Example: python -m django check
"""
from
django.core
import
management
if
__name__
==
"__main__"
:
management
.
execute_from_command_line
()
docs/ref/django-admin.txt
Dosyayı görüntüle @
617eff41
...
...
@@ -33,7 +33,12 @@ Django settings files, use ``django-admin`` with
option.
The command-line examples throughout this document use ``django-admin`` to
be consistent, but any example can use ``manage.py`` just as well.
be consistent, but any example can use ``manage.py`` or ``python -m django``
just as well.
.. versionadded:: 1.9
``python -m django`` was added.
Usage
=====
...
...
@@ -42,6 +47,7 @@ Usage
$ django-admin <command> [options]
$ manage.py <command> [options]
$ python -m django <command> [options]
``command`` should be one of the commands listed in this document.
``options``, which is optional, should be zero or more of the options available
...
...
docs/releases/1.9.txt
Dosyayı görüntüle @
617eff41
...
...
@@ -415,6 +415,9 @@ Management Commands
to the database using the password from your settings file (instead of
requiring it to be manually entered).
* The ``django`` package may be run as a script, i.e. ``python -m django``,
which will behave the same as ``django-admin``.
Migrations
^^^^^^^^^^
...
...
tests/admin_scripts/tests.py
Dosyayı görüntüle @
617eff41
...
...
@@ -2037,3 +2037,12 @@ class Dumpdata(AdminScriptTestCase):
out
,
err
=
self
.
run_manage
(
args
)
self
.
assertOutput
(
err
,
"You can only use --pks option with one model"
)
self
.
assertNoOutput
(
out
)
class
MainModule
(
AdminScriptTestCase
):
"""python -m django works like django-admin."""
def
test_runs_django_admin
(
self
):
cmd_out
,
_
=
self
.
run_django_admin
([
'--version'
])
mod_out
,
_
=
self
.
run_test
(
'-m'
,
[
'django'
,
'--version'
])
self
.
assertEqual
(
mod_out
,
cmd_out
)
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