Questions tagged as 'django'

1
answer

Save the id of one model as a foreign key of another

I have these 2 models class Persona(models.Model): opciones = [('masculino', 'Masculino'), ('femenino', 'Femenino')] nombre = models.CharField(max_length=30) apellido_paterno = models.CharField(max_length=30) apellido_materno = models.CharFie...
asked by 24.08.2017 / 07:28
1
answer

Problems with URL in Django

I have an application in django that runs perfectly on the test server, but when it comes to deploying with the Mod_WSGI it gives me the following error http://localhost/ingresar?next=/Terry/ The requested URL / enter was not found on this...
asked by 02.03.2018 / 16:16
0
answers

How do I validate my form in a modal window? [closed]

I want to validate my form in a modal window? and tried in several ways I validated the form but when I accept it does not return me to the modal window and the information is sent causing a django error, I want to know if field can be validated...
asked by 26.09.2016 / 16:34
0
answers

The data is not inserted in the DB [closed]

I am working with Django , and I want to insert some values in the database, but they are not inserted and do not emit any errors. From a selected product, I try to show the user a form that shows the selected product, allows you to sel...
asked by 12.07.2016 / 14:30
1
answer

How do I edit a record that already exists in the Django database and does not add another one?

Hi! I've been trying to edit my resgistros in django for some time but instead I add a new one, please someone to help me. This is my editing function: def editarempleado (request, id_empleado): p = Empleados.objects.get(pk=id_empleado)...
asked by 14.09.2016 / 21:07
1
answer

Error saving ForeingKey with Post_save in User profile

I am creating the user profile with post_save signal , but I have a field foreign key that It's not being saved, and I do not see any way to solve it. I did it like this: All this from the django admin.    The error is: 1048, "Column...
asked by 13.10.2016 / 17:22
1
answer

Generate PDF of a post on Django

I have a Blog in wordpress and I'm migrating Django, I have a plugin installed in wordpress that allows you to generate a PDF of a post and I want to pass that functionality to Django. After a lot of searching and several tests, I use djan...
asked by 12.04.2016 / 02:21
0
answers

Customize "prepopulation" in Django admin [closed]

I currently have a field that is automatically filled in by taking the value of two additional fields in order: team 1 and team two. I get the following result with this code within the Administrator class corresponding to the Match model:...
asked by 16.05.2016 / 17:34
1
answer

Second forloop.counter does not print anything on screen

I am building a carousel of images using Foundation Orbit, for the part of the bullets I have an error when using two forloop.counter tags, I need them to print the carousel element number on the screen, one in "Humanized" form and the...
asked by 11.02.2016 / 20:47
1
answer

Access a variable in Django's template having its name in string

{% for x in array%} {% for y in x %} <h1>{{y}}</h1> {% endfor %} {% endfor %} With x in the second for the key of a dictionary whose value is an array, and x in the first for a string...
asked by 03.05.2017 / 10:09