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
| from django.core.urlresolvers import get_resolver | |
| from django.core.urlresolvers import RegexURLResolver, RegexURLPattern | |
| def _recurse_resolver(resolver, prefix=[]): | |
| patterns = [] | |
| for obj in resolver.url_patterns: | |
| if isinstance(obj, RegexURLPattern): | |
| patterns.append(prefix + [obj.regex.pattern]) | |
| elif isinstance(obj, RegexURLResolver): |
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
| <h3>Summary</h3> | |
| {% if not execute %} | |
| <p>This is a <strong>dry run</strong>. Nothing has been changed.</p> | |
| <p>Please check the results. If you are satisfied, <a href="/convert_to_placeholders/True/">perform the actions listed below</a>, or <a href="/convert_to_placeholders/">do another dry run</a>.</p> | |
| {% else %} | |
| <p><a href="/convert_to_placeholders/">Perform a dry run instead</a>. It's probably too late though.</p> | |
| {% endif %} | |
| <ul> |
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/bash | |
| # This should be run on a relatvely modern version of Ubuntu (9.10 or later, | |
| # without any sort of confidence) | |
| PROJECT_NAME=$1 | |
| if [ x$PROJECT_NAME = "x" ] ; then | |
| # No project name! | |
| echo "Usage: $0 <project name>" | |
| exit 1 |
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
| {% load cms_tags %} | |
| <!doctype html> | |
| <head> | |
| <title>{{ request.current_page.get_title }}</title> | |
| {% plugins_media %} | |
| </head> | |
| <body> | |
| {% placeholder "main" %} | |
| </body> |
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 os | |
| import socket | |
| class IP(object): | |
| def __init__(self): | |
| self.base = None | |
| def get(self, end): | |
| if not self.base: |
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
| from django.conf import settings | |
| from django.utils.translation import string_concat, ugettext_lazy | |
| from django.utils.html import strip_tags | |
| from haystack import indexes, site | |
| from cms.models.managers import PageManager | |
| from cms.models.pagemodel import Page | |
| from cms.models.pluginmodel import CMSPlugin |
NewerOlder