componentsDjangoType 1.0.6__tar.gz → 1.0.8__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {componentsdjangotype-1.0.6/componentsDjangoType.egg-info → componentsdjangotype-1.0.8}/PKG-INFO +1 -1
- {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/componentsDjangoType/management/commands/createApp.py +96 -99
- {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8/componentsDjangoType.egg-info}/PKG-INFO +1 -1
- {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/setup.py +1 -1
- {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/LICENSE +0 -0
- {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/MANIFEST.in +0 -0
- {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/README.md +0 -0
- {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/componentsDjangoType/__init__.py +0 -0
- {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/componentsDjangoType/management/__init__.py +0 -0
- {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/componentsDjangoType/management/commands/__init__.py +0 -0
- {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/componentsDjangoType/management/commands/createcomponent.py +0 -0
- {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/componentsDjangoType.egg-info/SOURCES.txt +0 -0
- {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/componentsDjangoType.egg-info/dependency_links.txt +0 -0
- {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/componentsDjangoType.egg-info/requires.txt +0 -0
- {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/componentsDjangoType.egg-info/top_level.txt +0 -0
- {componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/setup.cfg +0 -0
@@ -11,6 +11,15 @@ class Command(BaseCommand):
|
|
11
11
|
# Nombre de la aplicación a crear
|
12
12
|
app_name = "Home"
|
13
13
|
|
14
|
+
# definiendoerrores
|
15
|
+
def write_file(file_path, content):
|
16
|
+
try:
|
17
|
+
with open(file_path, 'w') as file:
|
18
|
+
file.write(content)
|
19
|
+
print(f"Archivo escrito correctamente: {file_path}")
|
20
|
+
except Exception as e:
|
21
|
+
print(f"Error al escribir el archivo {file_path}: {e}")
|
22
|
+
|
14
23
|
# Paso 1: Solicitar el nombre de la aplicación principal al usuario
|
15
24
|
project_name = input(
|
16
25
|
"Por favor, ingresa el nombre de la aplicación principal del proyecto: ")
|
@@ -177,88 +186,88 @@ class Command(BaseCommand):
|
|
177
186
|
layout_files_path = os.path.join(layouts_dir, 'index.html')
|
178
187
|
|
179
188
|
template_files = {
|
180
|
-
'home.html': """{% extends "layouts/index.html" %}
|
181
|
-
|
182
|
-
|
189
|
+
'home.html': """{% extends "layouts/index.html" %}
|
190
|
+
{% block layout %}
|
191
|
+
{% endblock %}""",
|
183
192
|
'signup.html': """{% extends "layouts/index.html" %}
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
193
|
+
{% block layout %}
|
194
|
+
{% if error %}
|
195
|
+
<div class="alert" id="alert">
|
196
|
+
<div class="alert-content">
|
197
|
+
{{ error }}
|
198
|
+
<button class="close-btn" onclick="closeAlert()">
|
199
|
+
<span class="sr-only">Close</span>
|
200
|
+
<svg class="close-icon" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
201
|
+
<path d="M0.92524 0.687069C1.126 0.486219 1.39823 0.373377 1.68209 0.373377C1.96597 0.373377 2.2382 0.486219 2.43894 0.687069L8.10514 6.35813L13.7714 0.687069C13.8701 0.584748 13.9882 0.503105 14.1188 0.446962C14.2494 0.39082 14.3899 0.361248 14.5321 0.360026C14.6742 0.358783 14.8151 0.38589 14.9468 0.439762C15.0782 0.493633 15.1977 0.573197 15.2983 0.673783C15.3987 0.774389 15.4784 0.894026 15.5321 1.02568C15.5859 1.15736 15.6131 1.29845 15.6118 1.44071C15.6105 1.58297 15.5809 1.72357 15.5248 1.85428C15.4688 1.98499 15.3872 2.10324 15.2851 2.20206L9.61883 7.87312L15.2851 13.5441C15.4801 13.7462 15.588 14.0168 15.5854 14.2977C15.5831 14.5787 15.4705 14.8474 15.272 15.046C15.0735 15.2449 14.805 15.3574 14.5244 15.3599C14.2437 15.3623 13.9733 15.2543 13.7714 15.0591L8.10514 9.38812L2.43894 15.0591C2.23704 15.2543 1.96663 15.3623 1.68594 15.3599C1.40526 15.3574 1.13677 15.2449 0.938279 15.046C0.739807 14.8474 0.627232 14.5787 0.624791 14.2977C0.62235 14.0168 0.730236 13.7462 0.92524 13.5441L6.59144 7.87312L0.92524 2.20206C0.724562 2.00115 0.611816 1.72867 0.611816 1.44457C0.611816 1.16047 0.724562 0.887983 0.92524 0.687069Z" fill="currentColor"/>
|
202
|
+
</svg>
|
203
|
+
</button>
|
204
|
+
</div>
|
205
|
+
</div>
|
206
|
+
{% endif %}\n
|
207
|
+
<div class="form-wrapper">
|
208
|
+
<div class="form-container">
|
209
|
+
<form action="" method="post" class="form-control">
|
210
|
+
{% csrf_token %}
|
211
|
+
<h1>sing up</h1>
|
212
|
+
|
213
|
+
<label for="username">Usuario:</label>
|
214
|
+
{{ form.username }}
|
215
|
+
|
216
|
+
<label for="password1">Contraseña:</label>
|
217
|
+
{{ form.password1 }}
|
218
|
+
|
219
|
+
<label for="password2">Confirmar Contraseña:</label>
|
220
|
+
{{ form.password2 }}
|
221
|
+
|
222
|
+
<button type="submit">sing Up</button>
|
223
|
+
</form>
|
224
|
+
</div>
|
225
|
+
</div>
|
226
|
+
{% endblock %}
|
227
|
+
{% block script %}
|
228
|
+
<script src="{% static 'js/alertErrors.js'%}"></script>
|
229
|
+
{% endblock %}""",
|
221
230
|
'login.html': """{% extends "layouts/index.html" %}
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
231
|
+
{% block layout %}
|
232
|
+
{% if error %}
|
233
|
+
<div class="alert" id="alert">
|
234
|
+
<div class="alert-content">
|
235
|
+
{{ error }}
|
236
|
+
<button class="close-btn" onclick="closeAlert()">
|
237
|
+
<span class="sr-only">Close</span>
|
238
|
+
<svg class="close-icon" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
239
|
+
<path d="M0.92524 0.687069C1.126 0.486219 1.39823 0.373377 1.68209 0.373377C1.96597 0.373377 2.2382 0.486219 2.43894 0.687069L8.10514 6.35813L13.7714 0.687069C13.8701 0.584748 13.9882 0.503105 14.1188 0.446962C14.2494 0.39082 14.3899 0.361248 14.5321 0.360026C14.6742 0.358783 14.8151 0.38589 14.9468 0.439762C15.0782 0.493633 15.1977 0.573197 15.2983 0.673783C15.3987 0.774389 15.4784 0.894026 15.5321 1.02568C15.5859 1.15736 15.6131 1.29845 15.6118 1.44071C15.6105 1.58297 15.5809 1.72357 15.5248 1.85428C15.4688 1.98499 15.3872 2.10324 15.2851 2.20206L9.61883 7.87312L15.2851 13.5441C15.4801 13.7462 15.588 14.0168 15.5854 14.2977C15.5831 14.5787 15.4705 14.8474 15.272 15.046C15.0735 15.2449 14.805 15.3574 14.5244 15.3599C14.2437 15.3623 13.9733 15.2543 13.7714 15.0591L8.10514 9.38812L2.43894 15.0591C2.23704 15.2543 1.96663 15.3623 1.68594 15.3599C1.40526 15.3574 1.13677 15.2449 0.938279 15.046C0.739807 14.8474 0.627232 14.5787 0.624791 14.2977C0.62235 14.0168 0.730236 13.7462 0.92524 13.5441L6.59144 7.87312L0.92524 2.20206C0.724562 2.00115 0.611816 1.72867 0.611816 1.44457C0.611816 1.16047 0.724562 0.887983 0.92524 0.687069Z" fill="currentColor"/>
|
240
|
+
</svg>
|
241
|
+
</button>
|
242
|
+
</div>
|
243
|
+
</div>
|
244
|
+
{% endif %}
|
245
|
+
<div class="form-wrapper">\n
|
246
|
+
<div class="form-container">
|
247
|
+
<form action="" method="post" class="form-control">
|
248
|
+
{% csrf_token %}
|
249
|
+
<h1>Login</h1>
|
250
|
+
|
251
|
+
<label for="username">Usuario:</label>
|
252
|
+
{{ form.username }}
|
253
|
+
|
254
|
+
<label for="password">Contraseña:</label>
|
255
|
+
<input type="password" id="password" name="password" value="{{ form.password2 }}" required>
|
256
|
+
|
257
|
+
<button type="submit">Login</button>
|
258
|
+
</form>
|
259
|
+
</div>
|
260
|
+
</div>
|
261
|
+
{% endblock %}
|
262
|
+
{% block script %}
|
263
|
+
<script src="{% static 'js/alertErrors.js'%}"></script>
|
264
|
+
{% endblock %}""",
|
256
265
|
'logged.html': """{% extends "layouts/index.html" %}
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
266
|
+
{% block layout %}
|
267
|
+
<div class="layout-container">
|
268
|
+
<h1>¡Has iniciado sesión!</h1>
|
269
|
+
</div>
|
270
|
+
{% endblock %}"""
|
262
271
|
}
|
263
272
|
for template_file, content in template_files.items():
|
264
273
|
template_file_path = os.path.join(templates_dir, template_file)
|
@@ -267,25 +276,14 @@ class Command(BaseCommand):
|
|
267
276
|
|
268
277
|
# escritura de los archivos
|
269
278
|
|
270
|
-
# definiendoerrores
|
271
|
-
|
272
|
-
def write_file(file_path, content):
|
273
|
-
try:
|
274
|
-
with open(file_path, 'w') as file:
|
275
|
-
file.write(content)
|
276
|
-
print(f"Archivo escrito correctamente: {file_path}")
|
277
|
-
except Exception as e:
|
278
|
-
print(f"Error al escribir el archivo {file_path}: {e}")
|
279
|
-
|
280
279
|
# escritura del archivos js
|
281
|
-
write_file(js_file_path, """
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
""")
|
280
|
+
write_file(js_file_path, """function closeAlert() {
|
281
|
+
const alert = document.getElementById('alert');
|
282
|
+
if (alert) {
|
283
|
+
alert.remove();
|
284
|
+
}
|
285
|
+
}
|
286
|
+
""")
|
289
287
|
|
290
288
|
# escritura del archivo css
|
291
289
|
write_file(css_file_path, """
|
@@ -503,8 +501,7 @@ button[type="submit"]:hover {
|
|
503
501
|
}
|
504
502
|
""")
|
505
503
|
# escritura del archivos que estan en la carpeta layouts
|
506
|
-
write_file(layout_files_path, """
|
507
|
-
{% load static %}
|
504
|
+
write_file(layout_files_path, """{% load static %}
|
508
505
|
<!DOCTYPE html>
|
509
506
|
<html lang="en">
|
510
507
|
<head>
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/componentsDjangoType.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
{componentsdjangotype-1.0.6 → componentsdjangotype-1.0.8}/componentsDjangoType.egg-info/requires.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|