Commit 66a0d674 authored by Michal Čihař's avatar Michal Čihař

Add script to generate secret key

parent 610f9671
...@@ -178,10 +178,8 @@ options: ...@@ -178,10 +178,8 @@ options:
``SECRET_KEY`` ``SECRET_KEY``
Key used by Django to sign some information in cookies. If you don't Key used by Django to sign some information in cookies, see
change this, the cookies can be spoofed by anyone. :ref:`production-secret` for more information.
.. seealso:: https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-SECRET_KEY
``SERVER_EMAIL`` ``SERVER_EMAIL``
...@@ -374,6 +372,9 @@ Django secret key ...@@ -374,6 +372,9 @@ Django secret key
The ``SECRET_KEY`` setting is used by Django to sign cookies and you should The ``SECRET_KEY`` setting is used by Django to sign cookies and you should
really use own value rather than using the one coming from example setup. really use own value rather than using the one coming from example setup.
You can generate new key using :file:`examples/generate-secret-key` shipped
with Weblate.
.. seealso:: https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-SECRET_KEY .. seealso:: https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-SECRET_KEY
.. _production-admin-files: .. _production-admin-files:
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2013 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from django.utils.crypto import get_random_string
chars = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'
print get_random_string(50, chars)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment