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:
This file contains hidden or 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
<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> |
This file contains hidden or 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
""" | |
BOSH Client | |
----------- | |
Quite simple BOSH client used by Django-XMPPAuth | |
For now, it only supports the DIGEST-MD5 authentication method. | |
""" | |
import httplib, sys, random |
This file contains hidden or 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
upstream django_app { | |
server 127.0.0.1:8000; | |
} |
This file contains hidden or 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
#! /bin/sh | |
USER=$1; GROUP=$2; HOME=$3 | |
if [ 0 -ne $(getent passwd $USER > /dev/null)$? ] | |
then useradd $USER --home $HOME --gid $GROUP -n; fi | |
OLDGID=`getent passwd $USER | awk -F: '{print $4}'` | |
OLDGROUP=`getent group $OLDGID | awk -F: '{print $1}'` | |
OLDHOME=`getent passwd $USER | awk -F: '{print $6}'` | |
if [ "$GROUP" != "$OLDGID" ] && [ "$GROUP" != "$OLDGROUP" ] | |
then usermod --gid $GROUP $USER; fi | |
if [ "$HOME" != "$OLDHOME" ] |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
# Header ^^^ por causa de acento no código fonte | |
import string | |
from random import shuffle | |
This file contains hidden or 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
1673 us | |
1332 de | |
568 fr | |
445 nl | |
305 ru | |
287 gb | |
220 se | |
203 ca | |
120 ch | |
113 cz |
This file contains hidden or 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
import collections | |
class HTTPHeaderMap(collections.MutableMapping): | |
""" | |
A structure that contains HTTP headers. | |
HTTP headers are a curious beast. At the surface level they look roughly | |
like a name-value set, but in practice they have many variations that | |
make them tricky: |
This file contains hidden or 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
# encoding: utf-8 | |
from __future__ import absolute_import, division, print_function, unicode_literals | |
import operator | |
import warnings | |
from django.utils import six | |
from haystack import connection_router, connections |
OlderNewer