Questions tagged as 'django'

1
answer

DRF The submitted data was not a file. Check the encoding type on the form - ImageField

I have the following model User: class User(AbstractBaseUser, PermissionsMixin): #... other attributes photo = models.ImageField(upload_to='avatars', blank=True) The basic serialization that I made of this model is: class UserSerial...
asked by 29.10.2016 / 02:12
2
answers

Django: Error during template rendering

I have an error that I can not find: NoReverseMatch at and Error during template rendering: link Link to GitHub     
asked by 13.10.2016 / 22:04
1
answer

Django form without using django form

I have a form prepared without using the form of django (It was one of the requirements that they demanded, not using the django form). I use this form to create and edit. The form creates and edits perfectly, but I find an error (I call it that...
asked by 27.11.2016 / 23:35
1
answer

Upload Form Django Error (invalid literal for int () with base 10)

I have a form with which I want to make an "insert" in one of the models and it gives me the following error and I am not able to know why or debug: invalid literal for int () with base 10 views.py def poiUploader(request): title...
asked by 11.10.2016 / 13:29
1
answer

Django - View - Model

I have a question, the functions like for example register user () must go inside the User class inside models.py or in the view.py? Another question, how do I use a function of models.py from view.py?     
asked by 07.10.2016 / 23:45
1
answer

CreateView does not save in the database with save ()

Yesterday I asked something about the form where they helped me quickly. Today I come, with the same subject, for that form that what I put in that form is not saved in the database and redirects me to the url but you do not show them to me....
asked by 10.08.2016 / 14:40
1
answer

Help with date filter in django

Good morning I have a question about the filters for dates, I have a model called Absenteeism that has an attribute "start_date" and an "end_date", and I have problems with the filter of a query to create some graphs. For example, I have a...
asked by 14.07.2016 / 18:02
2
answers

Get values from a form

I'm trying to get the values out of a form that is not in the forms.py, besides this has a button to add a value, what I want is only to print the values entered on the screen, unfortunately I could not make it work. Error message    local...
asked by 07.10.2016 / 23:21
1
answer

I want to validate with ajax and json in Django, a field if it already exists before submitting?

This is the url: url(r'validar/celda', SGregorio_views.validarcelda, name='validarcelda'), This is the view to validate: def validarcelda(request): error = '' success = False if request.method == 'POST': celda = reques...
asked by 04.10.2016 / 17:54
1
answer

Customize "verbose_name" for embedded administrators (admininline)

I have several models with foreign keys to other models, which embed in the administrator of that model using obviously admin.StakedInline , the problem is that the same model has up to two child models of the same type, so I have to embed...
asked by 27.05.2016 / 19:28