Basic table inline edit functionality
This commit is contained in:
@ -1,6 +1,21 @@
|
||||
import os
|
||||
import shutil
|
||||
|
||||
from django.apps import AppConfig
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
class MainConfig(AppConfig):
|
||||
default_auto_field = "django.db.models.BigAutoField"
|
||||
name = "project.main"
|
||||
|
||||
def ready(self):
|
||||
"""copy template database if db not exists"""
|
||||
|
||||
db_fname = settings.DATABASES["default"]["NAME"]
|
||||
template_db_fname = settings.BASE_DIR / "db_template.sqlite3"
|
||||
|
||||
if os.path.exists(db_fname):
|
||||
return
|
||||
|
||||
shutil.copyfile(template_db_fname, db_fname)
|
||||
|
||||
Reference in New Issue
Block a user