django-1.9

Django 1.9 JSONField order_by

Django 1.9 JSONField order_by Question: I have the following django model that contains JSONField: class RatebookDataEntry(models.Model): data = JSONField(blank=True, default=[]) last_update = models.DateTimeField(auto_now=True) class Meta: verbose_name_plural = ‘Ratebook data entries’ And data field contains this json: { “annual_mileage”: 15000, “description”: “LEON DIESEL SPORT COUPE”, “body_style”: “Coupe”, “range_name”: “LEON”, “co2_gkm_max”: 122, “manufacturer_name”: “SEAT” } Can I …

Total answers: 7

Why did Django 1.9 replace tuples () with lists [] in settings and URLs?

Why did Django 1.9 replace tuples () with lists [] in settings and URLs? Question: I am bit curious to know why Django 1.9 replaced tuples () with lists [] in settings, URLs and other configuration files I just upgraded to Django 1.9 and noticed these changes. What is the logic behind them? INSTALLED_APPS = …

Total answers: 2

Django 1.9 tutorial __str__ () not working

Django 1.9 tutorial __str__ () not working Question: I am trying Django 1.9 tutorial with Win 10 os and Python 3.5 and Django version is 1.9. I have successfully created and stored values in “Question” and “Choice”. After this when i have changed polls/model.py with __str__() as per tutorial django tutorial 2. I am getting …

Total answers: 5

Django 1.9 ImportError for import_module

Django 1.9 ImportError for import_module Question: When trying to run either runserver or shell using manage.py I get an ImportError exception. I’m using Django 1.9. ImportError: No module named ‘django.utils.importlib’ Asked By: Matt Deacalion || Source Answers: I solved this with the following: try: # Django versions >= 1.9 from django.utils.module_loading import import_module except ImportError: …

Total answers: 2