componentsDjangoType 2.0.8__tar.gz → 2.0.10__tar.gz
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.
- {componentsdjangotype-2.0.8/componentsDjangoType.egg-info → componentsdjangotype-2.0.10}/PKG-INFO +1 -1
- {componentsdjangotype-2.0.8 → componentsdjangotype-2.0.10}/componentsDjangoType/management/commands/createApp.py +0 -1
- {componentsdjangotype-2.0.8 → componentsdjangotype-2.0.10/componentsDjangoType.egg-info}/PKG-INFO +1 -1
- {componentsdjangotype-2.0.8 → componentsdjangotype-2.0.10}/services/authenticator_configurator.py +23 -23
- {componentsdjangotype-2.0.8 → componentsdjangotype-2.0.10}/setup.py +1 -1
- {componentsdjangotype-2.0.8 → componentsdjangotype-2.0.10}/LICENSE +0 -0
- {componentsdjangotype-2.0.8 → componentsdjangotype-2.0.10}/MANIFEST.in +0 -0
- {componentsdjangotype-2.0.8 → componentsdjangotype-2.0.10}/README.md +0 -0
- {componentsdjangotype-2.0.8 → componentsdjangotype-2.0.10}/componentsDjangoType/__init__.py +0 -0
- {componentsdjangotype-2.0.8 → componentsdjangotype-2.0.10}/componentsDjangoType/management/__init__.py +0 -0
- {componentsdjangotype-2.0.8 → componentsdjangotype-2.0.10}/componentsDjangoType/management/commands/__init__.py +0 -0
- {componentsdjangotype-2.0.8 → componentsdjangotype-2.0.10}/componentsDjangoType/management/commands/createcomponent.py +0 -0
- {componentsdjangotype-2.0.8 → componentsdjangotype-2.0.10}/componentsDjangoType.egg-info/SOURCES.txt +0 -0
- {componentsdjangotype-2.0.8 → componentsdjangotype-2.0.10}/componentsDjangoType.egg-info/dependency_links.txt +0 -0
- {componentsdjangotype-2.0.8 → componentsdjangotype-2.0.10}/componentsDjangoType.egg-info/requires.txt +0 -0
- {componentsdjangotype-2.0.8 → componentsdjangotype-2.0.10}/componentsDjangoType.egg-info/top_level.txt +0 -0
- {componentsdjangotype-2.0.8 → componentsdjangotype-2.0.10}/services/__init__.py +0 -0
- {componentsdjangotype-2.0.8 → componentsdjangotype-2.0.10}/services/authentication/__init__.py +0 -0
- {componentsdjangotype-2.0.8 → componentsdjangotype-2.0.10}/services/authentication/auth.py +0 -0
- {componentsdjangotype-2.0.8 → componentsdjangotype-2.0.10}/setup.cfg +0 -0
{componentsdjangotype-2.0.8 → componentsdjangotype-2.0.10}/services/authenticator_configurator.py
RENAMED
@@ -46,7 +46,7 @@ class DjangoProjectManager:
|
|
46
46
|
# Comprobar si la aplicación no está ya en INSTALLED_APPS
|
47
47
|
if f"'{self.app_name}'" not in installed_apps_content:
|
48
48
|
# Insertar la aplicación dentro de la lista
|
49
|
-
new_installed_apps = installed_apps_content[:-1] + f"
|
49
|
+
new_installed_apps = installed_apps_content[:-1] + f"'{self.app_name}',\n]"
|
50
50
|
|
51
51
|
# Reemplazar el bloque INSTALLED_APPS con la nueva lista
|
52
52
|
new_settings_content = settings_content[:installed_apps_start] + new_installed_apps + settings_content[installed_apps_end:]
|
@@ -61,7 +61,7 @@ class DjangoProjectManager:
|
|
61
61
|
else:
|
62
62
|
print(f"'{self.app_name}' ya está en INSTALLED_APPS.")
|
63
63
|
|
64
|
-
def create_urls(self):
|
64
|
+
def create_urls(self, stdout):
|
65
65
|
"""
|
66
66
|
Crea el archivo 'urls.py' si no existe, y si existe, agrega nuevas rutas
|
67
67
|
sin sobrescribir el contenido existente.
|
@@ -70,7 +70,7 @@ class DjangoProjectManager:
|
|
70
70
|
|
71
71
|
if not os.path.exists(urls_path):
|
72
72
|
# Si el archivo no existe, lo creamos con un contenido básico
|
73
|
-
|
73
|
+
stdout.write(f"Creando el archivo '{urls_path}'...")
|
74
74
|
with open(urls_path, 'w') as f:
|
75
75
|
f.write("""from django.contrib import admin
|
76
76
|
from django.urls import path, include\n\n
|
@@ -82,7 +82,7 @@ urlpatterns = [
|
|
82
82
|
]\n""")
|
83
83
|
else:
|
84
84
|
# Si el archivo ya existe, lo leemos y agregamos nuevas rutas
|
85
|
-
|
85
|
+
stdout.write(f"El archivo '{urls_path}' ya existe. Agregando nuevas rutas...")
|
86
86
|
|
87
87
|
with open(urls_path, 'r') as f:
|
88
88
|
urls_content = f.read()
|
@@ -111,33 +111,33 @@ urlpatterns = [
|
|
111
111
|
# Escribir el contenido actualizado en el archivo
|
112
112
|
with open(urls_path, 'w') as f:
|
113
113
|
f.write(urls_content)
|
114
|
-
|
114
|
+
stdout.write(f"Nuevas rutas fueron agregadas a '{urls_path}'.")
|
115
115
|
else:
|
116
|
-
|
116
|
+
stdout.write(f"No se encontró la lista 'urlpatterns' en '{urls_path}'.")
|
117
117
|
|
118
|
-
def creation_auth(self):
|
119
|
-
|
120
|
-
|
121
|
-
|
118
|
+
def creation_auth(self, stdout):
|
119
|
+
services_dir = os.path.join(self.app_name, 'services')
|
120
|
+
authentication_dir = os.path.join(services_dir, 'authentication')
|
121
|
+
os.makedirs(authentication_dir, exist_ok=True)
|
122
122
|
|
123
|
-
|
123
|
+
authentication_path = os.path.join(authentication_dir, 'auth.py')
|
124
124
|
|
125
|
-
|
126
|
-
|
125
|
+
if not os.path.exists(authentication_path):
|
126
|
+
stdout.write(f"Creando el archivo '{authentication_path}'...")
|
127
127
|
|
128
|
-
|
128
|
+
auth_path = os.path.join(self.app_name, 'services', 'authentication', 'auth.py')
|
129
129
|
|
130
|
-
|
131
|
-
|
132
|
-
|
130
|
+
# Leer el código del archivo de origen
|
131
|
+
with open(auth_path, 'r') as file:
|
132
|
+
auth_code = file.read()
|
133
133
|
|
134
|
-
|
135
|
-
|
136
|
-
|
134
|
+
# Escribir el código en el archivo de destino
|
135
|
+
with open(authentication_path, 'w') as file:
|
136
|
+
file.write(auth_code)
|
137
137
|
|
138
|
-
|
139
|
-
|
140
|
-
|
138
|
+
stdout.write(f"El archivo '{authentication_path}' fue creado y el código fue escrito.")
|
139
|
+
else:
|
140
|
+
stdout.write(f"El archivo '{authentication_path}' ya existe.")
|
141
141
|
|
142
142
|
|
143
143
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{componentsdjangotype-2.0.8 → componentsdjangotype-2.0.10}/componentsDjangoType.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{componentsdjangotype-2.0.8 → componentsdjangotype-2.0.10}/services/authentication/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|