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
2
votes
1 answer

Django1.10 - /i18n/setlang/ CSRF token missing or incorrect

After selecting a language in a language switcher form, I got a CSRF error: The form is in base.html
{% csrf_token %}
davideghz
  • 3,596
  • 5
  • 26
  • 50
2
votes
1 answer

django 1.10 list of installed apps

So I'm trying this: import my_project.settings DEVOPS_APPS = [ app for app in my_project.settings.INSTALLED_APPS if not "django" in app ] Sometimes when I refresh, the data doesn't show. Other times when I refresh, the data shows. Still some…
Simply Seth
  • 3,246
  • 17
  • 51
  • 77
2
votes
0 answers

Django-debug-toolbar extremely slowing down loading page

I want to profile my project to figure out what indices to create in db. I've installed django-debug-toolbar. The problem is that it is extremely slowing down page loading. Moreover, couple minutes ago it was showing about 80 000 queries, now it…
Milano
  • 18,048
  • 37
  • 153
  • 353
2
votes
0 answers

Changing lookup_type in Django 1.10+

In older versions of Django, you could change the lookup on the fly and have access to the value being looked up. For example, let's assume we're storing country by its ISO 2-letter abbreviation, but we want to allow searching by the name of a…
Jordan Reiter
  • 20,467
  • 11
  • 95
  • 161
2
votes
2 answers

Don't apply existing migrations for a Django model

I need to tell Django not to apply already existing migrations for a model. Is there a way I can achieve it? Why: I have some customizations on top of django.contrib.auth. With those, Group model is left unused. However, migrations for it are…
Art
  • 2,235
  • 18
  • 34
2
votes
1 answer

"ProgrammingError: column users_appuser.id does not exist" extending User model django

I am extending User on django and didn't realize I need to add phone number. When I made the model below, I forgot to makemigrations migrate before creating an AppUser. So I had made an AppUser/User combo as normal, but before the db was ready. It…
codyc4321
  • 9,014
  • 22
  • 92
  • 165
2
votes
2 answers

Making existing fields translatable(Django)

I am trying to translate already existing fields on a model class. I got stuck at the very first step, which is subclassing TranslatableModel class in Category, and adding TranslatedFields wrapper to translate selected model fields. I am following a…
an0o0nym
  • 1,456
  • 16
  • 33
2
votes
0 answers

ModelForm to edit a model and its OneToOne-related model

Say I have a User model and an Account model. The Account is related to the User with a OneToOne relationship. I have a ModelForm for the User model, and I'm looking for a third-party plugin / patch / snippet to allow this declaration: class…
Dor
  • 902
  • 4
  • 24
2
votes
1 answer

Django Rest framework - If table contains data in response showing Server Error (500)

I am using DjangoRestFramework for rest api In get request If there is no data in table the response is showing empty. If there is data in table the response is showing empty Server Error (500). The follwoing is my code models.py from __future__…
Anjaneyulu Battula
  • 1,910
  • 16
  • 33
1
vote
0 answers

I Do Recieve Errors During Migrate

I just add new apps to my setting.py and i wont to migrate and apply them but is giving me errors. please GUYS help me out i make sure there are not errors in any of my code so have try all i could but still cant solve this problem. THIS ARE THE…
CAP.tech
  • 79
  • 8
1
vote
1 answer

How to add an GenericRelation field in a form in Django

I have this following error: django.core.exceptions.FieldError: 'pictures' cannot be specified for Building model form as it is a non-editable field I many models that can have many Images. So I used django's GenericRelation. But as soon as I added…
Papouche Guinslyzinho
  • 5,277
  • 14
  • 58
  • 101
1
vote
2 answers

Seeding data through migration in 1.10

The problem is slightly tricky to define so please bear with me. I have a model called Blog. I have three migrations in it. 0001_initial: Create the table for Blog 0002_seed_data: Seed some data into this table. To seed this data, I use: all_blogs =…
Varun Singh
  • 1,135
  • 13
  • 18
1
vote
1 answer

Ajax and Django to get a multi-select smart panel to work dynamically

Please any idea how i can achieve something like this with Ajax and Django. Lets say a medical app. I'll like to multi-select medicine while it shows in a different panel and add the amount(s) sum and show me like the right text-boxes..
1
vote
2 answers

How to change letters in text to other letters | Python 2.7?

In my Django project I have form with field ("title"). In this field user need to write in Russian language but user can by mistake write some Latin letters. I want to change them. I use PYTHON 2.7. Next code raise error. How to fix this error? from…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
1
vote
0 answers

After saving object in django admin how to display it in foreign key inlining dropdown

When we save foreign key object from django admin. As following screenshot click here to see the screenshot Newly created object will get saved but not been able to display at same time in dropdown list. We have measurement model which has material…