Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django2-project-template
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
django2-project-template
Commits
f47a9f0b
Unverified
Kaydet (Commit)
f47a9f0b
authored
Mar 21, 2019
tarafından
Uğur Özyılmazel
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix name argument for create_app management command
üst
3505b876
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
5 deletions
+16
-5
README.md
README.md
+3
-3
create_app.py
applications/baseapp/management/commands/create_app.py
+12
-2
urls.py
...aseapp/management/template_structures/application/urls.py
+1
-0
No files found.
README.md
Dosyayı görüntüle @
f47a9f0b
[
![Build Status
](
https://travis-ci.org/vigo/django2-project-template.svg?branch=master
)
](https://travis-ci.org/vigo/django2-project-template)
![
Python
](
https://img.shields.io/badge/django-3.7.0-green.svg
)
![
Django
](
https://img.shields.io/badge/django-2.1.7-green.svg
)
![
Version
](
https://img.shields.io/badge/version-1.3.
0
-yellow.svg
)
![
Version
](
https://img.shields.io/badge/version-1.3.
1
-yellow.svg
)
# Django Project Starter Template
...
...
@@ -137,7 +137,7 @@ $ rake new:application[blog]
- Do not forget to add your
`
blog
`
to
`
INSTALLED_APPS
`
under
`
config/settings/base.py
`
:
INSTALLED_APPS +
=
[
'blog'
,
'blog
.apps.BlogConfig
'
,
]
- Do not forget to fix your
`
config/settings/urls.py
`
:
...
...
@@ -162,7 +162,7 @@ Fix your `config/settings/base.py`, add this newly created app to your `INSTALLE
AUTH_USER_MODEL
=
'baseapp.User'
INSTALLED_APPS
+=
[
'blog'
,
'blog
.apps.BlogConfig
'
,
]
```
...
...
applications/baseapp/management/commands/create_app.py
Dosyayı görüntüle @
f47a9f0b
import
errno
import
os
import
time
import
re
from
importlib
import
import_module
from
django.conf
import
settings
...
...
@@ -76,7 +77,7 @@ USER_REMINDER = """
- Do not forget to add your `{app_name}` to `INSTALLED_APPS` under `config/settings/base.py`:
INSTALLED_APPS += [
'{app_name}',
'{app_name}
.apps.{inital_caps_appname}Config
',
]
- Do not forget to fix your `config/settings/urls.py`:
...
...
@@ -105,6 +106,9 @@ class Command(CustomBaseCommand):
def
handle
(
self
,
*
args
,
**
options
):
app_name
=
options
.
pop
(
'name'
)[
0
]
inital_caps_appname
=
''
.
join
(
map
(
lambda
t
:
t
.
title
(),
re
.
split
(
'[^a-zA-Z0-9]'
,
app_name
))
)
try
:
import_module
(
app_name
)
...
...
@@ -152,7 +156,13 @@ class Command(CustomBaseCommand):
self
.
stdout
.
write
(
self
.
style
.
SUCCESS
(
'"{0}" application created.'
.
format
(
app_name
))
)
self
.
stdout
.
write
(
self
.
style
.
NOTICE
(
USER_REMINDER
.
format
(
app_name
=
app_name
)))
self
.
stdout
.
write
(
self
.
style
.
NOTICE
(
USER_REMINDER
.
format
(
app_name
=
app_name
,
inital_caps_appname
=
inital_caps_appname
)
)
)
def
generate_files
(
self
,
files_list
,
root_path
,
render_params
):
for
single_file
in
files_list
:
...
...
applications/baseapp/management/template_structures/application/urls.py
Dosyayı görüntüle @
f47a9f0b
...
...
@@ -3,6 +3,7 @@ TEMPLATE_URLS = """from django.urls import path
from .views import {app_name_title}View
app_name = '{app_name}'
# fmt: off
urlpatterns = [
path('', view={app_name_title}View.as_view(), name='{app_name}_index'),
...
...
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