Skip to content

Instantly share code, notes, and snippets.

View canismarko's full-sized avatar

Mark Wolfman canismarko

View GitHub Profile
# open numpy array in imagej
######################################################################################
# Installation:
# 1. conda create -n pyimagej -c conda-forge pyimagej openjdk=8
# 2. conda activate pyimagej
#######################################################################################
import imagej
import numpy as np
@ndarville
ndarville / secret-key-gen.py
Created August 24, 2012 17:01
Generating a properly secure SECRET_KEY in Django
"""
Two things are wrong with Django's default `SECRET_KEY` system:
1. It is not random but pseudo-random
2. It saves and displays the SECRET_KEY in `settings.py`
This snippet
1. uses `SystemRandom()` instead to generate a random key
2. saves a local `secret.txt`