componentsDjangoType 2.0.16__tar.gz → 2.0.17__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (20) hide show
  1. {componentsdjangotype-2.0.16/componentsDjangoType.egg-info → componentsdjangotype-2.0.17}/PKG-INFO +1 -1
  2. {componentsdjangotype-2.0.16 → componentsdjangotype-2.0.17/componentsDjangoType.egg-info}/PKG-INFO +1 -1
  3. {componentsdjangotype-2.0.16 → componentsdjangotype-2.0.17}/services/authenticator_configurator.py +17 -16
  4. {componentsdjangotype-2.0.16 → componentsdjangotype-2.0.17}/setup.py +1 -1
  5. {componentsdjangotype-2.0.16 → componentsdjangotype-2.0.17}/LICENSE +0 -0
  6. {componentsdjangotype-2.0.16 → componentsdjangotype-2.0.17}/MANIFEST.in +0 -0
  7. {componentsdjangotype-2.0.16 → componentsdjangotype-2.0.17}/README.md +0 -0
  8. {componentsdjangotype-2.0.16 → componentsdjangotype-2.0.17}/componentsDjangoType/__init__.py +0 -0
  9. {componentsdjangotype-2.0.16 → componentsdjangotype-2.0.17}/componentsDjangoType/management/__init__.py +0 -0
  10. {componentsdjangotype-2.0.16 → componentsdjangotype-2.0.17}/componentsDjangoType/management/commands/__init__.py +0 -0
  11. {componentsdjangotype-2.0.16 → componentsdjangotype-2.0.17}/componentsDjangoType/management/commands/createApp.py +0 -0
  12. {componentsdjangotype-2.0.16 → componentsdjangotype-2.0.17}/componentsDjangoType/management/commands/createcomponent.py +0 -0
  13. {componentsdjangotype-2.0.16 → componentsdjangotype-2.0.17}/componentsDjangoType.egg-info/SOURCES.txt +0 -0
  14. {componentsdjangotype-2.0.16 → componentsdjangotype-2.0.17}/componentsDjangoType.egg-info/dependency_links.txt +0 -0
  15. {componentsdjangotype-2.0.16 → componentsdjangotype-2.0.17}/componentsDjangoType.egg-info/requires.txt +0 -0
  16. {componentsdjangotype-2.0.16 → componentsdjangotype-2.0.17}/componentsDjangoType.egg-info/top_level.txt +0 -0
  17. {componentsdjangotype-2.0.16 → componentsdjangotype-2.0.17}/services/__init__.py +0 -0
  18. {componentsdjangotype-2.0.16 → componentsdjangotype-2.0.17}/services/authentication/__init__.py +0 -0
  19. {componentsdjangotype-2.0.16 → componentsdjangotype-2.0.17}/services/authentication/auth.py +0 -0
  20. {componentsdjangotype-2.0.16 → componentsdjangotype-2.0.17}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: componentsDjangoType
3
- Version: 2.0.16
3
+ Version: 2.0.17
4
4
  Summary: Comandos para crear archivos html, css y js
5
5
  Home-page: https://github.com/jose-CR/componentsDjangoType
6
6
  Author: Alejandro
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: componentsDjangoType
3
- Version: 2.0.16
3
+ Version: 2.0.17
4
4
  Summary: Comandos para crear archivos html, css y js
5
5
  Home-page: https://github.com/jose-CR/componentsDjangoType
6
6
  Author: Alejandro
@@ -47,7 +47,7 @@ class DjangoProjectManager:
47
47
  # Comprobar si la aplicación no está ya en INSTALLED_APPS
48
48
  if f"'{self.app_name}'" not in installed_apps_content:
49
49
  # Insertar la aplicación dentro de la lista
50
- new_installed_apps = installed_apps_content[:-1] + f" '{self.app_name}',\n]"
50
+ new_installed_apps = installed_apps_content[:-1] + f" '{self.app_name}',\n]"
51
51
 
52
52
  # Reemplazar el bloque INSTALLED_APPS con la nueva lista
53
53
  new_settings_content = settings_content[:installed_apps_start] + new_installed_apps + settings_content[installed_apps_end:]
@@ -73,28 +73,23 @@ class DjangoProjectManager:
73
73
  stdout.write(f"Creando el archivo '{project_urls_path}'...")
74
74
  with open(project_urls_path, 'w') as f:
75
75
  f.write("""from django.contrib import admin
76
- from django.urls import path, include\n\n
76
+ from django.urls import path, include # Asegúrate de incluir include
77
+
77
78
  urlpatterns = [
78
- path('admin/', admin.site.urls),
79
- path('', include('home.urls')),
79
+ path('admin/', admin.site.urls),
80
+ path('', include('home.urls'))
80
81
  # Añade tus rutas aquí
81
- ]\n""")
82
+ ]
83
+ """)
82
84
  else:
83
- # Si el archivo ya existe, lo leemos y agregamos nuevas rutas
85
+ # Leer el contenido actual del archivo
84
86
  stdout.write(f"El archivo '{project_urls_path}' ya existe. Verificando contenido...")
85
-
86
87
  with open(project_urls_path, 'r') as f:
87
88
  urls_content = f.read()
88
89
 
89
90
  updated = False
90
91
 
91
- # Verificar si 'urlpatterns' existe
92
- if 'urlpatterns = [' not in urls_content:
93
- stdout.write(f"No se encontró 'urlpatterns'. Creando la lista de rutas desde cero.")
94
- urls_content += "\nurlpatterns = [\n path('admin/', admin.site.urls),\n]\n"
95
- updated = True
96
-
97
- # Agregar 'include' si no está presente
92
+ # Verificar o agregar el import de 'include'
98
93
  if 'include' not in urls_content:
99
94
  stdout.write("Agregando 'include' a los imports.")
100
95
  urls_content = urls_content.replace(
@@ -103,7 +98,13 @@ urlpatterns = [
103
98
  )
104
99
  updated = True
105
100
 
106
- # Agregar la ruta para 'home.urls' si no existe
101
+ # Verificar o agregar la lista urlpatterns
102
+ if 'urlpatterns = [' not in urls_content:
103
+ stdout.write("No se encontró 'urlpatterns'. Creando la lista de rutas desde cero.")
104
+ urls_content += "\nurlpatterns = [\n path('admin/', admin.site.urls),\n]\n"
105
+ updated = True
106
+
107
+ # Verificar o agregar la ruta para 'home.urls'
107
108
  if "include('home.urls')" not in urls_content:
108
109
  stdout.write("Agregando ruta para 'home.urls'.")
109
110
  urls_content = urls_content.replace(
@@ -112,7 +113,7 @@ urlpatterns = [
112
113
  )
113
114
  updated = True
114
115
 
115
- # Escribir de nuevo el archivo si hubo cambios
116
+ # Escribir los cambios si se modificó algo
116
117
  if updated:
117
118
  with open(project_urls_path, 'w') as f:
118
119
  f.write(urls_content)
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='componentsDjangoType',
5
- version='2.0.16',
5
+ version='2.0.17',
6
6
  packages=find_packages(),
7
7
  include_package_data=True,
8
8
  license='MIT',