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
150
votes
36 answers

Django 1.7 - makemigrations not detecting changes

As the title says, I can't seem to get migrations working. The app was originally under 1.6, so I understand that migrations won't be there initially, and indeed if I run python manage.py migrate I get: Operations to perform: Synchronize…
TyrantWave
  • 4,583
  • 2
  • 22
  • 25
142
votes
2 answers

How to migrate back from initial migration in Django 1.7?

I created a new app with some models and now I noticed that some of the models are poorly thought out. As I haven't committed the code the sensible thing would be to migrate the database to last good state and redo the migration with better models.…
Seppo Erviälä
  • 7,160
  • 7
  • 35
  • 40
94
votes
3 answers

django 1.7 migrate gets error "table already exists"

I am trying to apply a migration but am getting the error: django.db.utils.OperationalError: (1050, "Table 'customers_customer' already exists") I get this by issuing the following command: python manage.py migrate My customer table already…
Atma
  • 29,141
  • 56
  • 198
  • 299
93
votes
21 answers

How to resolve "django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: foo" in Django 1.7?

On upgrading to Django 1.7 I'm getting the following error message from ./manage.py $ ./manage.py Traceback (most recent call last): File "./manage.py", line 16, in execute_from_command_line(sys.argv) File…
John Carter
  • 53,924
  • 26
  • 111
  • 144
93
votes
11 answers

How to simplify migrations in Django 1.7?

There are already similar questions for South, but I have started my project with Django 1.7 and am not using South. During development a lot of migrations have been created, however the software is not yet delievered and there exists no database…
Kit Fisto
  • 4,385
  • 5
  • 26
  • 43
75
votes
13 answers

Django 1.7 upgrade error: AppRegistryNotReady: Apps aren't loaded yet

I am trying to upgrade a project from Django 1.6 to 1.7. I get the following error: [Thu Oct 09 14:16:41 2014] [error] [client 95.79.172.156] mod_wsgi (pid=14523): Exception occurred processing WSGI script…
Vadim Kiselev
  • 1,030
  • 1
  • 8
  • 16
56
votes
8 answers

Why does Django make migrations for help_text and verbose_name changes?

When I change help_text or verbose_name for any of my model fields and run python manage.py makemigrations, it detects these changes and creates a new migration, say, 0002_xxxx.py. I am using PostgreSQL and I think these changes are irrelevant to my…
utapyngo
  • 6,946
  • 3
  • 44
  • 65
50
votes
8 answers

Getting model ContentType in migration - Django 1.7

I have a data migration that updates some permissions. I know there are some known issues with permissions in migrations and i was able to avoid some trouble by creating the permissions in the migration it self (rather then using the tuple shortcut…
haki
  • 9,389
  • 15
  • 62
  • 110
45
votes
10 answers

Django 1.7 migrations won't recreate a dropped table, why?

Using Django 1.7 migrations. I accidentally dropped a table in my database. I assumed that by running migration again this would recreate the table but no, Django states "No migrations to apply". How to I get Django to recreate the table? I have…
Prometheus
  • 32,405
  • 54
  • 166
  • 302
45
votes
2 answers

django 1.7 migrations -- how do I clear all migrations and start over from scratch?

So I'm rapidly iterating on a django app at the moment and I'm constantly adjusting models.py. Over the course of a day or two of programming and testing I generate a couple dozen migration files. Sometimes I really tear the schema apart and…
tadasajon
  • 14,276
  • 29
  • 92
  • 144
41
votes
2 answers

ProgrammingError: relation "django_session" does not exist error after installing Psycopg2

I started to develop a Django based web application. Everything was fine until I installed Psycopg2 for my database which I created in PostgreSql. Now when I'm trying to open any page in my site, it throws ProgrammingError: relation "django_session"…
Ghasem
  • 14,455
  • 21
  • 138
  • 171
41
votes
4 answers

Django: AppRegistryNotReady()

Python: 2.7; Django: 1.7; Mac 10.9.4 I'm following the tutorial of Tango with Django At Chapter 5, the tutorial teaches how to create a population script, which can automatically create some data for the database for the ease of development. I…
user2988464
  • 3,251
  • 6
  • 21
  • 25
41
votes
4 answers

How to add a new field to a model with new Django migrations?

I'm using the contribute_to_class method but I don't know how to create the field in the database with new migrations.
pedro_witoi
  • 459
  • 1
  • 5
  • 4
39
votes
5 answers

Django 1.7 - How do I suppress "(1_6.W001) Some project unittests may not execute as expected."?

I have a Django application that has parts originally written in Django 1.2, and the application has been upgraded all the way up to 1.7. After upgrading to 1.7, I'm getting the following warning from python manage.py check: System check identified…
Santtu Pajukanta
  • 1,371
  • 1
  • 12
  • 15
38
votes
2 answers

AttributeError while using Django Rest Framework with serializers

I am following a tutorial located here that uses Django Rest Framework, and I keep getting a weird error about a field. I have the following model in my models.py from django.db import models class Task(models.Model): completed =…
Frankline
  • 40,277
  • 8
  • 44
  • 75
1
2 3
26 27