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
e6dd7f99
Kaydet (Commit)
e6dd7f99
authored
Haz 13, 2015
tarafından
Mounir Messelmeni
Kaydeden (comit)
Tim Graham
Haz 16, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #24971 -- Made startapp generate an apps.py
üst
c5eca746
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
0 deletions
+25
-0
__init__.py
django/conf/app_template/__init__.py
+1
-0
apps.py
django/conf/app_template/apps.py
+5
-0
templates.py
django/core/management/templates.py
+3
-0
django-admin.txt
docs/ref/django-admin.txt
+5
-0
1.9.txt
docs/releases/1.9.txt
+3
-0
tests.py
tests/admin_scripts/tests.py
+8
-0
No files found.
django/conf/app_template/__init__.py
Dosyayı görüntüle @
e6dd7f99
default_app_config
=
'{{ app_name }}.apps.{{ camel_case_app_name }}Config'
django/conf/app_template/apps.py
0 → 100644
Dosyayı görüntüle @
e6dd7f99
from
django.apps
import
AppConfig
class
{{
camel_case_app_name
}}
Config
(
AppConfig
):
name
=
'{{ app_name }}'
django/core/management/templates.py
Dosyayı görüntüle @
e6dd7f99
...
@@ -98,10 +98,13 @@ class TemplateCommand(BaseCommand):
...
@@ -98,10 +98,13 @@ class TemplateCommand(BaseCommand):
base_name
=
'
%
s_name'
%
app_or_project
base_name
=
'
%
s_name'
%
app_or_project
base_subdir
=
'
%
s_template'
%
app_or_project
base_subdir
=
'
%
s_template'
%
app_or_project
base_directory
=
'
%
s_directory'
%
app_or_project
base_directory
=
'
%
s_directory'
%
app_or_project
camel_case_name
=
'camel_case_
%
s_name'
%
app_or_project
camel_case_value
=
''
.
join
(
x
for
x
in
name
.
title
()
if
x
!=
'_'
)
context
=
Context
(
dict
(
options
,
**
{
context
=
Context
(
dict
(
options
,
**
{
base_name
:
name
,
base_name
:
name
,
base_directory
:
top_dir
,
base_directory
:
top_dir
,
camel_case_name
:
camel_case_value
,
'docs_version'
:
get_docs_version
(),
'docs_version'
:
get_docs_version
(),
'django_version'
:
django
.
__version__
,
'django_version'
:
django
.
__version__
,
'unicode_literals'
:
''
if
six
.
PY3
else
'from __future__ import unicode_literals
\n\n
'
,
'unicode_literals'
:
''
if
six
.
PY3
else
'from __future__ import unicode_literals
\n\n
'
,
...
...
docs/ref/django-admin.txt
Dosyayı görüntüle @
e6dd7f99
...
@@ -1094,8 +1094,13 @@ with the ``--name`` option. The :class:`template context
...
@@ -1094,8 +1094,13 @@ with the ``--name`` option. The :class:`template context
options)
options)
- ``app_name`` -- the app name as passed to the command
- ``app_name`` -- the app name as passed to the command
- ``app_directory`` -- the full path of the newly created app
- ``app_directory`` -- the full path of the newly created app
- ``camel_case_app_name`` -- the app name in camel case format
- ``docs_version`` -- the version of the documentation: ``'dev'`` or ``'1.x'``
- ``docs_version`` -- the version of the documentation: ``'dev'`` or ``'1.x'``
.. versionadded:: 1.9
``camel_case_app_name`` was added.
.. _render_warning:
.. _render_warning:
.. warning::
.. warning::
...
...
docs/releases/1.9.txt
Dosyayı görüntüle @
e6dd7f99
...
@@ -275,6 +275,9 @@ Management Commands
...
@@ -275,6 +275,9 @@ Management Commands
* The :djadmin:`createcachetable` command now has a ``--dry-run`` flag to
* The :djadmin:`createcachetable` command now has a ``--dry-run`` flag to
print out the SQL rather than execute it.
print out the SQL rather than execute it.
* The :djadmin:`startapp` command creates an ``apps.py`` file and adds
``default_app_config`` in ``__init__.py``.
Models
Models
^^^^^^
^^^^^^
...
...
tests/admin_scripts/tests.py
Dosyayı görüntüle @
e6dd7f99
...
@@ -592,6 +592,14 @@ class DjangoAdminSettingsDirectory(AdminScriptTestCase):
...
@@ -592,6 +592,14 @@ class DjangoAdminSettingsDirectory(AdminScriptTestCase):
self
.
addCleanup
(
shutil
.
rmtree
,
app_path
)
self
.
addCleanup
(
shutil
.
rmtree
,
app_path
)
self
.
assertNoOutput
(
err
)
self
.
assertNoOutput
(
err
)
self
.
assertTrue
(
os
.
path
.
exists
(
app_path
))
self
.
assertTrue
(
os
.
path
.
exists
(
app_path
))
with
open
(
os
.
path
.
join
(
app_path
,
'apps.py'
),
'r'
)
as
f
:
content
=
f
.
read
()
self
.
assertIn
(
"class SettingsTestConfig(AppConfig)"
,
content
)
self
.
assertIn
(
"name = 'settings_test'"
,
content
)
with
open
(
os
.
path
.
join
(
app_path
,
'__init__.py'
),
'r'
)
as
f
:
content
=
f
.
read
()
expected_content
=
"default_app_config = 'settings_test.apps.SettingsTestConfig'"
self
.
assertIn
(
expected_content
,
content
)
if
not
PY3
:
if
not
PY3
:
with
open
(
os
.
path
.
join
(
app_path
,
'models.py'
),
'r'
)
as
fp
:
with
open
(
os
.
path
.
join
(
app_path
,
'models.py'
),
'r'
)
as
fp
:
content
=
fp
.
read
()
content
=
fp
.
read
()
...
...
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