componentsDjangoType 2.0.31__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.31/componentsDjangoType.egg-info → componentsdjangotype-2.0.32}/PKG-INFO +1 -1
- {componentsdjangotype-2.0.31 → componentsdjangotype-2.0.32/componentsDjangoType.egg-info}/PKG-INFO +1 -1
- {componentsdjangotype-2.0.31 → componentsdjangotype-2.0.32}/services/authenticator_configurator.py +34 -21
- {componentsdjangotype-2.0.31 → componentsdjangotype-2.0.32}/setup.py +1 -1
- {componentsdjangotype-2.0.31 → componentsdjangotype-2.0.32}/LICENSE +0 -0
- {componentsdjangotype-2.0.31 → componentsdjangotype-2.0.32}/MANIFEST.in +0 -0
- {componentsdjangotype-2.0.31 → componentsdjangotype-2.0.32}/README.md +0 -0
- {componentsdjangotype-2.0.31 → componentsdjangotype-2.0.32}/componentsDjangoType/__init__.py +0 -0
- {componentsdjangotype-2.0.31 → componentsdjangotype-2.0.32}/componentsDjangoType/__pycache__/__init__.cpython-312.pyc +0 -0
- {componentsdjangotype-2.0.31 → componentsdjangotype-2.0.32}/componentsDjangoType/management/__init__.py +0 -0
- {componentsdjangotype-2.0.31 → componentsdjangotype-2.0.32}/componentsDjangoType/management/__pycache__/__init__.cpython-312.pyc +0 -0
- {componentsdjangotype-2.0.31 → componentsdjangotype-2.0.32}/componentsDjangoType/management/commands/__init__.py +0 -0
- {componentsdjangotype-2.0.31 → componentsdjangotype-2.0.32}/componentsDjangoType/management/commands/__pycache__/__init__.cpython-312.pyc +0 -0
- {componentsdjangotype-2.0.31 → componentsdjangotype-2.0.32}/componentsDjangoType/management/commands/__pycache__/createApp.cpython-312.pyc +0 -0
- {componentsdjangotype-2.0.31 → componentsdjangotype-2.0.32}/componentsDjangoType/management/commands/createApp.py +0 -0
- {componentsdjangotype-2.0.31 → componentsdjangotype-2.0.32}/componentsDjangoType/management/commands/createcomponent.py +0 -0
- {componentsdjangotype-2.0.31 → componentsdjangotype-2.0.32}/componentsDjangoType.egg-info/SOURCES.txt +0 -0
- {componentsdjangotype-2.0.31 → componentsdjangotype-2.0.32}/componentsDjangoType.egg-info/dependency_links.txt +0 -0
- {componentsdjangotype-2.0.31 → componentsdjangotype-2.0.32}/componentsDjangoType.egg-info/requires.txt +0 -0
- {componentsdjangotype-2.0.31 → componentsdjangotype-2.0.32}/componentsDjangoType.egg-info/top_level.txt +0 -0
- {componentsdjangotype-2.0.31 → componentsdjangotype-2.0.32}/services/__init__.py +0 -0
- {componentsdjangotype-2.0.31 → componentsdjangotype-2.0.32}/services/authentication/__init__.py +0 -0
- {componentsdjangotype-2.0.31 → componentsdjangotype-2.0.32}/services/authentication/auth.py +0 -0
- {componentsdjangotype-2.0.31 → componentsdjangotype-2.0.32}/setup.cfg +0 -0
{componentsdjangotype-2.0.31 → 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__)
|
@@ -162,7 +175,7 @@ path('', include('home.urls'))
|
|
162
175
|
|
163
176
|
# Sobrescribir o crear el archivo views.py
|
164
177
|
views_code = '''from django.shortcuts import render
|
165
|
-
from
|
178
|
+
from services.authentication.auth import Authentication
|
166
179
|
|
167
180
|
def home(request):
|
168
181
|
return render(request, 'home.html')
|
File without changes
|
File without changes
|
File without changes
|
{componentsdjangotype-2.0.31 → 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.31 → componentsdjangotype-2.0.32}/services/authentication/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|