componentsDjangoType 2.0.30__tar.gz → 2.0.32__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {componentsdjangotype-2.0.30/componentsDjangoType.egg-info → componentsdjangotype-2.0.32}/PKG-INFO +1 -1
- {componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32/componentsDjangoType.egg-info}/PKG-INFO +1 -1
- {componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32}/services/authenticator_configurator.py +46 -36
- {componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32}/setup.py +1 -1
- {componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32}/LICENSE +0 -0
- {componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32}/MANIFEST.in +0 -0
- {componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32}/README.md +0 -0
- {componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32}/componentsDjangoType/__init__.py +0 -0
- {componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32}/componentsDjangoType/__pycache__/__init__.cpython-312.pyc +0 -0
- {componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32}/componentsDjangoType/management/__init__.py +0 -0
- {componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32}/componentsDjangoType/management/__pycache__/__init__.cpython-312.pyc +0 -0
- {componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32}/componentsDjangoType/management/commands/__init__.py +0 -0
- {componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32}/componentsDjangoType/management/commands/__pycache__/__init__.cpython-312.pyc +0 -0
- {componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32}/componentsDjangoType/management/commands/__pycache__/createApp.cpython-312.pyc +0 -0
- {componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32}/componentsDjangoType/management/commands/createApp.py +0 -0
- {componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32}/componentsDjangoType/management/commands/createcomponent.py +0 -0
- {componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32}/componentsDjangoType.egg-info/SOURCES.txt +0 -0
- {componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32}/componentsDjangoType.egg-info/dependency_links.txt +0 -0
- {componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32}/componentsDjangoType.egg-info/requires.txt +0 -0
- {componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32}/componentsDjangoType.egg-info/top_level.txt +0 -0
- {componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32}/services/__init__.py +0 -0
- {componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32}/services/authentication/__init__.py +0 -0
- {componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32}/services/authentication/auth.py +0 -0
- {componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32}/setup.cfg +0 -0
{componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32}/services/authenticator_configurator.py
RENAMED
@@ -89,31 +89,44 @@ path('', include('home.urls'))
|
|
89
89
|
|
90
90
|
updated = False
|
91
91
|
|
92
|
-
# Verificar si
|
93
|
-
if "include('Home.urls')" not in urls_content:
|
94
|
-
stdout.write("
|
95
|
-
|
96
|
-
#
|
97
|
-
urls_content =
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
92
|
+
# Verificar si el archivo ya incluye 'include' y 'Home.urls'
|
93
|
+
if "include('Home.urls')" not in urls_content or "from django.urls import include" not in urls_content:
|
94
|
+
stdout.write("Actualizando el archivo 'urls.py' para incluir 'Home.urls'.\n")
|
95
|
+
|
96
|
+
# Sobrescribir el contenido del archivo con la estructura deseada
|
97
|
+
urls_content = '''"""
|
98
|
+
URL configuration for myproject project.
|
99
|
+
|
100
|
+
The `urlpatterns` list routes URLs to views. For more information please see:
|
101
|
+
https://docs.djangoproject.com/en/5.1/topics/http/urls/
|
102
|
+
Examples:
|
103
|
+
Function views
|
104
|
+
1. Add an import: from my_app import views
|
105
|
+
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
106
|
+
Class-based views
|
107
|
+
1. Add an import: from other_app.views import Home
|
108
|
+
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
109
|
+
Including another URLconf
|
110
|
+
1. Import the include() function: from django.urls import include, path
|
111
|
+
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
112
|
+
"""
|
113
|
+
from django.contrib import admin
|
114
|
+
from django.urls import path, include # Asegúrate de incluir include
|
115
|
+
|
116
|
+
urlpatterns = [
|
117
|
+
path('admin/', admin.site.urls),
|
118
|
+
path('', include('Home.urls')),
|
119
|
+
]
|
120
|
+
'''
|
108
121
|
updated = True
|
109
122
|
|
110
|
-
#
|
123
|
+
# Sobrescribir el archivo solo si se actualizó algo
|
111
124
|
if updated:
|
112
125
|
with open(project_urls_path, 'w') as f:
|
113
126
|
f.write(urls_content)
|
114
|
-
stdout.write(f"El archivo '{project_urls_path}'
|
127
|
+
stdout.write(f"El archivo '{project_urls_path}' ha sido actualizado.\n")
|
115
128
|
else:
|
116
|
-
stdout.write(f"No
|
129
|
+
stdout.write(f"No se realizaron cambios en '{project_urls_path}'.\n")
|
117
130
|
|
118
131
|
def creation_auth(self, stdout):
|
119
132
|
services_dir = os.path.join(self.app_name, 'services')
|
@@ -121,7 +134,7 @@ path('', include('home.urls'))
|
|
121
134
|
os.makedirs(authentication_dir, exist_ok=True)
|
122
135
|
|
123
136
|
# Ruta para el nuevo archivo a crear
|
124
|
-
authentication_path = os.path.join(authentication_dir, '
|
137
|
+
authentication_path = os.path.join(authentication_dir, 'auth.py')
|
125
138
|
|
126
139
|
# Usar el atributo __file__ del módulo 'auth' para obtener la ruta del archivo fuente
|
127
140
|
auth_source_path = os.path.abspath(auth.__file__)
|
@@ -160,10 +173,9 @@ path('', include('home.urls'))
|
|
160
173
|
else:
|
161
174
|
stdout.write(f"El directorio '{home_dir}' ya existe.\n")
|
162
175
|
|
163
|
-
#
|
164
|
-
|
165
|
-
|
166
|
-
from Home.services.authentication import Authentication
|
176
|
+
# Sobrescribir o crear el archivo views.py
|
177
|
+
views_code = '''from django.shortcuts import render
|
178
|
+
from services.authentication.auth import Authentication
|
167
179
|
|
168
180
|
def home(request):
|
169
181
|
return render(request, 'home.html')
|
@@ -179,12 +191,10 @@ def signing(request):
|
|
179
191
|
|
180
192
|
def logged(request):
|
181
193
|
return Authentication.get_logged(request)
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
else:
|
187
|
-
stdout.write(f"El archivo '{views_path}' ya existe.\n")
|
194
|
+
'''
|
195
|
+
with open(views_path, 'w') as views_file: # Abrir en modo escritura siempre
|
196
|
+
views_file.write(views_code)
|
197
|
+
stdout.write(f"El archivo '{views_path}' ha sido creado o sobrescrito.\n")
|
188
198
|
|
189
199
|
# Verificar si urls.py existe y crearlo si no existe
|
190
200
|
if not os.path.exists(urls_path):
|
@@ -192,13 +202,13 @@ def logged(request):
|
|
192
202
|
from . import views
|
193
203
|
|
194
204
|
urlpatterns = [
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
205
|
+
path("", views.home, name='home'),
|
206
|
+
path("signup", views.signup, name='signup'),
|
207
|
+
path("login", views.signing, name='login'),
|
208
|
+
path("logout", views.signout, name='logout'),
|
209
|
+
path("logged", views.logged, name='logged'),
|
200
210
|
]
|
201
|
-
|
211
|
+
'''
|
202
212
|
with open(urls_path, 'w') as urls_file:
|
203
213
|
urls_file.write(urls_code)
|
204
214
|
stdout.write(f"El archivo '{urls_path}' ha sido creado.\n")
|
File without changes
|
File without changes
|
File without changes
|
{componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32}/componentsDjangoType/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{componentsdjangotype-2.0.30 → componentsdjangotype-2.0.32}/services/authentication/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|