Is there a function for generating settings.SECRET_KEY in django?

后端 未结 2 850
礼貌的吻别
礼貌的吻别 2021-01-17 08:12

I wrote an ansible-role for openwisp2 to ease its deployment, it\'s a series of django apps. To ease the deployment as much as possible, I wrote a simple (probably trivial)

2条回答
  •  隐瞒了意图╮
    2021-01-17 08:49

    For lazy people like me:

    from django.core.management.utils import get_random_secret_key  
    get_random_secret_key()
    

提交回复
热议问题