This repository has been archived by the owner on Jan 31, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Funfactory... It's not you, it's me. We're just not good for each other anymore. I look to the future, and it's a future of double rainbows and misty sunrises. It's a future where I've got more control and in turn more responsibility. It's a future where I'm empowered to have my own successes, and my own mistakes. Maybe I'll double the Firefox userbase. Maybe I'll become the cornerstone of a bad news cycle (again). I don't know for certain what will happen, but I know it needs to happen without you. Be well, Funfactory. I hope we can still be friends.
- Loading branch information
Showing
18 changed files
with
830 additions
and
122 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from django.conf import settings | ||
from django.utils import translation | ||
|
||
|
||
def i18n(request): | ||
return {'LANGUAGES': settings.LANGUAGES, | ||
'LANG': settings.LANGUAGE_URL_MAP.get(translation.get_language()) | ||
or translation.get_language(), | ||
'DIR': 'rtl' if translation.get_language_bidi() else 'ltr', | ||
} | ||
|
||
|
||
def globals(request): | ||
return {'request': request, | ||
'settings': settings} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import logging | ||
|
||
|
||
__all__ = ['patch'] | ||
|
||
|
||
# Prevent from patching twice. | ||
_has_patched = False | ||
|
||
|
||
def patch(): | ||
global _has_patched | ||
if _has_patched: | ||
return | ||
|
||
# Import for side-effect: configures logging handlers. | ||
from fjord.settings.log_settings import noop | ||
noop() | ||
|
||
# Monkey-patch admin site. | ||
from django.contrib import admin | ||
from django.contrib.auth.decorators import login_required | ||
from session_csrf import anonymous_csrf | ||
from adminplus import AdminSitePlus | ||
|
||
admin.site = AdminSitePlus() | ||
admin.autodiscover() | ||
admin.site.login = login_required(anonymous_csrf(admin.site.login)) | ||
|
||
# Monkey-patch django forms to avoid having to use Jinja2's |safe | ||
# everywhere. | ||
import jingo.monkey | ||
jingo.monkey.patch() | ||
|
||
# Monkey-patch Django's csrf_protect decorator to use | ||
# session-based CSRF tokens. | ||
import session_csrf | ||
session_csrf.monkeypatch() | ||
|
||
from jingo import load_helpers | ||
load_helpers() | ||
|
||
logging.debug("Note: monkey patches executed in %s" % __file__) | ||
|
||
# Prevent it from being run again later. | ||
_has_patched = True |
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
Oops, something went wrong.