feat: add script to run migrations

This commit is contained in:
Adrien Lemaire 2019-04-24 11:16:42 +09:00
parent 46046007f7
commit aeeedaf746
2 changed files with 17 additions and 1 deletions

11
make_migrations.py Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_settings")
from django.core.management import execute_from_command_line
args = sys.argv + ["makemigrations", "todo"]
execute_from_command_line(args)

View file

@ -2,7 +2,12 @@ import os
DEBUG = (True,)
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3"}}
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "test"
}
}
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"