Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Generate a per-site random secret

Project Description

Sitesecret is a tiny library to generate and store per-site secrets.

Stop doing this:

SECRET = 'my-top-sekrit-key'

And do this instead:

import sitesecret

SECRET = sitesecret.get_secret(__name__)

SECRET will be initialized with 1024 octets of random data, suitable for cryptographic applications. The data will be saved in the current directory in a file named .sitesecret-<module name>.

Subsequent calls will return the same secret value and sitesecret ensures that only a single secret is ever generated — even if multiple processes call get_secret at the same time .

0.1.1 (released 2015-12-19)

  • Fix Python 3 compatibility issue

0.1 (released 2015-12-18)

  • Initial release

Release History

This version
History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(1.9 kB) Copy SHA256 Hash SHA256
Source None Dec 19, 2015

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers