keith-django-app-creator 0.2.0__py3-none-any.whl → 0.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- app_creator/cli.py +9 -8
- {parfaite → keita}/apps.py +2 -2
- {keith_django_app_creator-0.2.0.dist-info → keith_django_app_creator-0.3.0.dist-info}/METADATA +5 -5
- keith_django_app_creator-0.3.0.dist-info/RECORD +18 -0
- keith_django_app_creator-0.3.0.dist-info/entry_points.txt +2 -0
- {keith_django_app_creator-0.2.0.dist-info → keith_django_app_creator-0.3.0.dist-info}/top_level.txt +1 -1
- keith_django_app_creator-0.2.0.dist-info/RECORD +0 -18
- keith_django_app_creator-0.2.0.dist-info/entry_points.txt +0 -2
- {parfaite → keita}/__init__.py +0 -0
- {parfaite → keita}/admin.py +0 -0
- {parfaite → keita}/migrations/__init__.py +0 -0
- {parfaite → keita}/models/__init__.py +0 -0
- {parfaite → keita}/tests.py +0 -0
- {parfaite → keita}/urls.py +0 -0
- {parfaite → keita}/views/__init__.py +0 -0
- {keith_django_app_creator-0.2.0.dist-info → keith_django_app_creator-0.3.0.dist-info}/WHEEL +0 -0
app_creator/cli.py
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
import os
|
2
2
|
import sys
|
3
3
|
|
4
|
+
def to_camel_case(snake_str):
|
5
|
+
return ''.join(word.capitalize() for word in snake_str.split('_'))
|
6
|
+
|
4
7
|
def create_app(app_name):
|
5
8
|
os.makedirs(app_name, exist_ok=True)
|
6
9
|
os.makedirs(f"{app_name}/models", exist_ok=True)
|
7
10
|
os.makedirs(f"{app_name}/views", exist_ok=True)
|
8
11
|
os.makedirs(f"{app_name}/migrations", exist_ok=True)
|
9
12
|
|
10
|
-
# Fichiers de base
|
11
13
|
with open(f"{app_name}/__init__.py", "w"): pass
|
12
|
-
|
13
14
|
with open(f"{app_name}/models/__init__.py", "w") as f:
|
14
15
|
f.write("# models here\n")
|
15
16
|
|
@@ -17,7 +18,7 @@ def create_app(app_name):
|
|
17
18
|
f.write("# views here\n")
|
18
19
|
|
19
20
|
with open(f"{app_name}/migrations/__init__.py", "w") as f:
|
20
|
-
pass
|
21
|
+
pass
|
21
22
|
|
22
23
|
with open(f"{app_name}/urls.py", "w") as f:
|
23
24
|
f.write(
|
@@ -31,7 +32,7 @@ def create_app(app_name):
|
|
31
32
|
f.write("from django.contrib import admin\n\n# Register your models here.\n")
|
32
33
|
|
33
34
|
with open(f"{app_name}/apps.py", "w") as f:
|
34
|
-
class_name = app_name
|
35
|
+
class_name = to_camel_case(app_name) + "Config"
|
35
36
|
f.write(
|
36
37
|
"from django.apps import AppConfig\n\n"
|
37
38
|
f"class {class_name}(AppConfig):\n"
|
@@ -40,10 +41,7 @@ def create_app(app_name):
|
|
40
41
|
)
|
41
42
|
|
42
43
|
with open(f"{app_name}/tests.py", "w") as f:
|
43
|
-
f.write(
|
44
|
-
"from django.test import TestCase\n\n"
|
45
|
-
"# Create your tests here.\n"
|
46
|
-
)
|
44
|
+
f.write("from django.test import TestCase\n\n# Create your tests here.\n")
|
47
45
|
|
48
46
|
print(f"App Django '{app_name}' créée avec succès !")
|
49
47
|
|
@@ -52,3 +50,6 @@ def main():
|
|
52
50
|
print("Usage : django-create-app <nom_app>")
|
53
51
|
else:
|
54
52
|
create_app(sys.argv[1])
|
53
|
+
|
54
|
+
if __name__ == "__main__":
|
55
|
+
main()
|
{parfaite → keita}/apps.py
RENAMED
{keith_django_app_creator-0.2.0.dist-info → keith_django_app_creator-0.3.0.dist-info}/METADATA
RENAMED
@@ -1,9 +1,9 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: keith-django-app-creator
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.3.0
|
4
4
|
Summary: Générateur de structure d'app Django personnalisée
|
5
|
-
Author:
|
6
|
-
Author-email:
|
5
|
+
Author: Keith44
|
6
|
+
Author-email: keitamohamed1432@gmail.com
|
7
7
|
License: MIT
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
9
9
|
Classifier: Framework :: Django
|
@@ -19,7 +19,7 @@ Dynamic: summary
|
|
19
19
|
|
20
20
|
# django-app-creator
|
21
21
|
|
22
|
-
`
|
22
|
+
`django-app-creator` est un outil en ligne de commande qui permet de générer rapidement la structure d'une application Django avec une organisation de fichiers personnalisée.
|
23
23
|
|
24
24
|
## Fonctionnalités
|
25
25
|
|
@@ -35,7 +35,7 @@ Dynamic: summary
|
|
35
35
|
Assurez-vous d’avoir Python 3 et `pip` installés, puis exécutez :
|
36
36
|
|
37
37
|
```bash
|
38
|
-
pip install keith-django-app-creator
|
39
38
|
|
39
|
+
pip install keith-django-app-creator
|
40
40
|
## Utilisation
|
41
41
|
newapp <nom_de_l_app>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
app_creator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
app_creator/cli.py,sha256=ks6Ui1VbGmwM9vjAOR1sV8GGNv-PNLrf5j0d1Nkis5E,1753
|
3
|
+
keita/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
+
keita/admin.py,sha256=suMo4x8I3JBxAFBVIdE-5qnqZ6JAZV0FESABHOSc-vg,63
|
5
|
+
keita/apps.py,sha256=9IvzXtmMUbnCJiQ7FqWh0D2ccMoRBtZQyOyDQBOSTpQ,141
|
6
|
+
keita/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
|
7
|
+
keita/urls.py,sha256=-3_l2Z6oNkP1iaZf5exoCSDxlOh3BAlBoAg9wSLELW8,91
|
8
|
+
keita/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
|
+
keita/models/__init__.py,sha256=0rPVvb48SPpEsn5t9bT3ziS2jeZ31VZ8jhM9I2vI5ws,14
|
10
|
+
keita/views/__init__.py,sha256=3IylRHwsJ1fBLYV0JXkaa8Ai4nAyRGfsFPFBodaHxes,13
|
11
|
+
migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
12
|
+
models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
|
+
views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
14
|
+
keith_django_app_creator-0.3.0.dist-info/METADATA,sha256=czBsKlnhV7sf98Nmzm4FGfl1QvgBRl6q0zFYQ1KD2dM,1296
|
15
|
+
keith_django_app_creator-0.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
16
|
+
keith_django_app_creator-0.3.0.dist-info/entry_points.txt,sha256=-jAIpobaRuBFWCeOJweNVHeiodad73Ry9EJ-TkEp8Pg,51
|
17
|
+
keith_django_app_creator-0.3.0.dist-info/top_level.txt,sha256=fqkyUMAoXs-vdWHGewTkwBaCWwkn-eqmiwQZrpyty08,42
|
18
|
+
keith_django_app_creator-0.3.0.dist-info/RECORD,,
|
@@ -1,18 +0,0 @@
|
|
1
|
-
app_creator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
app_creator/cli.py,sha256=whvGKPq_SaMIwjULfwgOSe9SRwFKr2dV0Y-vEuDksxg,1742
|
3
|
-
migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
-
models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
-
parfaite/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
-
parfaite/admin.py,sha256=suMo4x8I3JBxAFBVIdE-5qnqZ6JAZV0FESABHOSc-vg,63
|
7
|
-
parfaite/apps.py,sha256=GSW-CyPntzjy9_mSwO3TdQWEeOHcF17l9MFRVlJTA5A,147
|
8
|
-
parfaite/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
|
9
|
-
parfaite/urls.py,sha256=-3_l2Z6oNkP1iaZf5exoCSDxlOh3BAlBoAg9wSLELW8,91
|
10
|
-
parfaite/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
|
-
parfaite/models/__init__.py,sha256=0rPVvb48SPpEsn5t9bT3ziS2jeZ31VZ8jhM9I2vI5ws,14
|
12
|
-
parfaite/views/__init__.py,sha256=3IylRHwsJ1fBLYV0JXkaa8Ai4nAyRGfsFPFBodaHxes,13
|
13
|
-
views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
14
|
-
keith_django_app_creator-0.2.0.dist-info/METADATA,sha256=sVfQGBnbYY0T_vpzHK9Pwb0HnbEHjUUJNpkJ9l9RHeE,1264
|
15
|
-
keith_django_app_creator-0.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
16
|
-
keith_django_app_creator-0.2.0.dist-info/entry_points.txt,sha256=dK2S_U_9kTbZWt-m1qw3JCdZrcsJbblg1krP8Ju5fRA,48
|
17
|
-
keith_django_app_creator-0.2.0.dist-info/top_level.txt,sha256=aa3_dy_AaRixnHSLGIPbnlnZ7xGzihS9k-GdkDENKUw,45
|
18
|
-
keith_django_app_creator-0.2.0.dist-info/RECORD,,
|
{parfaite → keita}/__init__.py
RENAMED
File without changes
|
{parfaite → keita}/admin.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{parfaite → keita}/tests.py
RENAMED
File without changes
|
{parfaite → keita}/urls.py
RENAMED
File without changes
|
File without changes
|
File without changes
|