View django_hasher.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
View Tomjunk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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"> |
View djredis_iface.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |