Questions tagged [django-1.7]

Django 1.7 is the version of the Django framework, released September 2014. Please only use this tag if your question relates specifically to this version.

Django 1.7 depends on Python 2.7 and supports Python 3.4, support for Python 2.6 has been dropped.

Tag questions that address any of these new features:

  • Schema migrations
  • App-loading refactor
  • New method on Field subclasses
  • Calling custom QuerySet methods from the Manager
  • Using a custom manager when traversing reverse relations
  • New Prefetch object for advanced prefetch_related operations
  • Admin shortcuts support time zones
  • Using database cursors as context managers

If the question is not specific targeting features from this release please add . For questions about the new Schema migrations tool, please add .

See the Django 1.7 release notes for more information

394 questions
7
votes
2 answers

Django 1.7 synchronize unmigrated apps

I started my model: myapp.models.py class MyModel(models.Model): field_a = models.FloatField() field_c = models.FloatField() Then ran ./manage.py migrate on my new project and it was all good: Operations to perform: Synchronize…
Williams
  • 4,044
  • 1
  • 37
  • 53
7
votes
1 answer

Does null=True imply default=None for models?

When allowing database fields of a Django model to be NULL using null=True, is there default value guaranteed to be NULL by default? Or do I have to speficy this manually: report = models.FileField(upload_to='reports', null=True, default=None) …
danijar
  • 32,406
  • 45
  • 166
  • 297
6
votes
3 answers

Postgresql database randomly crashes

I really have no idea what the problem is. The logs read FATAL: sorry, too many clients already Over and over again. At first I thought that sometimes the connections lingered or were not closed properly so I tested that by connecting to the…
XelharK
  • 598
  • 8
  • 21
6
votes
1 answer

django 1.7 left outer join

I have a model like so class Job(models.Model): description = models.CharField(max_length=255) user = models.ForeignKey(User) date = models.DateField() slot = models.CharField(max_length=10, choices=SLOT_CHOICES) location =…
Chirdeep Tomar
  • 4,281
  • 8
  • 37
  • 66
6
votes
6 answers

Django 1.8 migrate: django_content_type does not exist

I just upgraded my django from 1.7.1 to 1.8.4. I tried to run python manage.py migrate but I got this error: django.db.utils.ProgrammingError: relation "django_content_type" does not exist I dropped my database, created a new one, and ran the…
AliBZ
  • 4,039
  • 12
  • 45
  • 67
6
votes
3 answers

django.db.utils.IntegrityError: (1062, "Duplicate entry '' for key 'slug'")

I'm trying to follow the tangowithdjango book and must add a slug to update the category table. However I'm getting an error after trying to migrate the…
Juanvulcano
  • 1,354
  • 3
  • 26
  • 44
6
votes
1 answer

Updating Django template settings from 1.7 to 1.8

So I've been tinkering with upgrading to the new version of Django (1.8). I'm currently on version 1.7 and I am struggling to get my production server to listen to the new settings in 1.8. As of 1.8, any TEMPLATE_* settings have been deprecated…
Llanilek
  • 3,386
  • 5
  • 39
  • 65
6
votes
2 answers

How to fake migrations for not to create a specific existing intermediary table

I have following models class VucutBolgesi(models.Model): site = models.ForeignKey(Site) bolge = models.CharField(verbose_name="Bölge", max_length=75) hareketler = models.ManyToManyField("Hareket", verbose_name="Hareketler", null=True,…
Mp0int
  • 18,172
  • 15
  • 83
  • 114
6
votes
1 answer

Cannot create an instance of a model with GenericForeignKey in migration

IMPORTANT: This question is no longer relevant. In a Django 1.7 migration I try to create Comment entries programatically with the following code: # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models,…
Paweł Kłeczek
  • 603
  • 1
  • 5
  • 28
6
votes
1 answer

Easiest and quickest way to increase Django's default username max length from 30 to 75

so i have seen a lot of solutions but i found most answers for older versions of Django and i was wondering if there are any changes on that. Basically i am using Django 1.7, and i wanted to override the uusername field in the default django USER…
psychok7
  • 5,373
  • 9
  • 63
  • 101
6
votes
2 answers

decoder jpeg not available mac osx

I am getting a decoder jpeg not available. I libjpeg installed using brew but when I install pillow, is get *** JPEG support not available I had this working and all of a sudden it stopped working. I have unlinked and linked libjpeg again like it…
Chirdeep Tomar
  • 4,281
  • 8
  • 37
  • 66
6
votes
2 answers

Load static data on django startup using AppConfig ready method in Django 1.7

I have some static location data to load so that it is available throughout the application like an in-memory cache. I tried to override ready() on AppConfig but data isn't loaded from the database, also ready() is getting called twice. from…
Chirdeep Tomar
  • 4,281
  • 8
  • 37
  • 66
6
votes
1 answer

Django 1.7 makemigrations not having an effect

I keep running python manage.py makemigrations on my heroku server, but no matter how many times I run it I get: $heroku run python manage.py makemigrations Running `python manage.py makemigrations` attached to terminal... up, run.2680 Migrations…
6
votes
3 answers

Custom user in django raises ValueError

Even this simple example throws a ValueError: Dependency on app with no migrations: myApp during python manage.py syncdb myApp/models.py from django.contrib.auth.models import AbstractUser class User(AbstractUser): …
Ben
  • 6,986
  • 6
  • 44
  • 71
5
votes
0 answers

Defining custom RelatedManager in django

I want to override related manager for a class. I have a Company model. It has state column which can be in ACTIVE, INACTIVE, SUSPENDED. I am adding 2 new states called SALES, CLOSED. Since its legacy model, just adding state can be…
Mohan
  • 1,850
  • 1
  • 19
  • 42