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

后端 未结 2 875
礼貌的吻别
礼貌的吻别 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:47

    Indeed, you can use the same function that generates a new key when you call startproject, which is django.core.management.utils.get_random_secret_key().

    Note however it's not very different from your version.

提交回复
热议问题