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

Force exception to be raised when setting invalid field on model instance

If I accidentally typo the field name on a model, I want to raise an exception rather than silently failing: obj = MyModel() obj.fieldsdoesnotexist = 'test' # No exception is raised How can I make Django raise exceptions when setting invalid…
Flash
  • 15,945
  • 13
  • 70
  • 98
0
votes
1 answer

Django post manytomany field with form

I tried to select poi(point of interest) to make loi(line of interest), I met two problems on many to many fields: 1.Why I can't post the multiple selected options. 2.How to change the name in the option with the name I want (e.g.…
max
  • 17
  • 6
0
votes
1 answer

redirection to success_url is not working with django 1.10

I have a pretty simple contact us form but the success_url is not working. The page isn't getting redirected to home after successful form submission. I've followed the documentation available here…
Chirdeep Tomar
  • 4,281
  • 8
  • 37
  • 66
0
votes
2 answers

NoReverseMatch error Django 1.10

I am new to Django and cant seem to find a solution to my problem I get the following error Reverse for 'todo_list' with arguments '()' and keyword arguments '{'cid': 1}' not found. 1 pattern(s) tried: ['todo/(?P)/'] 1 {% extends…
Eitan Seri-Levi
  • 341
  • 3
  • 17
0
votes
1 answer

Conditional filtering on Count - Django

I want to count a number of all incorrect choices in question. I have a query for a number of all choices: questions.annotate(choices_count=Count('choices')) Now, when I want to filter incorrect choices only into the Count function, it…
Milano
  • 18,048
  • 37
  • 153
  • 353
0
votes
1 answer

unable to set and retrieve session variables

Using Django 1.10 My middleware is set as follows: MIDDLEWARE =…
glls
  • 2,325
  • 1
  • 22
  • 39
0
votes
1 answer

django 1.10 media image not showing up

I am unable to display images uploaded by the admin user through admin on a template. settings.py MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media') url.py from django.conf.urls import url from django.conf import settings from…
Chirdeep Tomar
  • 4,281
  • 8
  • 37
  • 66
0
votes
2 answers

int() argument must be a string or a number, not 'Choice'

It is giving error that int() argument must be a string or a number,not 'Choice' I am new to django rest framework Please HELP This is my serializers.py class VoteSerializer(ModelSerializer): class Meta: model=Vote …
0
votes
0 answers

Django Object has no attribute '__set' in legacy Database

I can't quite figure out how to work ou ManyToMany relationships in a legacy DB. models.py : class Trecho(models.Model): cod = models.BigIntegerField(primary_key=True) torres = models.ManyToManyField('Torre', through="Trecho_Com_Torre") …
Mojimi
  • 2,561
  • 9
  • 52
  • 116
0
votes
1 answer

enable disable a textfield on the selection of dropdown value in Django

I have a register page in Django which contains some textfield and a dropdown value. models.py class UserInformation(models.Model): firstName = models.CharField(max_length=128) lastName = models.CharField(max_length=128) …
Mohammad Shahbaz
  • 403
  • 8
  • 28
0
votes
1 answer

Django fails to redirect properly

I am new to Django, and working on a URL shortener project like bitly. I am running into issues at the moment when trying to click the link created in the success.html template, it does not redirect, and appends the path + short_url +…
camelBack
  • 748
  • 2
  • 11
  • 30
0
votes
1 answer

pip install MySQLdb is not working in my pc and some other errors

I am using python-3.6.0 & windows10. During learning django I created a project and when I typed python manage.py makemigrations it began to show errors. I checked many Q/A. But nothing is working as there suggestion. I tried pip install…
Abid
  • 477
  • 1
  • 4
  • 15
0
votes
2 answers

TimeField and DurationField int error

I have run into this error when running python manage.py migrate when using DurationField and TimeField both give me a: return int(round(value.total_seconds() * 1000000)) AttributeError: 'int' object has no attribute 'total_seconds' I have seen…
Travis N. Miller
  • 135
  • 1
  • 10
0
votes
0 answers

Cannot reach static files in Django 1.10

I am not getting any static files to show up in Django. The repo is located at git@bitbucket.org:codyc54321/bookwormbud.git. In settings.py I have STATIC_ROOT = os.path.join(BASE_DIR, 'static') STATIC_URL = '/static/' I have a static folder in the…
codyc4321
  • 9,014
  • 22
  • 92
  • 165
0
votes
1 answer

FORCE_SCRIPT_NAME is causing urls to resolve incorrectly; can I override this in different contexts?

I'm in the process of upgrading a django app from 1.9.10 to 1.10.5 and am finding that the URL is no longer resolving correctly because FORCE_SCRIPT_URL is set, and is being tacked onto ** everything ** now. I suspect that this is because of "an…
mokutsu
  • 11
  • 4