componentsDjangoType 2.1.4__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.4/componentsDjangoType.egg-info → componentsdjangotype-2.1.5}/PKG-INFO +1 -1
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5/componentsDjangoType.egg-info}/PKG-INFO +1 -1
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/componentsDjangoType.egg-info/SOURCES.txt +1 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/services/authenticator_configurator.py +17 -4
- componentsdjangotype-2.1.5/services/copy_source.py +28 -0
- componentsdjangotype-2.1.5/services/utils/__init__.py +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/setup.py +1 -1
- componentsdjangotype-2.1.4/services/copy_source.py +0 -36
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/LICENSE +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/MANIFEST.in +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/README.md +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/componentsDjangoType/__init__.py +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/componentsDjangoType/__pycache__/__init__.cpython-312.pyc +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/componentsDjangoType/management/__init__.py +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/componentsDjangoType/management/__pycache__/__init__.cpython-312.pyc +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/componentsDjangoType/management/commands/__init__.py +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/componentsDjangoType/management/commands/__pycache__/__init__.cpython-312.pyc +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/componentsDjangoType/management/commands/__pycache__/createApp.cpython-312.pyc +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/componentsDjangoType/management/commands/createApp.py +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/componentsDjangoType/management/commands/createcomponent.py +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/componentsDjangoType.egg-info/dependency_links.txt +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/componentsDjangoType.egg-info/requires.txt +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/componentsDjangoType.egg-info/top_level.txt +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/services/__init__.py +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/services/authentication/__init__.py +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/services/authentication/auth.py +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/services/authentication/forms.py +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/services/utils/css/authentication.css +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/services/utils/js/alertErrors.js +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/services/utils/views/home.html +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/services/utils/views/layouts/index.html +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/services/utils/views/logged.html +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/services/utils/views/login.html +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/services/utils/views/signup.html +0 -0
- {componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/setup.cfg +0 -0
{componentsdjangotype-2.1.4 → 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.4 → 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,15 +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.user", "", user_dir_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
|
-
("services.utils.views", "", templates_dir),
|
266
|
-
("services.utils.views
|
267
|
-
("services.utils.views
|
266
|
+
("services.utils.views", "signup.html", os.path.join(templates_dir, "signup.html")),
|
267
|
+
("services.utils.views", "login.html", os.path.join(templates_dir, "login.html")),
|
268
|
+
("services.utils.views", "logged.html", os.path.join(templates_dir, "logged.html")),
|
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")),
|
268
271
|
]
|
269
272
|
|
270
273
|
for package, resource_name, destination_path in files_to_copy:
|
271
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}")
|
272
285
|
|
273
286
|
stdout.write("Archivos estáticos copiados.\n")
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import importlib.resources as pkg_resources
|
2
|
+
import shutil
|
3
|
+
import os
|
4
|
+
import sys
|
5
|
+
|
6
|
+
def copy_static_file(package, resource_name, destination_path, stdout=sys.stdout):
|
7
|
+
"""
|
8
|
+
Copia un archivo estático empaquetado a una ruta de destino.
|
9
|
+
|
10
|
+
:param package: El nombre del paquete donde está el recurso.
|
11
|
+
:param resource_name: Nombre del archivo dentro del paquete.
|
12
|
+
:param destination_path: Ruta completa donde se copiará el archivo.
|
13
|
+
:param stdout: Salida estándar para mensajes (por defecto usa sys.stdout).
|
14
|
+
"""
|
15
|
+
try:
|
16
|
+
# Crear el directorio de destino si no existe
|
17
|
+
os.makedirs(os.path.dirname(destination_path), exist_ok=True)
|
18
|
+
|
19
|
+
# Leer el archivo desde el paquete y escribirlo en la ruta destino
|
20
|
+
with pkg_resources.open_binary(package, resource_name) as resource_file:
|
21
|
+
with open(destination_path, 'wb') as dest_file:
|
22
|
+
shutil.copyfileobj(resource_file, dest_file)
|
23
|
+
|
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")
|
27
|
+
except Exception as e:
|
28
|
+
stdout.write(f"Error al copiar el archivo '{resource_name}': {e}\n")
|
File without changes
|
@@ -1,36 +0,0 @@
|
|
1
|
-
import importlib.resources as pkg_resources
|
2
|
-
import shutil
|
3
|
-
import os
|
4
|
-
import sys
|
5
|
-
|
6
|
-
def copy_static_file(package, resource_name, destination_path, stdout=sys.stdout):
|
7
|
-
"""
|
8
|
-
Copia un archivo estático empaquetado a una ruta de destino.
|
9
|
-
|
10
|
-
:param package: El nombre del paquete donde está el recurso.
|
11
|
-
:param resource_name: Ruta relativa del recurso dentro del paquete (puede ser un archivo o un directorio).
|
12
|
-
:param destination_path: Ruta completa donde se copiará el archivo o estructura.
|
13
|
-
:param stdout: Salida estándar para mensajes (por defecto usa sys.stdout).
|
14
|
-
"""
|
15
|
-
try:
|
16
|
-
# Si el recurso es un directorio, recorre sus contenidos
|
17
|
-
if pkg_resources.is_resource(package, resource_name) or not resource_name:
|
18
|
-
os.makedirs(destination_path, exist_ok=True) # Asegura que el directorio exista
|
19
|
-
for resource in pkg_resources.contents(package):
|
20
|
-
resource_path = os.path.join(resource_name, resource) if resource_name else resource
|
21
|
-
dest_path = os.path.join(destination_path, resource)
|
22
|
-
copy_static_file(package, resource_path, dest_path, stdout)
|
23
|
-
else:
|
24
|
-
# Es un archivo; cópialo directamente
|
25
|
-
if not pkg_resources.is_resource(package, resource_name):
|
26
|
-
stdout.write(f"El recurso '{resource_name}' no existe en el paquete '{package}'.\n")
|
27
|
-
return
|
28
|
-
|
29
|
-
os.makedirs(os.path.dirname(destination_path), exist_ok=True) # Asegura el directorio
|
30
|
-
with pkg_resources.open_binary(package, resource_name) as resource_file:
|
31
|
-
with open(destination_path, 'wb') as dest_file:
|
32
|
-
shutil.copyfileobj(resource_file, dest_file)
|
33
|
-
|
34
|
-
stdout.write(f"El recurso '{resource_name}' fue copiado a '{destination_path}'.\n")
|
35
|
-
except Exception as e:
|
36
|
-
stdout.write(f"Error al copiar el recurso '{resource_name}' desde '{package}': {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
|
{componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/componentsDjangoType.egg-info/requires.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
{componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/services/authentication/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{componentsdjangotype-2.1.4 → componentsdjangotype-2.1.5}/services/utils/css/authentication.css
RENAMED
File without changes
|
File without changes
|
File without changes
|
{componentsdjangotype-2.1.4 → 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
|