Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Using Funfactory with Session CSRF

  • Loading branch information...
commit a17eba76fae6909e87b0f0ed149eca8d52e7e877 1 parent b6afa69
@davedash davedash authored ozten committed
View
10 apps/commons/context_processors.py
@@ -1,10 +0,0 @@
-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',
- }
View
80 apps/commons/helpers.py
@@ -1,80 +0,0 @@
-import datetime
-import urllib
-import urlparse
-
-from django.conf import settings
-from django.template import defaultfilters
-from django.utils.html import strip_tags
-from django.utils.encoding import smart_str
-
-from jingo import register
-import jinja2
-
-from .urlresolvers import reverse
-
-
-# Yanking filters from Django.
-register.filter(strip_tags)
-register.filter(defaultfilters.timesince)
-register.filter(defaultfilters.truncatewords)
-
-
-@register.function
-def thisyear():
- """The current year."""
- return jinja2.Markup(datetime.date.today().year)
-
-
-@register.function
-def url(viewname, *args, **kwargs):
- """Helper for Django's ``reverse`` in templates."""
- return reverse(viewname, args=args, kwargs=kwargs)
-
-
-@register.filter
-def absolutify(url):
- """Takes a URL and prepends the SITE_URL"""
- protocol = settings.PROTOCOL
- hostname = settings.DOMAIN
- port = settings.PORT
- if (protocol, port) in (('https://', port == 443), ('http://', 80)):
- return ''.join(map(str, (protocol, hostname, url)))
- else:
- return ''.join(map(str, (protocol, hostname, ':', port, url)))
-
-
-@register.filter
-def urlparams(url_, hash=None, **query):
- """
- Add a fragment and/or query paramaters to a URL.
-
- New query params will be appended to exising parameters, except duplicate
- names, which will be replaced.
- """
- url = urlparse.urlparse(url_)
- fragment = hash if hash is not None else url.fragment
-
- # Use dict(parse_qsl) so we don't get lists of values.
- q = url.query
- query_dict = dict(urlparse.parse_qsl(smart_str(q))) if q else {}
- query_dict.update((k, v) for k, v in query.items())
-
- query_string = _urlencode([(k, v) for k, v in query_dict.items()
- if v is not None])
- new = urlparse.ParseResult(url.scheme, url.netloc, url.path, url.params,
- query_string, fragment)
- return new.geturl()
-
-
-def _urlencode(items):
- """A Unicode-safe URLencoder."""
- try:
- return urllib.urlencode(items)
- except UnicodeEncodeError:
- return urllib.urlencode([(k, smart_str(v)) for k, v in items])
-
-
-@register.filter
-def urlencode(txt):
- """Url encode a path."""
- return urllib.quote_plus(txt)
View
58 apps/commons/middleware.py
@@ -1,58 +0,0 @@
-"""
-Taken from zamboni.amo.middleware.
-
-This is django-localeurl, but with mozilla style capital letters in
-the locale codes.
-"""
-
-import urllib
-
-from django.http import HttpResponsePermanentRedirect
-from django.utils.encoding import smart_str
-
-import tower
-
-from . import urlresolvers
-from .helpers import urlparams
-
-class LocaleURLMiddleware(object):
- """
- 1. Search for the locale.
- 2. Save it in the request.
- 3. Strip them from the URL.
- """
-
- def process_request(self, request):
- prefixer = urlresolvers.Prefixer(request)
- urlresolvers.set_url_prefix(prefixer)
- full_path = prefixer.fix(prefixer.shortened_path)
-
- if 'lang' in request.GET:
- # Blank out the locale so that we can set a new one. Remove lang
- # from the query params so we don't have an infinite loop.
- prefixer.locale = ''
- new_path = prefixer.fix(prefixer.shortened_path)
- query = dict((smart_str(k), request.GET[k]) for k in request.GET)
- query.pop('lang')
- return HttpResponsePermanentRedirect(urlparams(new_path, **query))
-
- if full_path != request.path:
- query_string = request.META.get('QUERY_STRING', '')
- full_path = urllib.quote(full_path.encode('utf-8'))
-
- if query_string:
- full_path = '%s?%s' % (full_path, query_string)
-
- response = HttpResponsePermanentRedirect(full_path)
-
- # Vary on Accept-Language if we changed the locale
- old_locale = prefixer.locale
- new_locale, _ = prefixer.split_path(full_path)
- if old_locale != new_locale:
- response['Vary'] = 'Accept-Language'
-
- return response
-
- request.path_info = '/' + prefixer.shortened_path
- request.locale = prefixer.locale
- tower.activate(prefixer.locale)
View
0  apps/commons/models.py
No changes.
View
0  apps/commons/tests/__init__.py
No changes.
View
13 apps/commons/tests/test_helpers.py
@@ -1,13 +0,0 @@
-from nose.tools import eq_
-
-from django.conf import settings
-
-from commons import helpers
-
-
-def test_absolutify():
- protocol = settings.PROTOCOL
- hostname = settings.DOMAIN
- port = settings.PORT
- expected = '%s%s:%s/boo' % (protocol, hostname, port)
- eq_(helpers.absolutify('/boo'), expected)
View
50 apps/commons/tests/test_migrations.py
@@ -1,50 +0,0 @@
-import re
-from os import listdir
-from os.path import join, dirname
-
-import test_utils
-
-import manage
-
-
-class MigrationTests(test_utils.TestCase):
- """Sanity checks for the SQL migration scripts."""
-
- @staticmethod
- def _migrations_path():
- """Return the absolute path to the migration script folder."""
- return manage.path('migrations')
-
- def test_unique(self):
- """Assert that the numeric prefixes of the DB migrations are unique."""
- leading_digits = re.compile(r'^\d+')
- seen_numbers = set()
- path = self._migrations_path()
- for filename in listdir(path):
- match = leading_digits.match(filename)
- if match:
- number = match.group()
- if number in seen_numbers:
- self.fail('There is more than one migration #%s in %s.' %
- (number, path))
- seen_numbers.add(number)
-
- def test_innodb_and_utf8(self):
- """Make sure each created table uses the InnoDB engine and UTF-8."""
- # Heuristic: make sure there are at least as many "ENGINE=InnoDB"s as
- # "CREATE TABLE"s. (There might be additional "InnoDB"s in ALTER TABLE
- # statements, which are fine.)
- path = self._migrations_path()
- for filename in sorted(listdir(path)):
- with open(join(path, filename)) as f:
- contents = f.read()
- creates = contents.count('CREATE TABLE')
- engines = contents.count('ENGINE=InnoDB')
- encodings = (contents.count('CHARSET=utf8') +
- contents.count('CHARACTER SET utf8'))
- assert engines >= creates, ("There weren't as many "
- 'occurrences of "ENGINE=InnoDB" as of "CREATE TABLE" in '
- 'migration %s.' % filename)
- assert encodings >= creates, ("There weren't as many "
- 'UTF-8 declarations as "CREATE TABLE" occurrences in '
- 'migration %s.' % filename)
View
115 apps/commons/urlresolvers.py
@@ -1,115 +0,0 @@
-from threading import local
-
-from django.conf import settings
-from django.core.urlresolvers import reverse as django_reverse
-from django.utils.translation.trans_real import parse_accept_lang_header
-
-
-# Thread-local storage for URL prefixes. Access with (get|set)_url_prefix.
-_local = local()
-
-
-def set_url_prefix(prefix):
- """Set the ``prefix`` for the current thread."""
- _local.prefix = prefix
-
-
-def get_url_prefix():
- """Get the prefix for the current thread, or None."""
- return getattr(_local, 'prefix', None)
-
-
-def reverse(viewname, urlconf=None, args=None, kwargs=None, prefix=None):
- """Wraps Django's reverse to prepend the correct locale."""
- prefixer = get_url_prefix()
-
- if prefixer:
- prefix = prefix or '/'
- url = django_reverse(viewname, urlconf, args, kwargs, prefix)
- if prefixer:
- return prefixer.fix(url)
- else:
- return url
-
-
-def find_supported(test):
- return [settings.LANGUAGE_URL_MAP[x] for
- x in settings.LANGUAGE_URL_MAP if
- x.split('-', 1)[0] == test.lower().split('-', 1)[0]]
-
-
-class Prefixer(object):
-
- def __init__(self, request):
- self.request = request
- split = self.split_path(request.path_info)
- self.locale, self.shortened_path = split
-
- def split_path(self, path_):
- """
- Split the requested path into (locale, path).
-
- locale will be empty if it isn't found.
- """
- path = path_.lstrip('/')
-
- # Use partitition instead of split since it always returns 3 parts
- first, _, rest = path.partition('/')
-
- lang = first.lower()
- if lang in settings.LANGUAGE_URL_MAP:
- return settings.LANGUAGE_URL_MAP[lang], rest
- else:
- supported = find_supported(first)
- if len(supported):
- return supported[0], rest
- else:
- return '', path
-
- def get_language(self):
- """
- Return a locale code we support on the site using the
- user's Accept-Language header to determine which is best. This
- mostly follows the RFCs but read bug 439568 for details.
- """
- if 'lang' in self.request.GET:
- lang = self.request.GET['lang'].lower()
- if lang in settings.LANGUAGE_URL_MAP:
- return settings.LANGUAGE_URL_MAP[lang]
-
- if self.request.META.get('HTTP_ACCEPT_LANGUAGE'):
- best = self.get_best_language(
- self.request.META['HTTP_ACCEPT_LANGUAGE'])
- if best:
- return best
- return settings.LANGUAGE_CODE
-
- def get_best_language(self, accept_lang):
- """Given an Accept-Language header, return the best-matching language."""
- LUM = settings.LANGUAGE_URL_MAP
- PREFIXES = dict((x.split('-')[0], LUM[x]) for x in LUM)
- langs = dict(LUM)
- langs.update((k.split('-')[0], v) for k, v in LUM.items() if
- k.split('-')[0] not in langs)
- ranked = parse_accept_lang_header(accept_lang)
- for lang, _ in ranked:
- lang = lang.lower()
- if lang in langs:
- return langs[lang]
- pre = lang.split('-')[0]
- if pre in langs:
- return langs[pre]
- # Could not find an acceptable language.
- return False
-
- def fix(self, path):
- path = path.lstrip('/')
- url_parts = [self.request.META['SCRIPT_NAME']]
-
- if path.partition('/')[0] not in settings.SUPPORTED_NONLOCALES:
- locale = self.locale if self.locale else self.get_language()
- url_parts.append(locale)
-
- url_parts.append(path)
-
- return '/'.join(url_parts)
View
6 apps/phonebook/models.py
@@ -5,9 +5,8 @@
from django.db import models
from django.dispatch import receiver
-from commons.helpers import absolutify
-from commons.urlresolvers import reverse
-from manage import path
+from funfactory.urlresolvers import reverse
+from funfactory.utils import absolutify
class Invite(models.Model):
@@ -26,7 +25,6 @@ class Meta:
db_table = 'invite'
-
@receiver(models.signals.pre_save, sender=Invite)
def generate_code(sender, instance, raw, using, **kwargs):
if instance.code:
View
5 apps/phonebook/tests/__init__.py
@@ -5,8 +5,8 @@
import test_utils
from nose.tools import eq_
-from commons.urlresolvers import reverse
-from manage import path
+from funfactory.urlresolvers import reverse
+from funfactory.manage import path
# The test data (below in module constants) must match data in
# directory/testsuite/mozillians-bulk-test-data.ldif
@@ -32,6 +32,7 @@ def pending_user_client():
client = test.Client()
url = reverse('login')
r = client.post(url, data, follow=True)
+ eq_(r.status_code, 200, "Something broke. Got a %d error." % r.status_code)
eq_(PENDING['email'], str(r.context['user']))
return client
View
2  apps/phonebook/tests/test_invites.py
@@ -3,7 +3,7 @@
from nose.tools import eq_
from pyquery import PyQuery as pq
-from commons.urlresolvers import reverse
+from funfactory.urlresolvers import reverse
from phonebook.models import Invite
from phonebook.tests import LDAPTestCase
View
2  apps/phonebook/tests/test_views.py
@@ -6,7 +6,7 @@
from pyquery import PyQuery as pq
import test_utils
-from commons.urlresolvers import reverse
+from funfactory.urlresolvers import reverse
from phonebook.views import UNAUTHORIZED_DELETE
# The test data (below in module constants) must matches data in
View
2  apps/phonebook/views.py
@@ -13,7 +13,7 @@
from tower import ugettext as _
import commonware.log
-from commons.urlresolvers import reverse
+from funfactory.urlresolvers import reverse
from larper import UserSession, AdminSession, NO_SUCH_PERSON
from larper import MOZILLA_IRC_SERVICE_URI
from phonebook import forms
View
7 apps/users/urls.py
@@ -2,7 +2,8 @@
from django.contrib.auth import views as auth_views, forms as auth_forms
-from commons import jinja_for_django
+from jinjautils import jinja_for_django
+from session_csrf import anonymous_csrf
from . import views
@@ -11,8 +12,8 @@
urlpatterns = patterns('',
- url(r'^login', auth_views.login, name='login'),
- url(r'^logout', auth_views.logout, dict(redirect_field_name='next'),
+ url(r'^login', anonymous_csrf(auth_views.login), name='login'),
+ url(r'^logout', auth_views.logout, dict(redirect_field_name='next'),
name='logout'),
url(r'^register', views.register, name='register'),
)
View
1  apps/commons/__init__.py → lib/jinjautils.py
@@ -37,3 +37,4 @@ def jinja_for_django(template_name, context=None, **kw):
for d in context_instance.dicts:
context.update(d)
return jingo.render(request, template_name, context, **kw)
+
View
67 manage.py
@@ -1,66 +1,25 @@
#!/usr/bin/env python
import os
-import site
import sys
-ROOT = os.path.dirname(os.path.abspath(__file__))
-path = lambda *a: os.path.join(ROOT,*a)
-
-
-# Adjust the python path and put local packages in front.
-prev_sys_path = list(sys.path)
-
-site.addsitedir(path('apps'))
-site.addsitedir(path('lib'))
-
-# Local (project) vendor library
-site.addsitedir(path('vendor-local'))
-site.addsitedir(path('vendor-local/lib/python'))
-
-# Global (upstream) vendor library
-site.addsitedir(path('vendor'))
-site.addsitedir(path('vendor/lib/python'))
-
-
-# Move the new items to the front of sys.path. (via virtualenv)
-new_sys_path = []
-for item in list(sys.path):
- if item not in prev_sys_path:
- new_sys_path.append(item)
- sys.path.remove(item)
-sys.path[:0] = new_sys_path
-sys.path.insert(0, path(''))
-
-from django.core.management import execute_manager, setup_environ
-
try:
- import settings_local as settings
+ # For local development in a virtualenv:
+ from funfactory import manage
except ImportError:
- try:
- import settings
- except ImportError:
- import sys
- sys.stderr.write(
- "Error: Tried importing 'settings_local.py' and 'settings.py' "
- "but neither could be found (or they're throwing an ImportError)."
- " Please come back and try again later.")
- raise
+ # Production:
+ # Add a temporary path so that we can import the funfactory
+ tmp_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
+ 'vendor', 'src', 'funfactory')
+ sys.path.append(tmp_path)
-# If we want to use django settings anywhere, we need to set up the required
-# environment variables.
-setup_environ(settings)
+ from funfactory import manage
-# Configure Celery
-import djcelery
-djcelery.setup_loader()
+ # Let the path magic happen in setup_environ() !
+ sys.path.remove(tmp_path)
-# Import for side-effect: configures our logging handlers.
-# pylint: disable-msg=W0611
-import log_settings
-# Monkey-patch django forms to avoid having to use Jinja2's |safe everywhere.
-import safe_django_forms
-safe_django_forms.monkeypatch()
+manage.setup_environ(__file__)
if __name__ == "__main__":
- execute_manager(settings)
+ manage.main()
+
View
2  migrations/03-invite.sql
@@ -1,4 +1,4 @@
-DROP TABLE invite; -- things we can do before we launch.
+DROP TABLE IF EXISTS invites; -- things we can do before we launch.
CREATE TABLE `invite` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
View
9 puppet/manifests/classes/memcached.pp
@@ -0,0 +1,9 @@
+# Get memcached up and running
+class memcached {
+ package { "memcached": ensure => installed; }
+ service { "memcached":
+ ensure => running,
+ enable => true,
+ require => Package['memcached']
+ }
+}
View
1  puppet/manifests/dev-vagrant.pp
@@ -21,6 +21,7 @@
mysql: before => Class[python];
python: before => Class[apache];
apache: before => Class[playdoh_site];
+ memcached:;
playdoh_site: ;
}
}
View
5 requirements/prod.txt
@@ -1,3 +1,5 @@
+-r ../vendor/src/funfactory/funfactory/requirements/prod.txt
+
# Django stuff
-e git://github.com/django/django@36c82ac8#egg=django
@@ -24,3 +26,6 @@ Babel>=0.9.4
# Auth
django-auth-ldap
+
+# Cache
+python-memcached==1.45
View
213 settings.py
@@ -1,120 +1,36 @@
# -*- coding: utf-8 -*-
+
# Django settings for the mozillians project.
import ldap
-import logging
-import os
-import socket
-
-from django.utils.functional import lazy
from django_auth_ldap.config import _LDAPConfig, LDAPSearch
-# Make file paths relative to settings.
-ROOT = os.path.dirname(os.path.abspath(__file__))
-path = lambda *a: os.path.join(ROOT, *a)
-
-ROOT_PACKAGE = os.path.basename(ROOT)
-
-
-DEBUG = False
-TEMPLATE_DEBUG = DEBUG
-
-ADMINS = ()
-MANAGERS = ADMINS
-
-DATABASES = {} # See settings_local.
+from funfactory.settings_base import *
## Log settings
-LOG_LEVEL = logging.DEBUG
-HAS_SYSLOG = True
-SYSLOG_TAG = "http_app_reporter"
-LOGGING_CONFIG = None
+SYSLOG_TAG = "http_app_mozillians"
LOGGING = {
'loggers': {
- 'i.landing': {'level': logging.INFO},
- 'i.phonebook': {'level': logging.INFO},
+ 'landing': {'level': logging.INFO},
+ 'phonebook': {'level': logging.INFO},
},
}
-
-# Site ID is used by Django's Sites framework.
-SITE_ID = 1
-
-
-## Internationalization.
-
-# Local time zone for this installation. Choices can be found here:
-# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
-# although not all choices may be available on all operating systems.
-# On Unix systems, a value of None will cause Django to use the same
-# timezone as the operating system.
-# If running in a Windows environment this must be set to the same as your
-# system time zone.
-TIME_ZONE = 'Europe/London'
-
-# If you set this to False, Django will make some optimizations so as not
-# to load the internationalization machinery.
-USE_I18N = True
-
-# If you set this to False, Django will not format dates, numbers and
-# calendars according to the current locale
-USE_L10N = True
LOCALE_PATHS = [path('locale')]
-# Gettext text domain
-TEXT_DOMAIN = 'messages'
-# Language code for this installation. All choices can be found here:
-# http://www.i18nguy.com/unicode/language-identifiers.html
-LANGUAGE_CODE = 'en-US'
# Accepted locales
-KNOWN_LANGUAGES = ('en-US', 'de', 'fr')
+PROD_LANGUAGES = ('en-US', 'de', 'fr')
# List of RTL locales known to this project. Subset of LANGUAGES.
RTL_LANGUAGES = () # ('ar', 'fa', 'fa-IR', 'he')
-LANGUAGE_URL_MAP = dict([(i.lower(), i) for i in KNOWN_LANGUAGES])
-
-
-# Override Django's built-in with our native names
-class LazyLangs(dict):
- def __new__(self):
- from product_details import product_details
- return dict([(lang.lower(), product_details.languages[lang]['native'])
- for lang in KNOWN_LANGUAGES])
-
-# Where to store product details etc.
-PROD_DETAILS_DIR = path('lib/product_details_json')
-
-LANGUAGES = lazy(LazyLangs, dict)()
-
-# Paths that don't require a locale code in the URL.
-SUPPORTED_NONLOCALES = []
-
# For absoluate urls
-DOMAIN = socket.gethostname()
PROTOCOL = "https://"
PORT = 443
## Media and templates.
-# Absolute path to the directory that holds media.
-# Example: "/home/media/media.lawrence.com/"
-MEDIA_ROOT = path('media')
-
-# URL that handles the media served from MEDIA_ROOT. Make sure to use a
-# trailing slash if there is a path component (optional in other cases).
-# Examples: "http://media.lawrence.com", "http://example.com/media/"
-MEDIA_URL = '/media/'
-
-# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
-# trailing slash.
-# Examples: "http://foo.com/media/", "/media/".
-ADMIN_MEDIA_PREFIX = '/admin-media/'
-
-# Make this unique, and don't share it with anybody.
-SECRET_KEY = '1iz#v0m55@h26^m6hxk3a7at*h$qj_2a$juu1#nv50548j(x1v'
-
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'jingo.Loader',
@@ -123,32 +39,6 @@ def __new__(self):
# 'django.template.loaders.eggs.Loader',
)
-TEMPLATE_CONTEXT_PROCESSORS = (
- 'django.contrib.auth.context_processors.auth',
- 'django.core.context_processors.debug',
- 'django.core.context_processors.media',
- 'django.core.context_processors.request',
- 'django.core.context_processors.csrf',
- 'django.contrib.messages.context_processors.messages',
-
- 'commons.context_processors.i18n',
- #'jingo_minify.helpers.build_ids',
-)
-
-TEMPLATE_DIRS = (
- path('templates'),
-)
-
-
-def JINJA_CONFIG():
- import jinja2
- config = {'extensions': ['tower.template.i18n', 'jinja2.ext.do',
- 'jinja2.ext.with_', 'jinja2.ext.loopcontrols'],
- 'finalize': lambda x: x if x is not None else ''}
- return config
-
-# Bundles is a dictionary of two dictionaries, css and js, which list css files
-# and js files that can be bundled together by the minify app.
MINIFY_BUNDLES = {
'css': {
'common': (
@@ -166,19 +56,9 @@ def JINJA_CONFIG():
}
-## Middlewares, apps, URL configs.
-
-MIDDLEWARE_CLASSES = (
- 'commons.middleware.LocaleURLMiddleware',
- 'django.middleware.common.CommonMiddleware',
- 'django.contrib.sessions.middleware.SessionMiddleware',
- 'django.middleware.csrf.CsrfViewMiddleware',
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
+MIDDLEWARE_CLASSES = list(MIDDLEWARE_CLASSES) + [
'larper.middleware.LarperMiddleware',
- 'django.contrib.messages.middleware.MessageMiddleware',
-
- 'commonware.middleware.FrameOptionsHeader',
-)
+]
# OpenLDAP
LDAP_USERS_GROUP = 'ou=people,dc=mozillians,dc=org'
@@ -199,72 +79,21 @@ def JINJA_CONFIG():
AUTH_LDAP_ALWAYS_UPDATE_USER = False
-ROOT_URLCONF = '%s.urls' % ROOT_PACKAGE
-
-INSTALLED_APPS = (
+INSTALLED_APPS = list(INSTALLED_APPS) + [
'landing',
'phonebook',
'users',
'larper',
# Local apps
- 'commons', # Content common to most playdoh-based apps.
'jingo_minify',
'tower', # for ./manage.py extract (L10n)
- # We need this so the jsi18n view will pick up our locale directory.
- ROOT_PACKAGE,
-
- # Third-party apps
- 'commonware.response.cookies',
- 'djcelery',
- 'django_nose',
-
- # Django contrib apps
- 'django.contrib.auth',
- 'django_sha2', # Load after auth to monkey-patch it. TODO - not needed?
-
- 'django.contrib.contenttypes',
- 'django.contrib.sessions',
- # 'django.contrib.sites',
- # 'django.contrib.messages',
'django.contrib.admin',
'django.contrib.auth',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
-
- # L10n
- 'product_details',
-)
-
-# Tells the extract script what files to look for L10n in and what function
-# handles the extraction. The Tower library expects this.
-DOMAIN_METHODS = {
- 'messages': [
- ('apps/**.py',
- 'tower.management.commands.extract.extract_tower_python'),
- ('apps/**/templates/**.html',
- 'tower.management.commands.extract.extract_tower_template'),
- ('templates/**.html',
- 'tower.management.commands.extract.extract_tower_template'),
- ],
-
- ## Use this if you have localizable HTML files:
- #'lhtml': [
- # ('**/templates/**.lhtml',
- # 'tower.management.commands.extract.extract_tower_template'),
- #],
-
- ## Use this if you have localizable JS files:
- #'javascript': [
- # Make sure that this won't pull in strings from external libraries you
- # may use.
- # ('media/js/**.js', 'javascript'),
- #],
-}
-
-# Path to Java. Used for compress_assets.
-JAVA_BIN = '/usr/bin/java'
+]
## Auth
PWD_ALGORITHM = 'bcrypt'
@@ -272,19 +101,6 @@ def JINJA_CONFIG():
'2011-01-01': 'cheesecake',
}
-## Tests
-TEST_RUNNER = 'test_utils.runner.RadicalTestSuiteRunner'
-
-## Celery
-BROKER_HOST = 'localhost'
-BROKER_PORT = 5672
-BROKER_USER = 'playdoh'
-BROKER_PASSWORD = 'playdoh'
-BROKER_VHOST = 'playdoh'
-BROKER_CONNECTION_TIMEOUT = 0.1
-CELERY_RESULT_BACKEND = 'amqp'
-CELERY_IGNORE_RESULT = True
-
SESSION_COOKIE_HTTPONLY = True
SESSION_ENGINE = "django.contrib.sessions.backends.signed_cookies"
@@ -293,3 +109,12 @@ def JINJA_CONFIG():
# Auth
LOGIN_URL = '/login'
+LOGIN_REDIRECT_URL = '/'
+
+CACHES = {
+ 'default': {
+ 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
+ 'LOCATION': '127.0.0.1:11211',
+ }
+}
+
2  vendor
@@ -1 +1 @@
-Subproject commit 3cbae804bd1e7a32ebe8db079f599b73b858986b
+Subproject commit 41056d0449834f0366f3fc6cc9f3d7f76e3efe3e
Please sign in to comment.
Something went wrong with that request. Please try again.