componentsDjangoType 2.0.22__tar.gz → 2.0.24__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {componentsdjangotype-2.0.22/componentsDjangoType.egg-info → componentsdjangotype-2.0.24}/PKG-INFO +1 -1
- {componentsdjangotype-2.0.22 → componentsdjangotype-2.0.24/componentsDjangoType.egg-info}/PKG-INFO +1 -1
- {componentsdjangotype-2.0.22 → componentsdjangotype-2.0.24}/componentsDjangoType.egg-info/SOURCES.txt +4 -4
- {componentsdjangotype-2.0.22 → componentsdjangotype-2.0.24}/services/authenticator_configurator.py +44 -57
- {componentsdjangotype-2.0.22 → componentsdjangotype-2.0.24}/setup.py +1 -1
- {componentsdjangotype-2.0.22 → componentsdjangotype-2.0.24}/LICENSE +0 -0
- {componentsdjangotype-2.0.22 → componentsdjangotype-2.0.24}/MANIFEST.in +0 -0
- {componentsdjangotype-2.0.22 → componentsdjangotype-2.0.24}/README.md +0 -0
- {componentsdjangotype-2.0.22 → componentsdjangotype-2.0.24}/componentsDjangoType/__init__.py +0 -0
- {componentsdjangotype-2.0.22 → componentsdjangotype-2.0.24}/componentsDjangoType/management/__init__.py +0 -0
- {componentsdjangotype-2.0.22 → componentsdjangotype-2.0.24}/componentsDjangoType/management/commands/__init__.py +0 -0
- {componentsdjangotype-2.0.22 → componentsdjangotype-2.0.24}/componentsDjangoType/management/commands/createApp.py +0 -0
- {componentsdjangotype-2.0.22 → componentsdjangotype-2.0.24}/componentsDjangoType/management/commands/createcomponent.py +0 -0
- {componentsdjangotype-2.0.22 → componentsdjangotype-2.0.24}/componentsDjangoType.egg-info/dependency_links.txt +0 -0
- {componentsdjangotype-2.0.22 → componentsdjangotype-2.0.24}/componentsDjangoType.egg-info/requires.txt +0 -0
- {componentsdjangotype-2.0.22 → componentsdjangotype-2.0.24}/componentsDjangoType.egg-info/top_level.txt +0 -0
- {componentsdjangotype-2.0.22/services/Home → componentsdjangotype-2.0.24/services}/__init__.py +0 -0
- {componentsdjangotype-2.0.22/services → componentsdjangotype-2.0.24/services/authentication}/__init__.py +0 -0
- {componentsdjangotype-2.0.22 → componentsdjangotype-2.0.24}/services/authentication/auth.py +0 -0
- {componentsdjangotype-2.0.22/services/authentication → componentsdjangotype-2.0.24/services/core}/__init__.py +0 -0
- {componentsdjangotype-2.0.22/services/Home → componentsdjangotype-2.0.24/services/core}/urls_page.py +0 -0
- {componentsdjangotype-2.0.22/services/Home → componentsdjangotype-2.0.24/services/core}/views_page.py +0 -0
- {componentsdjangotype-2.0.22 → componentsdjangotype-2.0.24}/setup.cfg +0 -0
@@ -14,8 +14,8 @@ componentsDjangoType/management/commands/createApp.py
|
|
14
14
|
componentsDjangoType/management/commands/createcomponent.py
|
15
15
|
services/__init__.py
|
16
16
|
services/authenticator_configurator.py
|
17
|
-
services/Home/__init__.py
|
18
|
-
services/Home/urls_page.py
|
19
|
-
services/Home/views_page.py
|
20
17
|
services/authentication/__init__.py
|
21
|
-
services/authentication/auth.py
|
18
|
+
services/authentication/auth.py
|
19
|
+
services/core/__init__.py
|
20
|
+
services/core/urls_page.py
|
21
|
+
services/core/views_page.py
|
{componentsdjangotype-2.0.22 → componentsdjangotype-2.0.24}/services/authenticator_configurator.py
RENAMED
@@ -3,7 +3,6 @@ import ast
|
|
3
3
|
from django.core.management.base import BaseCommand
|
4
4
|
from django.core.management import call_command
|
5
5
|
from services.authentication import auth
|
6
|
-
from services.Home import views_page, urls_page
|
7
6
|
|
8
7
|
class DjangoProjectManager:
|
9
8
|
def __init__(self, app_name, project_name):
|
@@ -118,73 +117,61 @@ path('', include('home.urls'))
|
|
118
117
|
stdout.write(f"No fue necesario realizar cambios en '{project_urls_path}'.\n")
|
119
118
|
|
120
119
|
def creation_auth(self, stdout):
|
121
|
-
|
122
|
-
|
123
|
-
os.
|
120
|
+
home_dir = 'Home' # Nombre de la aplicación Home
|
121
|
+
views_path = os.path.join(home_dir, 'views.py')
|
122
|
+
urls_path = os.path.join(home_dir, 'urls.py')
|
124
123
|
|
125
|
-
#
|
126
|
-
|
124
|
+
# Crear el directorio de la aplicación Home si no existe
|
125
|
+
if not os.path.exists(home_dir):
|
126
|
+
os.makedirs(home_dir) # Crear el directorio para la aplicación Home
|
127
|
+
stdout.write(f"Directorio '{home_dir}' creado.\n")
|
128
|
+
else:
|
129
|
+
stdout.write(f"El directorio '{home_dir}' ya existe.\n")
|
127
130
|
|
128
|
-
#
|
129
|
-
|
131
|
+
# Verificar si views.py existe y crearlo si no existe
|
132
|
+
if not os.path.exists(views_path):
|
133
|
+
views_code = '''from django.shortcuts import render
|
134
|
+
from Home.services.authentication import Authentication
|
130
135
|
|
131
|
-
|
132
|
-
|
133
|
-
return
|
136
|
+
def home(request):
|
137
|
+
return render(request, 'home.html')
|
134
138
|
|
135
|
-
|
136
|
-
|
139
|
+
def signup(request):
|
140
|
+
return Authentication.get_signup(request)
|
137
141
|
|
138
|
-
|
139
|
-
|
140
|
-
with open(auth_source_path, 'r') as source_file:
|
141
|
-
auth_code = source_file.read()
|
142
|
+
def signout(request):
|
143
|
+
return Authentication.get_signout(request)
|
142
144
|
|
143
|
-
|
144
|
-
|
145
|
-
dest_file.write(auth_code)
|
145
|
+
def signing(request):
|
146
|
+
return Authentication.get_signing(request)
|
146
147
|
|
147
|
-
|
148
|
-
|
149
|
-
|
148
|
+
def logged(request):
|
149
|
+
return Authentication.get_logged(request)
|
150
|
+
'''
|
151
|
+
with open(views_path, 'w') as views_file:
|
152
|
+
views_file.write(views_code)
|
153
|
+
stdout.write(f"El archivo '{views_path}' ha sido creado.\n")
|
150
154
|
else:
|
151
|
-
stdout.write(f"El archivo '{
|
155
|
+
stdout.write(f"El archivo '{views_path}' ya existe.\n")
|
152
156
|
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
# Crear el directorio si no existe
|
159
|
-
os.makedirs(home_dir, exist_ok=True)
|
157
|
+
# Verificar si urls.py existe y crearlo si no existe
|
158
|
+
if not os.path.exists(urls_path):
|
159
|
+
urls_code = '''from django.urls import path
|
160
|
+
from . import views
|
160
161
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
stdout.write(f"El archivo
|
162
|
+
urlpatterns = [
|
163
|
+
path("", views.home, name='home'),
|
164
|
+
path("signup", views.signup, name='signup'),
|
165
|
+
path("login", views.signing, name='login'),
|
166
|
+
path("logout", views.signout, name='logout'),
|
167
|
+
path("logged", views.logged, name='logged'),
|
168
|
+
]
|
169
|
+
'''
|
170
|
+
with open(urls_path, 'w') as urls_file:
|
171
|
+
urls_file.write(urls_code)
|
172
|
+
stdout.write(f"El archivo '{urls_path}' ha sido creado.\n")
|
172
173
|
else:
|
173
|
-
|
174
|
-
|
175
|
-
def create_file(self, source_path, dest_path, stdout):
|
176
|
-
try:
|
177
|
-
# Leer el contenido del archivo fuente
|
178
|
-
with open(source_path, 'r') as source_file:
|
179
|
-
code = source_file.read()
|
180
|
-
|
181
|
-
# Crear y escribir el contenido en el archivo de destino
|
182
|
-
with open(dest_path, 'w') as dest_file:
|
183
|
-
dest_file.write(code)
|
184
|
-
|
185
|
-
stdout.write(f"El archivo '{dest_path}' fue creado y el código fue copiado.\n")
|
186
|
-
except Exception as e:
|
187
|
-
stdout.write(f"Error al copiar el archivo: {e}\n")
|
174
|
+
stdout.write(f"El archivo '{urls_path}' ya existe.\n")
|
188
175
|
|
189
176
|
|
190
177
|
|
File without changes
|
File without changes
|
File without changes
|
{componentsdjangotype-2.0.22 → componentsdjangotype-2.0.24}/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
|
{componentsdjangotype-2.0.22/services/Home → componentsdjangotype-2.0.24/services}/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{componentsdjangotype-2.0.22/services/Home → componentsdjangotype-2.0.24/services/core}/urls_page.py
RENAMED
File without changes
|
File without changes
|
File without changes
|