Questions tagged [django-1.10]

Django 1.10 is a version of the Django framework, released August 2016. Please only use this tag if your question relates specifically to this version.

Django 1.10 requires Python 2.7, 3.4, or 3.5.

Here are a list of changes:

Django 1.10 was released in August 2016 and was supported until December 2017.

191 questions
0
votes
1 answer

Python TypeError: Object of type 'User' is not JSON serializable after upgrading to Django 2.1

I'm trying to upgrade a Django project from Django(1.10) to Django(2.1), while doing that I'm just stuck at one error, where I was using the request.user.pk to pass a user create an object. Here's what I have, so far: From models.py: class…
Abdul Rehman
  • 5,326
  • 9
  • 77
  • 150
0
votes
0 answers

Concurrency issue? Standalone python script sharing settings.py and ORM with django server has unreliable view of DB objects?

I'm having a strange problem that is difficult to reproduce (everything worked 2 days ago but some time between then and now no longer does--with no changes in the interim!) I have a django server program which we are running via gunicorn with…
0
votes
1 answer

Access the form that caused a post_save [Django]

Is there a way I can access the form that caused a post_save? The use case is that I have a field (a checkbox) that isn't attached to a particular model, but it's an extra field in the form itself. I want to know whether the field was checked or…
alexandernst
  • 14,352
  • 22
  • 97
  • 197
0
votes
1 answer

Create custom template tag in Django?

I have next models in my Django project. models.py: class Document(models.Model): name = models.TextField(blank=True, null=True) def get_children(self): return [dc.child for dc in DocumentClosure.objects.filter(parent=self)] class…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
0
votes
1 answer

Load Content automatically in Django app

I'm working on a Django (1.10 & Python3) project in which I need to implement a logic as: We have articles from various categories, the user needs to tag these articles, mean when user read articles then he needs to provide his feedback rather it's…
Abdul Rehman
  • 5,326
  • 9
  • 77
  • 150
0
votes
1 answer

Adapt JSONField to have auto conversion to Decimal

I have model with fields of type: django.contrib.postgres.fields.JSONField and I want have it always deserialized by: json.loads(value, parse_int=decimal.Decimal, parse_float=decimal.Decimal) when accessing objects…
0
votes
1 answer

How create slider by model in django?

In my Django project I have Slider model. Can someone help me create a slider by this model? I am a little bit confused and need some ideas. I would be grateful for any help. models.py: class Slider(models.Model): head = models.CharField( …
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
0
votes
0 answers

Django rest framework browsable API not working

I went through DRF documentation for setting up Browsable API but it says to implement this: from rest_framework.documentation import include_docs_urls But i am getting module include_docs_urls not found I want to achieve API documentation for…
0
votes
1 answer

Django - Autocomplete Light in admin for join Model

So I have a join model defined as follow: class EventTrack(models.Model): dj = models.ForeignKey(DjProfile, blank=True) track = models.ForeignKey(Track, blank=True) event = models.ForeignKey(Event, blank=True) def __str__(self): …
davideghz
  • 3,596
  • 5
  • 26
  • 50
0
votes
1 answer

Python 3.6/ Django1.10 @login_required decorator redirects to link with missing "/"

I am using a decorator login_required on my project Django 1.10 Python 3.6.It redirects to "http://127.0.0.1:8000/accounts/login?next=/profile/ " this link but throws an URL error. Whereas when I manually amend the above link with this…
Faz
  • 108
  • 2
  • 10
0
votes
1 answer

How to use Django with Apache?

Can someone help me and say whats wrong? I need to use Django + Apache. When I try to start Apache it shows me error: The requested operation has failed. I tried to change Listen 80 to different values but it didnt help. Also this error appears…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
0
votes
0 answers

Problems with editing multiupload image field

I have problem with editing form in django. Pls can someone help me? I have form with 2 fields: description and image. By this form users can edit currect article data. For example add new several images to article or update/delete one of the…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
0
votes
2 answers

Why _set.all dont work in tempale?

I have 3 connected with each other models. GroupRequirementType --> GroupRequirement --> Requirement. I am tring to show all requirements in template. Next code show me only GroupRequirementType objects. It seems like I have problems with _set.all.…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
0
votes
1 answer

How to override existing column in Django admin list display?

I'm trying to figure out how to override column values in Django admin list display. My model has field response_bytes which is in list_display in MyModelAdmin. I want admin to show this value in MB or KB etc. class…
Milano
  • 18,048
  • 37
  • 153
  • 353
0
votes
1 answer

Save several images with form in django

Whats the best way to save several images in django? I have Article modal with 2 fields: description and image. I tried next code but my currect form allows user to upload only one image file. I need form where user can create article with several…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193