Browser accesses URL of Application:
http://www.example.com/private_media/my_file.pdf
The Permissions are checked by the application backend.
If Access is denied the application backend returns a 403
and thats the end of it.
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 |
import os | |
import socket | |
class IP(object): | |
def __init__(self): | |
self.base = None | |
def get(self, end): | |
if not self.base: |
{% load cms_tags %} | |
<!doctype html> | |
<head> | |
<title>{{ request.current_page.get_title }}</title> | |
{% plugins_media %} | |
</head> | |
<body> | |
{% placeholder "main" %} | |
</body> |
#!/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 |
<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> |
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): |
1. Knowledge is Power. | |
2. Time is Money. | |
As every engineer knows: | |
Power = Work / Time | |
Since: | |
Knowledge = Power | |
Time = Money |
LOGGING = { | |
'version': 1, | |
'disable_existing_loggers': True, | |
'formatters': { | |
'verbose': { | |
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s' | |
}, | |
'simple': { | |
'format': '%(levelname)s %(message)s' | |
}, |
This proposal presents a "middle ground" approach to improving and refactoring auth.User
, based around a new concept of "profiles". These profiles provide the main customization hook for the user model, but the user model itself stays concrete and cannot be replaced.
I call it a middle ground because it doesn't go as far as refactoring the whole auth app -- a laudable goal, but one that I believe will ultimately take far too long -- but goes a bit further than just fixing the most egregious errors (username length, for example).
This proposal includes a fair number of design decisions -- you're reading the fifth or sixth draft. To keep things clear, the options have been pruned out and on the one I think is the "winner" is still there. But see the FAQ at the end for some discussion and justification of various choices.