How do you configure Django for simple development and deployment?

后端 未结 14 1600
闹比i
闹比i 2020-11-30 16:14

I tend to use SQLite when doing Django development, but on a live server something more robust is often needed (MySQL/PostgreSQL, for example). Invariably, there are other c

14条回答
  •  一个人的身影
    2020-11-30 16:47

    The most simplistic way I found was:

    1) use the default settings.py for local development and 2) create a production-settings.py starting with:

    import os
    from settings import *
    

    And then just override the settings that differ in production:

    DEBUG = False
    TEMPLATE_DEBUG = DEBUG
    
    
    DATABASES = {
        'default': {
               ....
        }
    }
    

提交回复
热议问题