componentsDjangoType 2.0.1__tar.gz → 2.0.2__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.
Files changed (16) hide show
  1. {componentsdjangotype-2.0.1/componentsDjangoType.egg-info → componentsdjangotype-2.0.2}/PKG-INFO +1 -1
  2. {componentsdjangotype-2.0.1 → componentsdjangotype-2.0.2}/componentsDjangoType/management/commands/createApp.py +19 -0
  3. {componentsdjangotype-2.0.1 → componentsdjangotype-2.0.2/componentsDjangoType.egg-info}/PKG-INFO +1 -1
  4. {componentsdjangotype-2.0.1 → componentsdjangotype-2.0.2}/setup.py +1 -1
  5. {componentsdjangotype-2.0.1 → componentsdjangotype-2.0.2}/LICENSE +0 -0
  6. {componentsdjangotype-2.0.1 → componentsdjangotype-2.0.2}/MANIFEST.in +0 -0
  7. {componentsdjangotype-2.0.1 → componentsdjangotype-2.0.2}/README.md +0 -0
  8. {componentsdjangotype-2.0.1 → componentsdjangotype-2.0.2}/componentsDjangoType/__init__.py +0 -0
  9. {componentsdjangotype-2.0.1 → componentsdjangotype-2.0.2}/componentsDjangoType/management/__init__.py +0 -0
  10. {componentsdjangotype-2.0.1 → componentsdjangotype-2.0.2}/componentsDjangoType/management/commands/__init__.py +0 -0
  11. {componentsdjangotype-2.0.1 → componentsdjangotype-2.0.2}/componentsDjangoType/management/commands/createcomponent.py +0 -0
  12. {componentsdjangotype-2.0.1 → componentsdjangotype-2.0.2}/componentsDjangoType.egg-info/SOURCES.txt +0 -0
  13. {componentsdjangotype-2.0.1 → componentsdjangotype-2.0.2}/componentsDjangoType.egg-info/dependency_links.txt +0 -0
  14. {componentsdjangotype-2.0.1 → componentsdjangotype-2.0.2}/componentsDjangoType.egg-info/requires.txt +0 -0
  15. {componentsdjangotype-2.0.1 → componentsdjangotype-2.0.2}/componentsDjangoType.egg-info/top_level.txt +0 -0
  16. {componentsdjangotype-2.0.1 → componentsdjangotype-2.0.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: componentsDjangoType
3
- Version: 2.0.1
3
+ Version: 2.0.2
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
@@ -28,9 +28,28 @@ class Command(BaseCommand):
28
28
  if not os.path.exists(app_name):
29
29
  self.stdout.write(f"Creando la aplicación '{app_name}'...")
30
30
  call_command('startapp', app_name)
31
+ if os.path.exists(app_name):
32
+ self.stdout.write(f"La aplicación '{
33
+ app_name}' fue creada exitosamente.")
34
+ else:
35
+ self.stdout.write(
36
+ f"Error: No se pudo crear la aplicación '{app_name}'.")
31
37
  else:
32
38
  self.stdout.write(f"La aplicación '{app_name}' ya existe.")
33
39
 
40
+ # Agregar automáticamente 'Home' a INSTALLED_APPS
41
+ settings_path = os.path.join(project_name, 'settings.py')
42
+
43
+ with open(settings_path, 'r') as file:
44
+ settings_content = file.read()
45
+
46
+ if f"'{app_name}'" not in settings_content:
47
+ with open(settings_path, 'a') as file:
48
+ file.write(f"\nINSTALLED_APPS.append('{app_name}')\n")
49
+ self.stdout.write(f"'{app_name}' fue agregado a INSTALLED_APPS.")
50
+ else:
51
+ self.stdout.write(f"'{app_name}' ya está en INSTALLED_APPS.")
52
+
34
53
  # Paso 3: Crear el archivo urls.py en la aplicación "Home" si no existe
35
54
  urls_path = os.path.join(app_name, 'urls.py')
36
55
  if not os.path.exists(urls_path):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: componentsDjangoType
3
- Version: 2.0.1
3
+ Version: 2.0.2
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
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='componentsDjangoType',
5
- version='2.0.1',
5
+ version='2.0.2',
6
6
  packages=find_packages(),
7
7
  include_package_data=True,
8
8
  license='MIT',