From 3377c90fa54af62f69db99c91b69f6c6b9aac379 Mon Sep 17 00:00:00 2001 From: Brandon Savage Date: Thu, 20 Sep 2012 11:08:11 -0400 Subject: [PATCH] Preparing tuxedo for deployment on new IT machines, including: * Creating a settings-dist.py file for distribution purposes * Upgrading the settings file for compatibility with Django 1.4.1 * Creating a vendor/ directory to hold Python dependencies * Adding a requirements file for items that must be compied or added separately Updating submodule. --- .gitmodules | 4 ++ apps/users/templates/registration/login.html | 1 + requirements/compiled.txt | 2 + requirements/dev.txt | 0 requirements/prod.txt | 3 ++ settings.py => settings-dist.py | 39 ++++++++++---------- vendor | 1 + 7 files changed, 31 insertions(+), 19 deletions(-) create mode 100644 .gitmodules create mode 100644 requirements/compiled.txt create mode 100644 requirements/dev.txt create mode 100644 requirements/prod.txt rename settings.py => settings-dist.py (79%) create mode 160000 vendor diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..5104146 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ + +[submodule "vendor"] + path = vendor + url = git@github.com:mozilla/tuxedo-lib.git diff --git a/apps/users/templates/registration/login.html b/apps/users/templates/registration/login.html index d285a2e..0b02df5 100644 --- a/apps/users/templates/registration/login.html +++ b/apps/users/templates/registration/login.html @@ -6,6 +6,7 @@

{% block title %}Login{% endblock %}

+ {% csrf_token %} {{ form.as_table }}
diff --git a/requirements/compiled.txt b/requirements/compiled.txt new file mode 100644 index 0000000..4a2e540 --- /dev/null +++ b/requirements/compiled.txt @@ -0,0 +1,2 @@ +MySQL-python==1.2.3c1 +python-memcached==1.45 diff --git a/requirements/dev.txt b/requirements/dev.txt new file mode 100644 index 0000000..e69de29 diff --git a/requirements/prod.txt b/requirements/prod.txt new file mode 100644 index 0000000..1921d20 --- /dev/null +++ b/requirements/prod.txt @@ -0,0 +1,3 @@ +ipaddr==2.0.0 +git+git://github.com/fwenzel/django-mozilla-product-details#egg=django-mozilla-product-details +Markdown==2.0.3 \ No newline at end of file diff --git a/settings.py b/settings-dist.py similarity index 79% rename from settings.py rename to settings-dist.py index c1ac0d4..07e9d8a 100644 --- a/settings.py +++ b/settings-dist.py @@ -17,17 +17,26 @@ MANAGERS = ADMINS -DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. -DATABASE_NAME = 'bouncer.db' # Or path to database file if using sqlite3. -DATABASE_USER = '' # Not used with sqlite3. -DATABASE_PASSWORD = '' # Not used with sqlite3. -DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. -DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. - -if (DATABASE_ENGINE == 'mysql'): - DATABASE_OPTIONS = { - "init_command": "SET storage_engine=INNODB", - } +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.mysql', + 'NAME': 'bouncer.db', + 'USER': '', + 'PASSWORD': '', + 'HOST': '', + 'PORT': '', + 'OPTIONS': { + 'init_command': 'SET storage_engine=InnoDB', + 'charset' : 'utf8', + 'use_unicode' : True, + }, + 'TEST_CHARSET': 'utf8', + 'TEST_COLLATION': 'utf8_general_ci', + }, + # 'slave': { + # ... + # }, +} # Cache Backend. Set up memcache here. Examples: #CACHE_BACKEND = 'memcached://172.19.26.240:11211;172.19.26.242:11211/' @@ -67,19 +76,11 @@ # Make this unique, and don't share it with anybody. SECRET_KEY = '### change me ###' -# List of callables that know how to import templates from various sources. -TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.load_template_source', - 'django.template.loaders.app_directories.load_template_source', -# 'django.template.loaders.eggs.load_template_source', -) - MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', - 'django.middleware.csrf.CsrfResponseMiddleware', ) # auth backends: uses django first, and converts old Bouncer users as needed diff --git a/vendor b/vendor new file mode 160000 index 0000000..7e8c8af --- /dev/null +++ b/vendor @@ -0,0 +1 @@ +Subproject commit 7e8c8af20be23879692dc46d26ff29abd4fa30f1