create-app-savane 0.1.2__py3-none-any.whl → 0.2.1__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.
- create_app/cli.py +52 -0
- create_app_savane-0.2.1.dist-info/METADATA +121 -0
- create_app_savane-0.2.1.dist-info/RECORD +15 -0
- create_app_savane-0.2.1.dist-info/entry_points.txt +2 -0
- create_app_savane-0.2.1.dist-info/top_level.txt +2 -0
- momo/__init__.py +0 -0
- momo/admin.py +3 -0
- momo/apps.py +5 -0
- momo/migrations/__init__.py +0 -0
- momo/models/__init__.py +1 -0
- momo/tests.py +3 -0
- momo/urls.py +5 -0
- momo/views/__init__.py +1 -0
- create_app_savane-0.1.2.dist-info/METADATA +0 -18
- create_app_savane-0.1.2.dist-info/RECORD +0 -10
- create_app_savane-0.1.2.dist-info/entry_points.txt +0 -2
- create_app_savane-0.1.2.dist-info/top_level.txt +0 -1
- packages/asgi.py +0 -16
- packages/settings.py +0 -122
- packages/urls.py +0 -22
- packages/wsgi.py +0 -16
- {packages → create_app}/__init__.py +0 -0
- {create_app_savane-0.1.2.dist-info → create_app_savane-0.2.1.dist-info}/WHEEL +0 -0
create_app/cli.py
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
import os
|
2
|
+
import sys
|
3
|
+
|
4
|
+
def create_app(app_name):
|
5
|
+
os.makedirs(app_name, exist_ok=True)
|
6
|
+
os.makedirs(f"{app_name}/models", exist_ok=True)
|
7
|
+
os.makedirs(f"{app_name}/views", exist_ok=True)
|
8
|
+
os.makedirs(f"{app_name}/migrations", exist_ok=True)
|
9
|
+
|
10
|
+
# Fichiers de base
|
11
|
+
with open(f"{app_name}/migrations/__init__.py", "w"): pass
|
12
|
+
with open(f"{app_name}/__init__.py", "w"): pass
|
13
|
+
|
14
|
+
with open(f"{app_name}/models/__init__.py", "w") as f:
|
15
|
+
f.write("# models here\n")
|
16
|
+
|
17
|
+
with open(f"{app_name}/views/__init__.py", "w") as f:
|
18
|
+
f.write("# views here\n")
|
19
|
+
|
20
|
+
with open(f"{app_name}/urls.py", "w") as f:
|
21
|
+
f.write(
|
22
|
+
"from django.urls import path\n\n"
|
23
|
+
"urlpatterns = [\n"
|
24
|
+
" # path('', views.index, name='index'),\n"
|
25
|
+
"]\n"
|
26
|
+
)
|
27
|
+
|
28
|
+
with open(f"{app_name}/admin.py", "w") as f:
|
29
|
+
f.write("from django.contrib import admin\n\n# Register your models here.\n")
|
30
|
+
|
31
|
+
with open(f"{app_name}/apps.py", "w") as f:
|
32
|
+
class_name = app_name.capitalize() + "Config"
|
33
|
+
f.write(
|
34
|
+
"from django.apps import AppConfig\n\n"
|
35
|
+
f"class {class_name}(AppConfig):\n"
|
36
|
+
f" default_auto_field = 'django.db.models.BigAutoField'\n"
|
37
|
+
f" name = '{app_name}'\n"
|
38
|
+
)
|
39
|
+
|
40
|
+
with open(f"{app_name}/tests.py", "w") as f:
|
41
|
+
f.write(
|
42
|
+
"from django.test import TestCase\n\n"
|
43
|
+
"# Create your tests here.\n"
|
44
|
+
)
|
45
|
+
|
46
|
+
print(f"App Django '{app_name}' créée avec succès !")
|
47
|
+
|
48
|
+
def main():
|
49
|
+
if len(sys.argv) < 2:
|
50
|
+
print("Usage : create-app <nom_app>")
|
51
|
+
else:
|
52
|
+
create_app(sys.argv[1])
|
@@ -0,0 +1,121 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: create-app-savane
|
3
|
+
Version: 0.2.1
|
4
|
+
Summary: Générateur de structure d'app Django personnalisée
|
5
|
+
Author: SAVANE Mouhamed
|
6
|
+
Author-email: savanemouhamed05@gmail.com
|
7
|
+
License: MIT
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
9
|
+
Classifier: Framework :: Django
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
11
|
+
Classifier: Operating System :: OS Independent
|
12
|
+
Classifier: Intended Audience :: Developers
|
13
|
+
Classifier: Topic :: Software Development :: Code Generators
|
14
|
+
Requires-Python: >=3.6
|
15
|
+
Description-Content-Type: text/markdown
|
16
|
+
Dynamic: author
|
17
|
+
Dynamic: author-email
|
18
|
+
Dynamic: classifier
|
19
|
+
Dynamic: description
|
20
|
+
Dynamic: description-content-type
|
21
|
+
Dynamic: license
|
22
|
+
Dynamic: requires-python
|
23
|
+
Dynamic: summary
|
24
|
+
|
25
|
+
# create-app-savane
|
26
|
+
|
27
|
+
**create-app-savane** est un générateur d’application Django personnalisée, conçu pour créer rapidement une structure claire, modulaire et professionnelle d’app Django, avec les bons dossiers et fichiers dès le départ.
|
28
|
+
|
29
|
+
---
|
30
|
+
|
31
|
+
## ✨ Fonctionnalités
|
32
|
+
|
33
|
+
- Génère une app Django prête à l’emploi
|
34
|
+
- Crée des dossiers `models/` et `views/` au lieu des fichiers `models.py` et `views.py`
|
35
|
+
- Crée automatiquement :
|
36
|
+
- `urls.py`
|
37
|
+
- `admin.py`
|
38
|
+
- `apps.py`
|
39
|
+
- `tests.py`
|
40
|
+
- le dossier `migrations/` avec son `__init__.py`
|
41
|
+
- Fonctionne avec n’importe quel projet Django
|
42
|
+
|
43
|
+
---
|
44
|
+
|
45
|
+
## 📦 Installation
|
46
|
+
|
47
|
+
Pour installer ce package depuis PyPI :
|
48
|
+
|
49
|
+
```bash
|
50
|
+
pip install create-app-savane
|
51
|
+
|
52
|
+
## Utilisation
|
53
|
+
|
54
|
+
Une fois installé, utilisez la commande suivante pour créer une nouvelle application Django :
|
55
|
+
|
56
|
+
create-app nom_de_mon_app
|
57
|
+
|
58
|
+
|
59
|
+
## Exemple
|
60
|
+
|
61
|
+
create-app blog
|
62
|
+
|
63
|
+
|
64
|
+
Cela va générer un dossier blog/ avec la structure suivante :
|
65
|
+
|
66
|
+
blog/
|
67
|
+
├── __init__.py
|
68
|
+
├── admin.py
|
69
|
+
├── apps.py
|
70
|
+
├── migrations/
|
71
|
+
│ └── __init__.py
|
72
|
+
├── models/
|
73
|
+
│ └── __init__.py
|
74
|
+
├── views/
|
75
|
+
│ └── __init__.py
|
76
|
+
├── urls.py
|
77
|
+
└── tests.py
|
78
|
+
|
79
|
+
|
80
|
+
## 🧠 Comment ça fonctionne ?
|
81
|
+
|
82
|
+
La commande create-app :
|
83
|
+
|
84
|
+
Crée un dossier portant le nom de l’application.
|
85
|
+
Génère les sous-dossiers models/, views/, migrations/ (avec leurs __init__.py respectifs).
|
86
|
+
Crée les fichiers essentiels à une app Django : admin.py, apps.py, tests.py, urls.py.
|
87
|
+
Prépare une app prête à être intégrée dans un projet Django existant.
|
88
|
+
|
89
|
+
|
90
|
+
## 🔧 Intégration dans un projet Django
|
91
|
+
|
92
|
+
Voici un exemple d'utilisation :
|
93
|
+
|
94
|
+
django-admin startproject monprojet
|
95
|
+
cd monprojet
|
96
|
+
create-app boutique
|
97
|
+
|
98
|
+
Puis, dans monprojet/settings.py, ajoute 'boutique' à la liste INSTALLED_APPS :
|
99
|
+
|
100
|
+
INSTALLED_APPS = [
|
101
|
+
...
|
102
|
+
'boutique',
|
103
|
+
]
|
104
|
+
|
105
|
+
|
106
|
+
## ✅ Avantages
|
107
|
+
|
108
|
+
Gagnez du temps à chaque création d'application Django
|
109
|
+
Structure claire et modulaire
|
110
|
+
Prêt pour des projets évolutifs ou en équipe
|
111
|
+
🧑💻 Auteur
|
112
|
+
|
113
|
+
SAVANE Mouhamed
|
114
|
+
📧 savanemouhamed05@gmail.com
|
115
|
+
🛠️ Licence : MIT
|
116
|
+
🌍 Côte d’Ivoire
|
117
|
+
|
118
|
+
📚 Exigences
|
119
|
+
|
120
|
+
Python ≥ 3.6
|
121
|
+
Django ≥ 3.2 recommandé
|
@@ -0,0 +1,15 @@
|
|
1
|
+
create_app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
create_app/cli.py,sha256=f9no8DJfliX9CdyjPTlBGZJGcCCnjufXlPURY6wFXms,1649
|
3
|
+
momo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
+
momo/admin.py,sha256=suMo4x8I3JBxAFBVIdE-5qnqZ6JAZV0FESABHOSc-vg,63
|
5
|
+
momo/apps.py,sha256=se_JwTrw8oTn0lZZT9w0jEWs74iOWeb843TJ99k891I,139
|
6
|
+
momo/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
|
7
|
+
momo/urls.py,sha256=-3_l2Z6oNkP1iaZf5exoCSDxlOh3BAlBoAg9wSLELW8,91
|
8
|
+
momo/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
|
+
momo/models/__init__.py,sha256=0rPVvb48SPpEsn5t9bT3ziS2jeZ31VZ8jhM9I2vI5ws,14
|
10
|
+
momo/views/__init__.py,sha256=3IylRHwsJ1fBLYV0JXkaa8Ai4nAyRGfsFPFBodaHxes,13
|
11
|
+
create_app_savane-0.2.1.dist-info/METADATA,sha256=pzI0h1b8dl8oxdT29hQ6A3bCHQYaKjKeLt40v98Ex4E,2887
|
12
|
+
create_app_savane-0.2.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
13
|
+
create_app_savane-0.2.1.dist-info/entry_points.txt,sha256=zY8i1Nx6Kg5fM1CXlNpMxS62P8vaYT7j6TaaDbvkj94,51
|
14
|
+
create_app_savane-0.2.1.dist-info/top_level.txt,sha256=_B53rSQjJvLcf3Vmu3Zq5GDCdy7Ya1OADa5qUj-uMpw,16
|
15
|
+
create_app_savane-0.2.1.dist-info/RECORD,,
|
momo/__init__.py
ADDED
File without changes
|
momo/admin.py
ADDED
momo/apps.py
ADDED
File without changes
|
momo/models/__init__.py
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# models here
|
momo/tests.py
ADDED
momo/urls.py
ADDED
momo/views/__init__.py
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# views here
|
@@ -1,18 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: create_app_savane
|
3
|
-
Version: 0.1.2
|
4
|
-
Summary: Create Django apps with folders for views and models
|
5
|
-
Author: SAVANE Mouhamed
|
6
|
-
Author-email: savanemouhamed05@gmail.com
|
7
|
-
Classifier: Programming Language :: Python :: 3
|
8
|
-
Classifier: Framework :: Django
|
9
|
-
Classifier: License :: OSI Approved :: MIT License
|
10
|
-
Classifier: Operating System :: OS Independent
|
11
|
-
Requires-Python: >=3.7
|
12
|
-
Requires-Dist: Django>=4.0
|
13
|
-
Dynamic: author
|
14
|
-
Dynamic: author-email
|
15
|
-
Dynamic: classifier
|
16
|
-
Dynamic: requires-dist
|
17
|
-
Dynamic: requires-python
|
18
|
-
Dynamic: summary
|
@@ -1,10 +0,0 @@
|
|
1
|
-
packages/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
packages/asgi.py,sha256=dauy5u5ovWXFgqlprWVZqem7Q6GFL-_PIn29Cdvgvvs,393
|
3
|
-
packages/settings.py,sha256=Ui7cJ3PFzn29hd-LgIzMKWXQogrTQgkUriPFDewAqss,3167
|
4
|
-
packages/urls.py,sha256=mZOtWlMoVXmHEtQoJdPxpkQhXj6xGRLGo-u3nU_WRb4,764
|
5
|
-
packages/wsgi.py,sha256=zt3K1dOxaGuZmzyqLktMdOPhlxcUq22n-LWYHf9clBc,393
|
6
|
-
create_app_savane-0.1.2.dist-info/METADATA,sha256=BjAnY1ZvVJUnaU8cW-OrOV9xaWuGiOAyo_YWgXgfYyo,539
|
7
|
-
create_app_savane-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
8
|
-
create_app_savane-0.1.2.dist-info/entry_points.txt,sha256=E7s_5qne7QQZqWY-O8bFqESkEBgMPTThOvubSDMdDWA,75
|
9
|
-
create_app_savane-0.1.2.dist-info/top_level.txt,sha256=KlHxfoENEXdJ6vF3m8uvAis67kLBNoPQkFKHOFVIVlM,9
|
10
|
-
create_app_savane-0.1.2.dist-info/RECORD,,
|
@@ -1 +0,0 @@
|
|
1
|
-
packages
|
packages/asgi.py
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
ASGI config for packages project.
|
3
|
-
|
4
|
-
It exposes the ASGI callable as a module-level variable named ``application``.
|
5
|
-
|
6
|
-
For more information on this file, see
|
7
|
-
https://docs.djangoproject.com/en/5.2/howto/deployment/asgi/
|
8
|
-
"""
|
9
|
-
|
10
|
-
import os
|
11
|
-
|
12
|
-
from django.core.asgi import get_asgi_application
|
13
|
-
|
14
|
-
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'packages.settings')
|
15
|
-
|
16
|
-
application = get_asgi_application()
|
packages/settings.py
DELETED
@@ -1,122 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
Django settings for packages project.
|
3
|
-
|
4
|
-
Generated by 'django-admin startproject' using Django 5.2.4.
|
5
|
-
|
6
|
-
For more information on this file, see
|
7
|
-
https://docs.djangoproject.com/en/5.2/topics/settings/
|
8
|
-
|
9
|
-
For the full list of settings and their values, see
|
10
|
-
https://docs.djangoproject.com/en/5.2/ref/settings/
|
11
|
-
"""
|
12
|
-
|
13
|
-
from pathlib import Path
|
14
|
-
|
15
|
-
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
16
|
-
BASE_DIR = Path(__file__).resolve().parent.parent
|
17
|
-
|
18
|
-
|
19
|
-
# Quick-start development settings - unsuitable for production
|
20
|
-
# See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/
|
21
|
-
|
22
|
-
# SECURITY WARNING: keep the secret key used in production secret!
|
23
|
-
SECRET_KEY = 'django-insecure-nu&m*e^=o0no#e$!@z(c@(%&w(83vyc3n0=m_win1xc5_-wtq$'
|
24
|
-
|
25
|
-
# SECURITY WARNING: don't run with debug turned on in production!
|
26
|
-
DEBUG = True
|
27
|
-
|
28
|
-
ALLOWED_HOSTS = []
|
29
|
-
|
30
|
-
|
31
|
-
# Application definition
|
32
|
-
|
33
|
-
INSTALLED_APPS = [
|
34
|
-
'django.contrib.admin',
|
35
|
-
'django.contrib.auth',
|
36
|
-
'django.contrib.contenttypes',
|
37
|
-
'django.contrib.sessions',
|
38
|
-
'django.contrib.messages',
|
39
|
-
'django.contrib.staticfiles',
|
40
|
-
]
|
41
|
-
|
42
|
-
MIDDLEWARE = [
|
43
|
-
'django.middleware.security.SecurityMiddleware',
|
44
|
-
'django.contrib.sessions.middleware.SessionMiddleware',
|
45
|
-
'django.middleware.common.CommonMiddleware',
|
46
|
-
'django.middleware.csrf.CsrfViewMiddleware',
|
47
|
-
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
48
|
-
'django.contrib.messages.middleware.MessageMiddleware',
|
49
|
-
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
50
|
-
]
|
51
|
-
|
52
|
-
ROOT_URLCONF = 'packages.urls'
|
53
|
-
|
54
|
-
TEMPLATES = [
|
55
|
-
{
|
56
|
-
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
57
|
-
'DIRS': [],
|
58
|
-
'APP_DIRS': True,
|
59
|
-
'OPTIONS': {
|
60
|
-
'context_processors': [
|
61
|
-
'django.template.context_processors.request',
|
62
|
-
'django.contrib.auth.context_processors.auth',
|
63
|
-
'django.contrib.messages.context_processors.messages',
|
64
|
-
],
|
65
|
-
},
|
66
|
-
},
|
67
|
-
]
|
68
|
-
|
69
|
-
WSGI_APPLICATION = 'packages.wsgi.application'
|
70
|
-
|
71
|
-
|
72
|
-
# Database
|
73
|
-
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
|
74
|
-
|
75
|
-
DATABASES = {
|
76
|
-
'default': {
|
77
|
-
'ENGINE': 'django.db.backends.sqlite3',
|
78
|
-
'NAME': BASE_DIR / 'db.sqlite3',
|
79
|
-
}
|
80
|
-
}
|
81
|
-
|
82
|
-
|
83
|
-
# Password validation
|
84
|
-
# https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators
|
85
|
-
|
86
|
-
AUTH_PASSWORD_VALIDATORS = [
|
87
|
-
{
|
88
|
-
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
89
|
-
},
|
90
|
-
{
|
91
|
-
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
92
|
-
},
|
93
|
-
{
|
94
|
-
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
95
|
-
},
|
96
|
-
{
|
97
|
-
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
98
|
-
},
|
99
|
-
]
|
100
|
-
|
101
|
-
|
102
|
-
# Internationalization
|
103
|
-
# https://docs.djangoproject.com/en/5.2/topics/i18n/
|
104
|
-
|
105
|
-
LANGUAGE_CODE = 'en-us'
|
106
|
-
|
107
|
-
TIME_ZONE = 'UTC'
|
108
|
-
|
109
|
-
USE_I18N = True
|
110
|
-
|
111
|
-
USE_TZ = True
|
112
|
-
|
113
|
-
|
114
|
-
# Static files (CSS, JavaScript, Images)
|
115
|
-
# https://docs.djangoproject.com/en/5.2/howto/static-files/
|
116
|
-
|
117
|
-
STATIC_URL = 'static/'
|
118
|
-
|
119
|
-
# Default primary key field type
|
120
|
-
# https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field
|
121
|
-
|
122
|
-
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
packages/urls.py
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
URL configuration for packages project.
|
3
|
-
|
4
|
-
The `urlpatterns` list routes URLs to views. For more information please see:
|
5
|
-
https://docs.djangoproject.com/en/5.2/topics/http/urls/
|
6
|
-
Examples:
|
7
|
-
Function views
|
8
|
-
1. Add an import: from my_app import views
|
9
|
-
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
10
|
-
Class-based views
|
11
|
-
1. Add an import: from other_app.views import Home
|
12
|
-
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
13
|
-
Including another URLconf
|
14
|
-
1. Import the include() function: from django.urls import include, path
|
15
|
-
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
16
|
-
"""
|
17
|
-
from django.contrib import admin
|
18
|
-
from django.urls import path
|
19
|
-
|
20
|
-
urlpatterns = [
|
21
|
-
path('admin/', admin.site.urls),
|
22
|
-
]
|
packages/wsgi.py
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
WSGI config for packages project.
|
3
|
-
|
4
|
-
It exposes the WSGI callable as a module-level variable named ``application``.
|
5
|
-
|
6
|
-
For more information on this file, see
|
7
|
-
https://docs.djangoproject.com/en/5.2/howto/deployment/wsgi/
|
8
|
-
"""
|
9
|
-
|
10
|
-
import os
|
11
|
-
|
12
|
-
from django.core.wsgi import get_wsgi_application
|
13
|
-
|
14
|
-
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'packages.settings')
|
15
|
-
|
16
|
-
application = get_wsgi_application()
|
File without changes
|
File without changes
|