componentsDjangoType 1.0.9__tar.gz → 1.0.10__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (16) hide show
  1. {componentsdjangotype-1.0.9/componentsDjangoType.egg-info → componentsdjangotype-1.0.10}/PKG-INFO +1 -1
  2. {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/componentsDjangoType/management/commands/createApp.py +71 -1
  3. {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10/componentsDjangoType.egg-info}/PKG-INFO +1 -1
  4. {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/setup.py +1 -1
  5. {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/LICENSE +0 -0
  6. {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/MANIFEST.in +0 -0
  7. {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/README.md +0 -0
  8. {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/componentsDjangoType/__init__.py +0 -0
  9. {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/componentsDjangoType/management/__init__.py +0 -0
  10. {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/componentsDjangoType/management/commands/__init__.py +0 -0
  11. {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/componentsDjangoType/management/commands/createcomponent.py +0 -0
  12. {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/componentsDjangoType.egg-info/SOURCES.txt +0 -0
  13. {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/componentsDjangoType.egg-info/dependency_links.txt +0 -0
  14. {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/componentsDjangoType.egg-info/requires.txt +0 -0
  15. {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/componentsDjangoType.egg-info/top_level.txt +0 -0
  16. {componentsdjangotype-1.0.9 → componentsdjangotype-1.0.10}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: componentsDjangoType
3
- Version: 1.0.9
3
+ Version: 1.0.10
4
4
  Summary: A Django app for creating HTML components
5
5
  Home-page: https://github.com/jose-CR/componentsDjangoType
6
6
  Author: Alejandro
@@ -161,7 +161,77 @@ class Command(BaseCommand):
161
161
  self.stdout.write(
162
162
  f"El archivo '{authentication_file_path}' ya existe.")
163
163
 
164
- # Paso 6: Crear la carpeta templates y estatic y los archivos HTML CSS y JS
164
+ home_dir = "Home"
165
+
166
+ def modify_views_and_urls():
167
+ # Rutas de los archivos
168
+ views_path = os.path.join(home_dir, 'views.py')
169
+ urls_path = os.path.join(home_dir, 'urls.py')
170
+
171
+ # Contenido de views.py
172
+ views_content = """from django.shortcuts import render
173
+ from django.contrib.auth.decorators import login_required
174
+ from Home.services.authentication import Authentication
175
+
176
+ # Create your views here.
177
+
178
+ def home(request):
179
+ return render(request, 'home.html')
180
+
181
+
182
+ def signup(request):
183
+ return Authentication.get_signup(request)
184
+
185
+
186
+ def signout(request):
187
+ return Authentication.get_signout(request)
188
+
189
+
190
+ def signing(request):
191
+ return Authentication.get_signing(request)
192
+
193
+
194
+ @login_required
195
+ def logged(request):
196
+ return Authentication.get_logged(request)
197
+
198
+
199
+ def custom_dispatch(request, *args, **kwargs):
200
+ return Authentication.dispatch(request, *args, **kwargs)
201
+ """
202
+
203
+ # Contenido de urls.py
204
+ urls_content = """from django.urls import path
205
+ from . import views
206
+
207
+ urlpatterns = [
208
+ path("", views.home, name='home'),
209
+ path("signup", views.signup, name='signup'),
210
+ path("login", views.signing, name='login'),
211
+ path("logout", views.signout, name='logout'),
212
+ path("logged", views.logged, name='logged'),
213
+ ]
214
+ """
215
+
216
+ # Escritura de views.py
217
+ try:
218
+ with open(views_path, 'w') as views_file:
219
+ views_file.write(views_content.strip())
220
+ print(f"Archivo modificado correctamente: {views_path}")
221
+ except Exception as e:
222
+ print(f"Error al modificar {views_path}: {e}")
223
+
224
+ # Escritura de urls.py
225
+ try:
226
+ with open(urls_path, 'w') as urls_file:
227
+ urls_file.write(urls_content.strip())
228
+ print(f"Archivo modificado correctamente: {urls_path}")
229
+ except Exception as e:
230
+ print(f"Error al modificar {urls_path}: {e}")
231
+
232
+ modify_views_and_urls()
233
+
234
+ # Paso 8: Crear la carpeta templates y estatic y los archivos HTML CSS y JS
165
235
  templates_dir = os.path.join(app_name, 'templates')
166
236
  static_dir = os.path.join(app_name, 'static')
167
237
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: componentsDjangoType
3
- Version: 1.0.9
3
+ Version: 1.0.10
4
4
  Summary: A Django app for creating HTML components
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='1.0.9',
5
+ version='1.0.10',
6
6
  packages=find_packages(),
7
7
  include_package_data=True,
8
8
  license='MIT',