From 0193d6078b98241bb5d15a83e37b3b54853dc891 Mon Sep 17 00:00:00 2001 From: palewire Date: Tue, 12 Aug 2014 15:46:16 -0700 Subject: [PATCH] Preconfiguration of the project settings and requirements to work a little more smoothly out of the box. cc @aboutaaron --- .gitignore | 1 + example/manage.py | 3 +- example/project/settings.py | 74 ++++++++++++------------------------- requirements_dev.txt | 5 ++- 4 files changed, 28 insertions(+), 55 deletions(-) diff --git a/.gitignore b/.gitignore index b1cb867..c274d1a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +example/project/settings_local.py *.pyc *.swp .DS_Store diff --git a/example/manage.py b/example/manage.py index 82cfa83..fd779c1 100644 --- a/example/manage.py +++ b/example/manage.py @@ -4,7 +4,6 @@ if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings") - + sys.path.append(os.path.dirname(os.path.dirname(__file__))) from django.core.management import execute_from_command_line - execute_from_command_line(sys.argv) diff --git a/example/project/settings.py b/example/project/settings.py index 29dced2..f13d4ea 100644 --- a/example/project/settings.py +++ b/example/project/settings.py @@ -1,33 +1,18 @@ -""" -Django settings for project project. - -For more information on this file, see -https://docs.djangoproject.com/en/1.6/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/1.6/ref/settings/ -""" - -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'r269$heh9at2cot+5l$*$4&xzwsfbbg0&&^prr+e&oh)_4-+ga' - -# SECURITY WARNING: don't run with debug turned on in production! DEBUG = True - TEMPLATE_DEBUG = True - +LANGUAGE_CODE = 'en-us' +TIME_ZONE = 'UTC' +USE_I18N = True +USE_L10N = True +USE_TZ = True +STATIC_URL = '/static/' ALLOWED_HOSTS = [] - - -# Application definition +ROOT_URLCONF = 'project.urls' +WSGI_APPLICATION = 'project.wsgi.application' INSTALLED_APPS = ( 'django.contrib.admin', @@ -36,6 +21,8 @@ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'calaccess', + 'campaign_finance', ) MIDDLEWARE_CLASSES = ( @@ -47,36 +34,21 @@ 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) -ROOT_URLCONF = 'project.urls' - -WSGI_APPLICATION = 'project.wsgi.application' - - -# Database -# https://docs.djangoproject.com/en/1.6/ref/settings/#databases - DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + 'ENGINE': 'django.db.backends.mysql', + 'NAME': 'campaign_finance', + 'USER': 'root', + 'PASSWORD': 'mysql', + 'HOST': 'localhost', + 'PORT': '3306', + 'OPTIONS': { + 'local_infile': 1, + } } } -# Internationalization -# https://docs.djangoproject.com/en/1.6/topics/i18n/ - -LANGUAGE_CODE = 'en-us' - -TIME_ZONE = 'UTC' - -USE_I18N = True - -USE_L10N = True - -USE_TZ = True - - -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/1.6/howto/static-files/ - -STATIC_URL = '/static/' +try: + from settings_local import * +except ImportError: + pass diff --git a/requirements_dev.txt b/requirements_dev.txt index 8a5da48..9abca00 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,7 +1,7 @@ Django==1.6.5 Fabric==1.7.0 Jinja==1.2 -MySQL-python==1.2.4 +MySQL-python==1.2.5 PyYAML==3.11 SQLAlchemy==0.8.3 South==0.8.1 @@ -21,7 +21,7 @@ hurry.filesize==0.9 ipython==2.2.0 openpyxl==1.6.2 paramiko==1.11.0 -progressbar==2.3 +progressbar>=2.2 psycopg2==2.4.6 pycrypto==2.6 pyflakes==0.8.1 @@ -35,3 +35,4 @@ sh==1.09 six==1.4.1 tornado==3.2 xlrd==0.9.2 +django-calaccess-parser==0.4