Skip to content

Instantly share code, notes, and snippets.

View skyl's full-sized avatar

Skylar Saveland skyl

View GitHub Profile
@skyl
skyl / django_hasher.py
Last active February 25, 2022 06:01 — forked from steve-chavez/django_hasher.py
Use django hasher to make password
# you have to have a django project to do it this way
# You can run this in a `./manage.py shell`
from django.contrib.auth.hashers import make_password
make_password("youreverysecuresuperpass")
# this will output something that looks like this:
# 'pbkdf2_sha256$260000$rgjSFB3xwsxkfcL1iE8wq6$bDtiRY0+gtE4ahFdfDeHwy0tzLb8McDRnppS8kD8QJs='
# by default in Django 4.0
@skyl
skyl / Tomjunk
Created June 7, 2010 18:17 — forked from anonymous/Tomjunk
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>
Google Visualization API Sample
</title>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
from djredis.models import DredisMixin
import djredis.models
class Blog(models.Model, DredisMixin): # inherit from the mixin class
author = models.ForeignKey('Author')
title = models.CharField(max_length=200)
# declaratively add your redis fields
viewcount = djredis.models.Counter()