componentsDjangoType 2.1.3__tar.gz → 2.1.5__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {componentsdjangotype-2.1.3/componentsDjangoType.egg-info → componentsdjangotype-2.1.5}/PKG-INFO +1 -1
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5/componentsDjangoType.egg-info}/PKG-INFO +1 -1
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/componentsDjangoType.egg-info/SOURCES.txt +1 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/services/authenticator_configurator.py +14 -3
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/services/copy_source.py +4 -7
- componentsdjangotype-2.1.5/services/utils/__init__.py +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/setup.py +1 -1
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/LICENSE +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/MANIFEST.in +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/README.md +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/componentsDjangoType/__init__.py +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/componentsDjangoType/__pycache__/__init__.cpython-312.pyc +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/componentsDjangoType/management/__init__.py +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/componentsDjangoType/management/__pycache__/__init__.cpython-312.pyc +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/componentsDjangoType/management/commands/__init__.py +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/componentsDjangoType/management/commands/__pycache__/__init__.cpython-312.pyc +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/componentsDjangoType/management/commands/__pycache__/createApp.cpython-312.pyc +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/componentsDjangoType/management/commands/createApp.py +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/componentsDjangoType/management/commands/createcomponent.py +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/componentsDjangoType.egg-info/dependency_links.txt +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/componentsDjangoType.egg-info/requires.txt +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/componentsDjangoType.egg-info/top_level.txt +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/services/__init__.py +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/services/authentication/__init__.py +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/services/authentication/auth.py +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/services/authentication/forms.py +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/services/utils/css/authentication.css +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/services/utils/js/alertErrors.js +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/services/utils/views/home.html +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/services/utils/views/layouts/index.html +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/services/utils/views/logged.html +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/services/utils/views/login.html +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/services/utils/views/signup.html +0 -0
- {componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/setup.cfg +0 -0
{componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/componentsDjangoType.egg-info/SOURCES.txt
RENAMED
@@ -22,6 +22,7 @@ services/copy_source.py
|
|
22
22
|
services/authentication/__init__.py
|
23
23
|
services/authentication/auth.py
|
24
24
|
services/authentication/forms.py
|
25
|
+
services/utils/__init__.py
|
25
26
|
services/utils/css/authentication.css
|
26
27
|
services/utils/js/alertErrors.js
|
27
28
|
services/utils/views/home.html
|
{componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/services/authenticator_configurator.py
RENAMED
@@ -2,6 +2,7 @@ import os
|
|
2
2
|
from django.core.management import call_command
|
3
3
|
from services.authentication import auth, forms
|
4
4
|
from services.copy_source import copy_static_file
|
5
|
+
import importlib.resources as pkg_resources
|
5
6
|
|
6
7
|
class DjangoProjectManager:
|
7
8
|
def __init__(self, app_name, project_name):
|
@@ -259,17 +260,27 @@ urlpatterns = [
|
|
259
260
|
files_to_copy = [
|
260
261
|
("services.utils.js", "alertErrors.js", os.path.join(js_dir, "alertErrors.js")),
|
261
262
|
("services.utils.css", "authentication.css", os.path.join(css_dir, "authentication.css")),
|
262
|
-
("services.utils.css", "
|
263
|
+
("services.utils.css.user", "aside.css", os.path.join(user_dir_css, "aside.css")),
|
263
264
|
("services.utils.views.layouts", "index.html", os.path.join(layouts_dir, "index.html")),
|
264
265
|
("services.utils.views", "home.html", os.path.join(templates_dir, "home.html")),
|
265
266
|
("services.utils.views", "signup.html", os.path.join(templates_dir, "signup.html")),
|
266
267
|
("services.utils.views", "login.html", os.path.join(templates_dir, "login.html")),
|
267
268
|
("services.utils.views", "logged.html", os.path.join(templates_dir, "logged.html")),
|
268
|
-
("services.utils.views", "user
|
269
|
-
("services.utils.views", "
|
269
|
+
("services.utils.views.user", "user.html", os.path.join(user_dir_html, "user.html")),
|
270
|
+
("services.utils.views.components", "aside.html", os.path.join(user_dir_components, "aside.html")),
|
270
271
|
]
|
271
272
|
|
272
273
|
for package, resource_name, destination_path in files_to_copy:
|
273
274
|
copy_static_file(package, resource_name, destination_path, stdout)
|
275
|
+
|
276
|
+
for package, resource_name, destination in files_to_copy:
|
277
|
+
try:
|
278
|
+
available_resources = list(pkg_resources.contents(package))
|
279
|
+
if resource_name in available_resources:
|
280
|
+
print(f"El recurso '{resource_name}' existe en el paquete '{package}'.")
|
281
|
+
else:
|
282
|
+
print(f"El recurso '{resource_name}' no está disponible en el paquete '{package}'.")
|
283
|
+
except Exception as e:
|
284
|
+
print(f"Error al acceder al paquete '{package}': {e}")
|
274
285
|
|
275
286
|
stdout.write("Archivos estáticos copiados.\n")
|
@@ -8,16 +8,11 @@ def copy_static_file(package, resource_name, destination_path, stdout=sys.stdout
|
|
8
8
|
Copia un archivo estático empaquetado a una ruta de destino.
|
9
9
|
|
10
10
|
:param package: El nombre del paquete donde está el recurso.
|
11
|
-
:param resource_name:
|
11
|
+
:param resource_name: Nombre del archivo dentro del paquete.
|
12
12
|
:param destination_path: Ruta completa donde se copiará el archivo.
|
13
13
|
:param stdout: Salida estándar para mensajes (por defecto usa sys.stdout).
|
14
14
|
"""
|
15
15
|
try:
|
16
|
-
# Verifica si el recurso existe en el paquete
|
17
|
-
if not pkg_resources.is_resource(package, resource_name):
|
18
|
-
stdout.write(f"El recurso '{resource_name}' no existe en el paquete '{package}'.\n")
|
19
|
-
return
|
20
|
-
|
21
16
|
# Crear el directorio de destino si no existe
|
22
17
|
os.makedirs(os.path.dirname(destination_path), exist_ok=True)
|
23
18
|
|
@@ -27,5 +22,7 @@ def copy_static_file(package, resource_name, destination_path, stdout=sys.stdout
|
|
27
22
|
shutil.copyfileobj(resource_file, dest_file)
|
28
23
|
|
29
24
|
stdout.write(f"El recurso '{resource_name}' fue copiado a '{destination_path}'.\n")
|
25
|
+
except FileNotFoundError:
|
26
|
+
stdout.write(f"El recurso '{resource_name}' no existe en el paquete '{package}'.\n")
|
30
27
|
except Exception as e:
|
31
|
-
stdout.write(f"Error al copiar el archivo: {e}\n")
|
28
|
+
stdout.write(f"Error al copiar el archivo '{resource_name}': {e}\n")
|
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.1.3 → componentsdjangotype-2.1.5}/componentsDjangoType.egg-info/requires.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
{componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/services/authentication/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/services/utils/css/authentication.css
RENAMED
File without changes
|
File without changes
|
File without changes
|
{componentsdjangotype-2.1.3 → componentsdjangotype-2.1.5}/services/utils/views/layouts/index.html
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|