How to make migrations for a reusable Django app?

后端 未结 3 1903
我在风中等你
我在风中等你 2021-01-02 04:18

I am making a reusable Django app without a project. This is the directory structure:

/
/myapp/
/myapp/models.py
/myapp/migrations/
/myapp/migrations/__init_         


        
3条回答
  •  再見小時候
    2021-01-02 04:49

    Create your_app/migrations_settings.py file:

    SECRET_KEY = 'fake-key'
    
    INSTALLED_APPS = [
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'your_app'
    ]
    

    then

    export DJANGO_SETTINGS_MODULE=yourapp.migrations_settings
    django-admin makemigrations yourapp
    

提交回复
热议问题