Skip to content

Instantly share code, notes, and snippets.

View seocam's full-sized avatar

Sergio Oliveira seocam

  • Uber
  • Brazil
  • 03:38 (UTC -03:00)
View GitHub Profile
upstream django_app {
server 127.0.0.1:8000;
}
"""
BOSH Client
-----------
Quite simple BOSH client used by Django-XMPPAuth
For now, it only supports the DIGEST-MD5 authentication method.
"""
import httplib, sys, random
@seocam
seocam / gist:3455535
Created August 24, 2012 20:57
Testing

Using a custom template

If you need to use a template different from the Django's default (for example to generate a Google News sitemap) you can extend the you Sitemap class and setting a sitemap_template attribute. For Example:

@seocam
seocam / barcode_template.html
Created August 18, 2012 21:36
Generate a interleaved 2 of 5 barcode in pure HTML and CSS (tested only in Firefox and Chrome)
<html>
<head>
<style>
#barcode {height: 60px;}
#barcode span {margin: 0;padding-bottom: 34px;height: 16px;}
.n {padding-right: 1px;}
.w {padding-right: 3px;}
.n, .w {background-color: #000;}
.s {background-color: #fff;}
</style>