componentsDjangoType 1.0.9__tar.gz → 1.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-1.0.9/componentsDjangoType.egg-info → componentsdjangotype-1.0.10}/PKG-INFO +1 -1
- {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/componentsDjangoType/management/commands/createApp.py +71 -1
- {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10/componentsDjangoType.egg-info}/PKG-INFO +1 -1
- {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/setup.py +1 -1
- {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/LICENSE +0 -0
- {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/MANIFEST.in +0 -0
- {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/README.md +0 -0
- {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/componentsDjangoType/__init__.py +0 -0
- {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/componentsDjangoType/management/__init__.py +0 -0
- {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/componentsDjangoType/management/commands/__init__.py +0 -0
- {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/componentsDjangoType/management/commands/createcomponent.py +0 -0
- {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/componentsDjangoType.egg-info/SOURCES.txt +0 -0
- {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/componentsDjangoType.egg-info/dependency_links.txt +0 -0
- {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/componentsDjangoType.egg-info/requires.txt +0 -0
- {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/componentsDjangoType.egg-info/top_level.txt +0 -0
- {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/setup.cfg +0 -0
@@ -161,7 +161,77 @@ class Command(BaseCommand):
|
|
161
161
|
self.stdout.write(
|
162
162
|
f"El archivo '{authentication_file_path}' ya existe.")
|
163
163
|
|
164
|
-
|
164
|
+
home_dir = "Home"
|
165
|
+
|
166
|
+
def modify_views_and_urls():
|
167
|
+
# Rutas de los archivos
|
168
|
+
views_path = os.path.join(home_dir, 'views.py')
|
169
|
+
urls_path = os.path.join(home_dir, 'urls.py')
|
170
|
+
|
171
|
+
# Contenido de views.py
|
172
|
+
views_content = """from django.shortcuts import render
|
173
|
+
from django.contrib.auth.decorators import login_required
|
174
|
+
from Home.services.authentication import Authentication
|
175
|
+
|
176
|
+
# Create your views here.
|
177
|
+
|
178
|
+
def home(request):
|
179
|
+
return render(request, 'home.html')
|
180
|
+
|
181
|
+
|
182
|
+
def signup(request):
|
183
|
+
return Authentication.get_signup(request)
|
184
|
+
|
185
|
+
|
186
|
+
def signout(request):
|
187
|
+
return Authentication.get_signout(request)
|
188
|
+
|
189
|
+
|
190
|
+
def signing(request):
|
191
|
+
return Authentication.get_signing(request)
|
192
|
+
|
193
|
+
|
194
|
+
@login_required
|
195
|
+
def logged(request):
|
196
|
+
return Authentication.get_logged(request)
|
197
|
+
|
198
|
+
|
199
|
+
def custom_dispatch(request, *args, **kwargs):
|
200
|
+
return Authentication.dispatch(request, *args, **kwargs)
|
201
|
+
"""
|
202
|
+
|
203
|
+
# Contenido de urls.py
|
204
|
+
urls_content = """from django.urls import path
|
205
|
+
from . import views
|
206
|
+
|
207
|
+
urlpatterns = [
|
208
|
+
path("", views.home, name='home'),
|
209
|
+
path("signup", views.signup, name='signup'),
|
210
|
+
path("login", views.signing, name='login'),
|
211
|
+
path("logout", views.signout, name='logout'),
|
212
|
+
path("logged", views.logged, name='logged'),
|
213
|
+
]
|
214
|
+
"""
|
215
|
+
|
216
|
+
# Escritura de views.py
|
217
|
+
try:
|
218
|
+
with open(views_path, 'w') as views_file:
|
219
|
+
views_file.write(views_content.strip())
|
220
|
+
print(f"Archivo modificado correctamente: {views_path}")
|
221
|
+
except Exception as e:
|
222
|
+
print(f"Error al modificar {views_path}: {e}")
|
223
|
+
|
224
|
+
# Escritura de urls.py
|
225
|
+
try:
|
226
|
+
with open(urls_path, 'w') as urls_file:
|
227
|
+
urls_file.write(urls_content.strip())
|
228
|
+
print(f"Archivo modificado correctamente: {urls_path}")
|
229
|
+
except Exception as e:
|
230
|
+
print(f"Error al modificar {urls_path}: {e}")
|
231
|
+
|
232
|
+
modify_views_and_urls()
|
233
|
+
|
234
|
+
# Paso 8: Crear la carpeta templates y estatic y los archivos HTML CSS y JS
|
165
235
|
templates_dir = os.path.join(app_name, 'templates')
|
166
236
|
static_dir = os.path.join(app_name, 'static')
|
167
237
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/componentsDjangoType.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|