Не создаются записи в базе данных Django

Всем привет.

Есть джанго проект. Я добавил новое приложение, сделал makemigrations и migrate. Но в базе данных проекта необходимые мне записи не появились. Пробовал sqlmigrate - тоже не работает. Если удалить базу данных, то туда не добавляются записи из старых приложений. Пробовал удалять папки migrations - тоже не работает. Python 2.7 и Django 1.7

Код:

    AsnReportSettings.objects.create(name="docname", value="pm9")
    AsnReportSettings.objects.create(name="searchstartid", value="0")
    AsnReportSettings.objects.create(name="complexid", value="856")
    AsnReportSettings.objects.create(name="frametypeid", value="12028")
    AsnReportSettings.objects.create(name="splitval", value="6")
    AsnReportSettings.objects.create(name="zbase", value='{"driver": "pg", "database":"zbase", "user":"postgres", "port":"5432", "host":"localhost"}')
    AsnReportSettings.objects.create(name="spou", value='{"driver": "sqlite", "adress": "D:/zlab/spou/database/spou.db"}')
    AsnReportSettings.objects.create(name="typeid", value='{"revstart": 1, "revstop": 2, "start": 3, "stop": 4}')
    AsnReportSettings.objects.create(name="initialised", value="True")```

Текст комадной строки:

```C:\Projects\reportbuilder>python manage.py makemigrations rep9
System check identified some issues:

WARNINGS:
?: (1_7.W001) MIDDLEWARE_CLASSES is not set.
        HINT: Django 1.7 changed the global defaults for the MIDDLEWARE_CLASSES. django.contrib.sessions.middleware.SessionMiddleware, django.contrib.auth.middleware.AuthenticationMiddleware, and django.contrib.messages.middleware.M
essageMiddleware were removed from the defaults. If your project needs these middleware then you should configure this setting.
Migrations for 'reporter9':
  0001_initial.py:
    - Create model AsnReport
    - Create model AsnReportAliasList
    - Create model AsnReportCriteria
    - Create model AsnReportDetails
    - Create model AsnReportSettings

C:\Projects\reportbuilder>python manage.py migrate
System check identified some issues:

WARNINGS:
?: (1_7.W001) MIDDLEWARE_CLASSES is not set.
        HINT: Django 1.7 changed the global defaults for the MIDDLEWARE_CLASSES. django.contrib.sessions.middleware.SessionMiddleware, django.contrib.auth.middleware.AuthenticationMiddleware, and django.contrib.messages.middleware.M
essageMiddleware were removed from the defaults. If your project needs these middleware then you should configure this setting.
Operations to perform:
  Apply all migrations: reporter, admin, sessions, reporter6, auth, reporter4, reporter5, contenttypes, reporter7, reporter2, reporter3, reporter8, reporter9
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying reporter.0001_initial... OK
  Applying reporter2.0001_initial... OK
  Applying reporter3.0001_initial... OK
  Applying reporter4.0001_initial... OK
  Applying reporter5.0001_initial... OK
  Applying reporter6.0001_initial... OK
  Applying reporter7.0001_initial... OK
  Applying reporter8.0001_initial... OK
  Applying reporter9.0001_initial... OK
  Applying sessions.0001_initial... OK


C:\Projects\reportbuilder>python manage.py sqlmigrate rep9 0001
System check identified some issues:

WARNINGS:
?: (1_7.W001) MIDDLEWARE_CLASSES is not set.
        HINT: Django 1.7 changed the global defaults for the MIDDLEWARE_CLASSES. django.contrib.sessions.middleware.SessionMiddleware, django.contrib.auth.middleware.AuthenticationMiddleware, and django.contrib.messages.middleware.M
essageMiddleware were removed from the defaults. If your project needs these middleware then you should configure this setting.
BEGIN;
CREATE TABLE "reporter_asnreport" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "build_time" datetime NOT NULL, "description" text NOT NULL, "accelerometer_ok" bool NOT NULL, "gyro_ok" bool NOT NULL, "error_message" text NOT NUL
L);
CREATE TABLE "reporter_asnreportaliaslist" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "alias" text NOT NULL);
CREATE TABLE "reporter_asnreportcriteria" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "alias" text NOT NULL, "list_order" integer NOT NULL, "minimum" real NOT NULL, "maximum" real NOT NULL, "dimension" text NOT NULL, "descript
ion" text NOT NULL);
CREATE TABLE "reporter_asnreportdetails" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "value" real NOT NULL, "is_ok" bool NOT NULL, "is_valid" bool NOT NULL, "criteria_id" integer NOT NULL REFERENCES "reporter_asnreportcriteria
" ("id"), "report_id" integer NOT NULL REFERENCES "reporter_asnreport" ("id"));
CREATE TABLE "reporter_asnreportsettings" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "name" text NOT NULL, "value" text NOT NULL);
CREATE INDEX reporter_asnreportdetails_f87fee24 ON "reporter_asnreportdetails" ("criteria_id");
CREATE INDEX reporter_asnreportdetails_6f78b20c ON "reporter_asnreportdetails" ("report_id");

COMMIT;```

Вернуться на верх