Distributing Django projects with unique SECRET_KEYs

前端 未结 10 955
长发绾君心
长发绾君心 2020-12-22 16:41

I have a Django project that I\'d like to distribute on a public repository like bitbucket or github. I\'d like it to be as easy to install as possible, so I\'m including t

10条回答
  •  Happy的楠姐
    2020-12-22 17:15

    If you create a new project using template, like django-admin.py startproject --template=path_to_template project_name just put {{ secret_key }} into your project template settings file (e.g. settings.py) like SECRET_KEY = '{{ secret_key }}' and Django will generate it for you.

提交回复
热议问题