django-1.7

AttributeError while using Django Rest Framework with serializers

AttributeError while using Django Rest Framework with serializers Question: 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 = models.BooleanField(default=False) title = models.CharField(max_length=100) description = models.TextField() Then …

Total answers: 2

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

Django 1.7 migrations won't recreate a dropped table, why? Question: 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 run: > …

Total answers: 10

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

ProgrammingError: relation "django_session" does not exist error after installing Psycopg2 Question: 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" does not exist error. …

Total answers: 2

How to migrate back from initial migration in Django 1.7?

How to migrate back from initial migration in Django 1.7? Question: 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 …

Total answers: 2

Django 1.7 – makemigrations not detecting changes

Django 1.7 – makemigrations not detecting changes Question: 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 unmigrated apps: myapp Apply all migrations: admin, …

Total answers: 36

Django: AppRegistryNotReady()

Django: AppRegistryNotReady() Question: 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 created a populate_rango.py at the same level of manage.py. Here’s the …

Total answers: 4