feat: add script to run migrations
This commit is contained in:
parent
46046007f7
commit
aeeedaf746
2 changed files with 17 additions and 1 deletions
11
make_migrations.py
Executable file
11
make_migrations.py
Executable 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)
|
|
@ -2,7 +2,12 @@ import os
|
||||||
|
|
||||||
DEBUG = (True,)
|
DEBUG = (True,)
|
||||||
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
|
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"
|
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue