PK tXH&eiC C planadversity/settings.py"""
Django settings for our planadversity 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/
"""
import os
import sys
from configurations import Configuration, values
class Common(Configuration):
# OPTIONS TO OVERRIDE
AWS_ACCESS_KEY_ID = values.Value()
AWS_SECRET_ACCESS_KEY = values.Value()
ADMINS = (
('Admin', 'info@planadversity.me'),
)
# You'll likely want to add your own auth model.
AUTH_USER_MODEL = 'custom_user.EmailUser'
MANAGERS = ADMINS
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(BASE_DIR, 'planadversity/apps'))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
ALLOWED_HOSTS = []
MEDITATION_START_DATE = '2015-01-01'
# Application definition
INSTALLED_APPS = (
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.redirects",
"django.contrib.sessions",
"django.contrib.sites",
"django.contrib.sitemaps",
"django.contrib.staticfiles",
"django.contrib.humanize",
'bootstrapform',
'custom_user',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.github',
'allauth.socialaccount.providers.google',
"django_extensions",
'floppyforms',
'meditations',
)
MIDDLEWARE_CLASSES = (
"django.contrib.sessions.middleware.SessionMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
STATICFILES_FINDERS = (
"django.contrib.staticfiles.finders.FileSystemFinder",
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
)
ACCOUNT_AUTHENTICATION_METHOD = "email"
ACCOUNT_USER_MODEL_USERNAME_FIELD = None
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_UNIQUE_EMAIL = True
ACCOUNT_USERNAME_REQUIRED = False
AUTHENTICATION_BACKENDS = (
"django.contrib.auth.backends.ModelBackend",
"allauth.account.auth_backends.AuthenticationBackend",)
ROOT_URLCONF = 'planadversity.urls'
WSGI_APPLICATION = 'planadversity.wsgi.application'
DATABASES = values.DatabaseURLValue('sqlite:///{0}'.format(
os.path.join(BASE_DIR, 'db.sqlite3'),
environ=True))
NEVERCACHE_KEY = values.Value('klladsf-wefkjlwef-wekjlwef--wefjlkjfslkxvl')
#CACHES = values.CacheURLValue('memcached://127.0.0.1:11211')
# Internationalization
# https://docs.djangoproject.com/en/1.6/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'America/New_York'
USE_I18N = True
USE_L10N = True
USE_TZ = True
SITE_ID = 1
ALLOWED_HOSTS = values.Value('*')
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
PROJECT_DIRNAME = BASE_DIR.split(os.sep)[-1]
CACHE_MIDDLEWARE_KEY_PREFIX = PROJECT_DIRNAME
MEDIA_URL = "/media/"
MEDIA_ROOT = os.path.join(BASE_DIR, 'public/media')
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [ os.path.join(BASE_DIR, "planadversity/templates") ],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
# Insert your TEMPLATE_CONTEXT_PROCESSORS here or use this
# list if you haven't customized them:
'django.contrib.auth.context_processors.auth',
'django.template.context_processors.debug',
'django.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.tz',
'django.core.context_processors.request',
'django.contrib.messages.context_processors.messages',
],
},
},
]
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'public/static')
STATICFILES_DIRS = (
os.path.join(BASE_DIR, "planadversity/static"),
)
#DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
AWS_STORAGE_BUCKET_NAME = 'planadversity'
AWS_HEADERS = {'ExpiresDefault': 'access plus 30 days',
'Cache-Control': 'max-age=86400', }
# Account activations automatically expire after this period
ACCOUNT_ACTIVATION_DAYS = 14
LOGIN_EXEMPT_URLS = ['', '/',
'/accounts/login/',
'login',
'/accounts/signup/']
LOGIN_URL = '/accounts/login/'
LOGIN_REDIRECT_URL = '/'
LOGOUT_URL = '/accounts/logout/'
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
}
SECRET_KEY = values.SecretValue()
class Dev(Common):
"""
The in-development settings and the default configuration.
"""
DEBUG = True
DATABASES = values.DatabaseURLValue('sqlite:///{0}'.format(
os.path.join(Common.BASE_DIR, 'db.sqlite3'),
environ=True))
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
INSTALLED_APPS = Common.INSTALLED_APPS + ('debug_toolbar',)
MIDDLEWARE_CLASSES = Common.MIDDLEWARE_CLASSES + (
'debug_toolbar.middleware.DebugToolbarMiddleware',)
class Stage(Common):
DEBUG = True
EMAIL_HOST = values.Value('localhost')
EMAIL_HOST_USER = values.Value()
EMAIL_HOST_PASSWORD = values.Value()
EMAIL_PORT = values.Value()
EMAIL_USE_TLS = values.BooleanValue(False)
class Prod(Common):
"""
The in-production settings.
"""
DEBUG = False
SECRET_KEY = values.SecretValue()
EMAIL_HOST = values.Value('localhost')
EMAIL_HOST_USER = values.Value()
EMAIL_HOST_PASSWORD = values.Value()
EMAIL_PORT = values.Value()
EMAIL_USE_TLS = values.BooleanValue(False)
DSN_VALUE = values.Value()
# If we're on production, connect to Sentry
RAVEN_CONFIG = {
'dsn': DSN_VALUE,
}
INSTALLED_APPS = Common.INSTALLED_APPS + (
'raven.contrib.django.raven_compat',)
PK tXHtTk planadversity/urls.pyfrom django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^accounts/', include('allauth.urls')),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
url(r'^', include('meditations.urls'))]
if settings.DEBUG:
import debug_toolbar
urlpatterns.append(
url(r'^__debug__/', include(debug_toolbar.urls)),
)
PK m~XHuD planadversity/__init__.py__version__ = "1.0.2"
PK EET T % planadversity/manage_planadversity.py#!/usr/bin/env python
import os
import sys
def main():
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planadversity.settings")
os.environ.setdefault("DJANGO_CONFIGURATION", "Dev")
from configurations.management import execute_from_command_line
execute_from_command_line(sys.argv)
if __name__ == "__main__":
main()
PK E}8 planadversity/wsgi.py"""
WSGI config for planadversity project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planadversity.settings")
os.environ.setdefault('DJANGO_CONFIGURATION', 'Dev')
from configurations.wsgi import get_wsgi_application
application = get_wsgi_application()
PK uXHʡ+^\ \ % planadversity/templates/homepage.html{% extends "base.html" %}
{% block header %}
You have already responded to today's meditation. If you would like to add a second response, please review your dashboard.
Adversity comes in many shapes and sizes. Some adversity, like major injury or death, can be catastrophic to our personal happiness. Other forms come in smaller, less significant forms. But we still must be prepared to choose our response wisely and compassionately.
We must accept a majority of events will be beyond our control.
Here we provide scenarios that simulate adversity that could possibly confront us.
We must control our response to the events of our lives.
Read through the scenario provide each day, and choose how you would likely respond, and how you should respond.
Finally, planning for adversity means running through all the positive, actionable steps you can take to resolve, mitigate or control a situation.
Once you've controlled your response, you must decide how you will respond. The goal is to respond in a constructive and positive manner, while avoiding unhelpful, negative emotional responses.
Feel free to email us with any questions or feedback you may have.
{% blocktrans %}You decided to cancel logging in to our site using one of your existing accounts. If this was a mistake, please proceed to sign in.{% endblocktrans %}
{% endblock %} PK E D D ? planadversity/templates/socialaccount/authentication_error.html{% extends "socialaccount/base.html" %} {% load i18n %} {% block head_title %}{% trans "Social Network Login Failure" %}{% endblock %} {% block content %}{% trans "An error occurred while attempting to login via your social network account." %}
{% endblock %} PK Ey؝ 6 planadversity/templates/socialaccount/connections.html{% extends "socialaccount/base.html" %} {% load i18n %} {% load url from future %} {% block head_title %}{% trans "Account Connections" %}{% endblock %} {% block content %}{% blocktrans %}You can sign in to your account using any of the following third party accounts:{% endblocktrans %}
{% else %}{% trans 'You currently have no social network accounts connected to this account.' %}
{% endif %}{% blocktrans with provider_name=account.get_provider.name site_name=site.name %}You are about to use your {{provider_name}} account to login to {{site_name}}. As a final step, please complete the following form:{% endblocktrans %}
{% endblock %} PK EX# # / planadversity/templates/socialaccount/base.html{% extends "account/base.html" %} PK Eurs s J planadversity/templates/socialaccount/messages/account_connected_other.txt{% load i18n %} {% blocktrans %}The social account is already connected to a different account.{% endblocktrans %} PK EtGZ Z D planadversity/templates/socialaccount/messages/account_connected.txt{% load i18n %} {% blocktrans %}The social account has been connected.{% endblocktrans %} PK ED] ] G planadversity/templates/socialaccount/messages/account_disconnected.txt{% load i18n %} {% blocktrans %}The social account has been disconnected.{% endblocktrans %} PK ELM4 4 ? planadversity/templates/socialaccount/snippets/login_extra.html{% load socialaccount %} {% providers_media_js %} PK E?T T A planadversity/templates/socialaccount/snippets/provider_list.html{% load socialaccount %} {% for provider in socialaccount.providers %} {% if provider.id == "openid" %} {% for brand in provider.get_brands %}{% trans 'The following e-mail addresses are associated with your account:' %}
{% trans 'Warning:'%} {% trans "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}
{% endif %}{% trans "This account is inactive." %}
{% endblock %} PK Eqr 1 planadversity/templates/account/password_set.html{% extends "account/base.html" %} {% load url from future %} {% load i18n %} {% block head_title %}{% trans "Set Password" %}{% endblock %} {% block content %}{% trans "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %}
{% blocktrans %}Please contact us if you have any trouble resetting your password.{% endblocktrans %}
{% endblock %} {% block extra_body %} {% endblock %} PK E|. 4 planadversity/templates/account/email_confirmed.html{% extends "account/base.html" %} {% load i18n %} {% load account %} {% block head_title %}{% trans "Confirm E-mail Address" %}{% endblock %} {% block content %}{% blocktrans with email_address.email as email %}You have confirmed that {{ email }} is an e-mail address for user {{ user_display }}.{% endblocktrans %}
{% endblock %} PK Eo6 6 <