Questions tagged as 'django'

1
answer

How to look at two models at the same time

I have the following models: class Videos(models.Model): title = models.CharField(max_length=45) class TimelinePoints(models.Model): description = models.CharField(max_length=45) videos_id = models.ForeignKey('Videos', models.DO_N...
asked by 26.03.2017 / 22:55
2
answers

Embed PDF with Django

Good afternoon in my application users can upload PDF files, whose route is stored in the user model. Now my question is what plugin I recommend to be able to embed and visualize these PDF files in a template. I've been trying with Google Doc...
asked by 29.05.2017 / 19:50
1
answer

Something is wrong with a Django model

You see, I have created a model which is used to link a comment to a user. This is the code models.py: class mensajeria(models.Model): texto=RichTextField(max_length=300) usuario=models.OneToOneField(User) def __srt__(self):...
asked by 26.05.2017 / 13:14
2
answers

Display information according to the logged in user, ListView class? - Django

models.py class Torneo(models.Model): user = models.ForeignKey(User) descripcion = models.CharField(max_length=200) def __str__(self): return (self.descripcion) views.py class Torneo_ListView(ListView): template_...
asked by 31.03.2017 / 23:47
1
answer

How to show text in Select list of Form EN django type 'placeholder'

I would like to add a default text to the select list as well as the 'placeholder' of a TextInput, but I do not get it, here in the form I have the widgets: 'specialty': forms.Select (attrs = {'class': 'form-control', 'placeholder': 'select y...
asked by 22.02.2017 / 14:57
2
answers

Count selected elements of a select box with javascript

Greetings, I have a select box (id_encuentros) and I need to know how many elements have been selected to restrict it, that is, if you have selected more than one option, then I would show you an alert message. Does anyone know how to do it i...
asked by 20.02.2017 / 18:17
1
answer

Error Django: Page not found (404)

I can not make my form url work in django. Error description:    Using the URLconf defined in django1_project.urls, Django tried these URL patterns, in this order:   1. ^ admin /   2. ^ pet ^ $ [name = 'index']   3. ^ pet ^ new $ [name = '...
asked by 20.03.2017 / 15:54
2
answers

Help with: NoReverseMatch at!

help with this error: Reverse for 'pedido_sub' with arguments '()' and keyword arguments '{'cod_experto': 'AA-0002', 'id_pedido': 53}' not found. 1 pattern(s) tried: ['solicitar/aprobar/(?P<id_pedido>\d+)/(?P<cod_experto>\d+)$'...
asked by 17.02.2017 / 03:47
1
answer

How to generate a PYTHONPATH environment variable for django

I recently updated my Ubuntu operating system 14.04 to 16.04 and it turns out that I can no longer run a project on Django that is running on a virtualenv throws me this error. File "./manage.py", line 17, in <module> "Couldn't imp...
asked by 17.02.2017 / 04:23
1
answer

NoReverseMatch at

Hi, could you help me with this error: Reverse for 'order_sub' with arguments '()' and keyword arguments '{' request_id ': 53,' code_expert ':' AA-0002 '}' not found. 1 pattern (s) tried: ['request / approve / (? P \ d +) / (? P \ d +) $']...
asked by 17.02.2017 / 00:51