informatica:linux:django
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| informatica:linux:django [2015/04/18 18:24] – javi | informatica:linux:django [2019/05/19 16:55] (current) – [Activar la interfaz administrativa en app1 y tabla 'Tabla1'] javi | ||
|---|---|---|---|
| Line 101: | Line 101: | ||
| python manage.py runserver 0.0.0.0: | python manage.py runserver 0.0.0.0: | ||
| - | ===== Activar la interfaz administrativa ===== | + | ===== Interfaz administrativa ===== |
| + | |||
| + | Ahora la interfaz administrativa se activa por defecto | ||
| + | |||
| + | ==== Crear superusuario ==== | ||
| + | |||
| + | https:// | ||
| + | |||
| + | ==== (Deprecated) | ||
| 1 | 1 | ||
| Line 127: | Line 135: | ||
| - | ===== Activar la interfaz administrativa en app1 y tabla ' | + | ==== (Deprecated) |
| 2.1 Crear: | 2.1 Crear: | ||
| Line 507: | Line 515: | ||
| } | } | ||
| ... | ... | ||
| + | </ | ||
| + | |||
| + | Flujo habitual para mantener el modelo: | ||
| + | |||
| + | < | ||
| + | 1. Change your models (in **models.py**). | ||
| + | 2. Run **python manage.py makemigrations** to create migrations for those changes | ||
| + | 3. Run **python manage.py migrate** to apply those changes to the database. | ||
| </ | </ | ||
| Line 840: | Line 856: | ||
| Falta el template y el resto de la vista. Es solo un ejemplo | Falta el template y el resto de la vista. Es solo un ejemplo | ||
| + | |||
| + | ===== Errores ===== | ||
| + | |||
| + | ==== The password is too similar to the username. ==== | ||
| + | |||
| + | En realidad no es un error, es solo para documentar un atajo para evitar esta restricción a la hora de especificar una contraseña para un nuevo usuario desde la interfaz gráfica del módulo admin. | ||
| + | |||
| + | https:// | ||
| + | |||
| + | 1. Crear el usuario desde el admin: | ||
| + | |||
| + | http:// | ||
| + | |||
| + | 2. Iniciar shell | ||
| + | |||
| + | cd / | ||
| + | | ||
| + | 3. Cambiar la contraseña de ese usuario, en este ejemplo " | ||
| + | |||
| + | < | ||
| + | from django.contrib.auth.models import User | ||
| + | user = User.objects.get(username=' | ||
| + | user.set_password(' | ||
| + | user.save() | ||
| + | </ | ||
| + | |||
| + | ==== Error al crear app ==== | ||
| + | |||
| + | Comando: | ||
| + | |||
| + | < | ||
| + | python manage.py startapp app1 | ||
| + | </ | ||
| + | |||
| + | Error: | ||
| + | |||
| + | < | ||
| + | File " | ||
| + | ) from exc | ||
| + | ^ | ||
| + | SyntaxError: | ||
| + | </ | ||
| + | |||
| + | Solución: | ||
| + | |||
| + | < | ||
| + | python3 manage.py startapp app1 | ||
| + | </ | ||
informatica/linux/django.1429381464.txt.gz · Last modified: by javi
