Skip to content

Commit

Permalink
17: updated app location; updated productions settings and made gunic…
Browse files Browse the repository at this point in the history
…orn default
  • Loading branch information
lazarus1331 committed Aug 11, 2018
1 parent dbc69d8 commit 86d502a
Show file tree
Hide file tree
Showing 272 changed files with 110 additions and 101 deletions.
31 changes: 0 additions & 31 deletions Dockerfile

This file was deleted.

16 changes: 0 additions & 16 deletions entrypoint.sh

This file was deleted.

Empty file modified images/upper/1-headshot.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/upper/10-headshot.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/upper/11-headshot.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/upper/12-headshot.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/upper/13-headshot.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/upper/14-headshot.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/upper/15-headshot.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/upper/16-headshot.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/upper/17-headshot.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/upper/18-headshot.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/upper/19-headshot.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/upper/2-headshot.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/upper/20-headshot.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/upper/21-headshot.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/upper/22-headshot.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/upper/23-headshot.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/upper/24-headshot.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/upper/25-headshot.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/upper/26-headshot.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/upper/27-headshot.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/upper/28-headshot.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/upper/29-headshot.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/upper/3-headshot.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/upper/30-headshot.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/upper/31-headshot.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified images/upper/4-headshot.jpg
100755 → 100644
Empty file modified images/upper/5-headshot.jpg
100755 → 100644
Empty file modified images/upper/6-headshot.jpg
100755 → 100644
Empty file modified images/upper/7-headshot.jpg
100755 → 100644
Empty file modified images/upper/8-headshot.jpg
100755 → 100644
Empty file modified images/upper/9-headshot.jpg
100755 → 100644
28 changes: 28 additions & 0 deletions src/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM python:3.6.1

LABEL maintaner="<Michael Rollins [email protected]>"

WORKDIR /usr/src/app

COPY . .

RUN mkdir logs || true

RUN apt-get update && apt-get install -y \
postgresql-client \
unixodbc \
unixodbc-dev \
freetds-bin \
freetds-dev \
tdsodbc && \
apt-get clean

RUN pip install -r requirements/production.txt

COPY ./entrypoint.sh /

EXPOSE 5120

#CMD python3 manage.py migrate && python3 manage.py runserver 0.0.0.0:5120
ENTRYPOINT /usr/src/app/entrypoint.sh

File renamed without changes.
3 changes: 2 additions & 1 deletion Vagrantfile → src/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ Vagrant.configure(2) do |config|
SHELL

config.vm.provision "ansible" do |ansible|
ansible.playbook = "ansible/inventory/vagrant/playbook.yml"
ansible.playbook = "../ansible/inventory/vagrant/playbook.yml"
end

# Install application
config.vm.provision "shell", :privileged => true, inline: <<-SHELL
source /home/vagrant/env.sh
docker-compose -f /vagrant/docker-compose.build up --force-recreate -d
SHELL

Expand Down
2 changes: 1 addition & 1 deletion ansible.cfg → src/ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

# additional paths to search for roles in, colon separated
#roles_path = /etc/ansible/roles
roles_path = ansible/roles
roles_path = ../ansible/roles

# uncomment this to disable SSH key host checking
#host_key_checking = False
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions config/settings/base.py → src/config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@

# EMAIL CONFIGURATION
# ------------------------------------------------------------------------------
EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND', default='django.core.mail.backends.smtp.EmailBackend')
#EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND', default='django.core.mail.backends.smtp.EmailBackend')

# MANAGER CONFIGURATION
# ------------------------------------------------------------------------------
# See: https://docs.djangoproject.com/en/dev/ref/settings/#admins
ADMINS = [
("""open-austin-devs""", '[email protected]'),
("""Influence Texas Admins""", '[email protected]'),
]

# See: https://docs.djangoproject.com/en/dev/ref/settings/#managers
Expand Down Expand Up @@ -269,7 +269,7 @@
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_EMAIL_VERIFICATION = 'mandatory'

ACCOUNT_ALLOW_REGISTRATION = env.bool('DJANGO_ACCOUNT_ALLOW_REGISTRATION', True)
ACCOUNT_ALLOW_REGISTRATION = env.bool('DJANGO_ACCOUNT_ALLOW_REGISTRATION', False)
ACCOUNT_ADAPTER = 'influencetx.users.adapters.AccountAdapter'
SOCIALACCOUNT_ADAPTER = 'influencetx.users.adapters.SocialAccountAdapter'

Expand Down
14 changes: 7 additions & 7 deletions config/settings/local.py → src/config/settings/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@

# Mail settings
# ------------------------------------------------------------------------------

EMAIL_PORT = 1025

EMAIL_HOST = 'localhost'
EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND',
default='django.core.mail.backends.console.EmailBackend')

#
#EMAIL_PORT = 1025
#
#EMAIL_HOST = 'localhost'
#EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND',
# default='django.core.mail.backends.console.EmailBackend')
#

# CACHING
# ------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@
# Explicit imports to suppress flake8 errors.
from .base import DATABASES, INSTALLED_APPS, MIDDLEWARE, TEMPLATES, env

# DEBUG
# ------------------------------------------------------------------------------
DEBUG = env.bool('DJANGO_DEBUG', default=False)
TEMPLATES[0]['OPTIONS']['debug'] = False

# SECRET CONFIGURATION
# ------------------------------------------------------------------------------
# See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
# Raises ImproperlyConfigured exception if DJANGO_SECRET_KEY not in os.environ
SECRET_KEY = env('DJANGO_SECRET_KEY')
SECRET_KEY = env('DJANGO_SECRET_KEY', default='O~TBa::OFqYvU**7&unz~UVP7[ACpr7aV^x8he5Kp/``s_Vuh.')


# This ensures that Django will be able to detect a secure connection
Expand Down Expand Up @@ -56,10 +61,10 @@
# ------------------------------------------------------------------------------
# Hosts/domain names that are valid for this site
# See https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
ALLOWED_HOSTS = env.list('DJANGO_ALLOWED_HOSTS', default=['influencetx.com', 'api.influencetx.com'])
ALLOWED_HOSTS = env.list('DJANGO_ALLOWED_HOSTS', default=['influencetx.com', 'app.influencetx.com', 'app.influencetexas.com'])
# END SITE CONFIGURATION

# INSTALLED_APPS += ['gunicorn', ]
INSTALLED_APPS += ['gunicorn', ]


# STORAGE CONFIGURATION
Expand Down Expand Up @@ -95,14 +100,15 @@
# Static Assets
# ------------------------
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
STATIC_URL = 'http://media.influencetx.com/static/'


# EMAIL
# ------------------------------------------------------------------------------
DEFAULT_FROM_EMAIL = env('DJANGO_DEFAULT_FROM_EMAIL',
default='influencetx <[email protected]>')
EMAIL_SUBJECT_PREFIX = env('DJANGO_EMAIL_SUBJECT_PREFIX', default='[influencetx]')
SERVER_EMAIL = env('DJANGO_SERVER_EMAIL', default=DEFAULT_FROM_EMAIL)
#DEFAULT_FROM_EMAIL = env('DJANGO_DEFAULT_FROM_EMAIL',
# default='influencetx <[email protected]>')
#EMAIL_SUBJECT_PREFIX = env('DJANGO_EMAIL_SUBJECT_PREFIX', default='[influencetx]')
#SERVER_EMAIL = env('DJANGO_SERVER_EMAIL', default=DEFAULT_FROM_EMAIL)

# Anymail with Mailgun
#INSTALLED_APPS += ['anymail', ]
Expand Down Expand Up @@ -149,6 +155,7 @@
# Sentry Configuration
#SENTRY_DSN = env('DJANGO_SENTRY_DSN')
#SENTRY_CLIENT = env('DJANGO_SENTRY_CLIENT', default='raven.contrib.django.raven_compat.DjangoClient')
#
#LOGGING = {
# 'version': 1,
# 'disable_existing_loggers': True,
Expand Down Expand Up @@ -201,7 +208,7 @@
# 'CELERY_LOGLEVEL': env.int('DJANGO_SENTRY_LOG_LEVEL', logging.INFO),
# 'DSN': SENTRY_DSN
#}
#

## Custom Admin URL, use {% url 'admin:index' %}
#ADMIN_URL = env('DJANGO_ADMIN_URL')

Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions config/urls.py → src/config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
url(settings.ADMIN_URL, admin.site.urls),

# User management
url(r'^users/', include('influencetx.users.urls', namespace='users')),
url(r'^accounts/', include('allauth.urls')),
# url(r'^users/', include('influencetx.users.urls', namespace='users')),
# url(r'^accounts/', include('allauth.urls')),

# Custom urls
url(r'^bills/', include('influencetx.bills.urls', namespace='bills')),
Expand Down
9 changes: 5 additions & 4 deletions config/wsgi.py → src/config/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
application = get_wsgi_application()
if os.environ.get('DJANGO_SETTINGS_MODULE') == 'config.settings.production':
application = Sentry(application)
#if os.environ.get('DJANGO_SETTINGS_MODULE') == 'config.settings.production':
# application = Sentry(application)

# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)
#from influencetx.wsgi import influencetx
#application = influencetx(application)
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 9 additions & 5 deletions docker-compose.build → src/docker-compose.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ services:
web:
build:
context: .
args:
- BUILD_ENVIRONMENT=local
image: inftxdb:dev
image: inftxos:0.1.85
environment:
- DATABASE_URL=psql://postgres:mysecretpassword@localhost:5432/influencetx
- OPENSTATES_API_KEY=${OPENSTATES_API_KEY}
Expand All @@ -19,8 +17,14 @@ services:
- TPJ_DB_ENGINE=${TPJ_DB_ENGINE}
- ODBCSYSINI=/usr/src/app/docker_config_files
- ODBCINI=/usr/src/app/docker_config_files/odbc.ini
volumes:
- .:/usr/src/app
network_mode: "host"
ports:
- "5120:5120"

redis:
image: redis:alpine
container_name: redis
network_mode: "host"
ports:
- "6379:6379"

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions src/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash -x

# Prepare log files and start outputting logs to stdout
touch logs/gunicorn.log
touch logs/gunicorn-access.log
tail -n 0 -f logs/gunicorn*.log &

export DJANGO_SETTINGS_MODULE=config.settings.production
exec gunicorn influencetx \
--bind 0.0.0.0:5120 \
--workers 4 \
--log-level=debug \
--log-file=./logs/gunicorn.log \
--access-logfile=./logs/gunicorn-access.log \
"$@"
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
34 changes: 17 additions & 17 deletions requirements/base.txt → src/requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,48 @@
# like Pillow and psycopg2
# See http://bitly.com/wheel-building-fails-CPython-35
# Verified bug on Python 3.5.1
wheel==0.29.0
wheel==0.31.1

django==1.11.2
django==1.11.15

# Configuration
django-environ==0.4.3
whitenoise==3.3.0
django-environ==0.4.5
whitenoise==4.0


# Forms
django-braces==1.11.0
django-crispy-forms==1.6.1
django-braces==1.13.0
django-crispy-forms==1.7.2

# Models
django-model-utils==3.0.0
django-model-utils==3.1.2

# Images
Pillow==4.1.1
Pillow==5.2.0

# Password storage
argon2-cffi==16.3.0
#argon2-cffi==18.1.0

# For user registration, either via email or social
# Well-built with regular release cycles!
django-allauth==0.32.0
django-allauth==0.36.0

# Python-PostgreSQL Database Adapter
psycopg2==2.7.1
psycopg2==2.7.5

# SQL Server Database support
pyodbc==4.0.17
django-pyodbc-azure==1.11.0.0
pyodbc==4.0.23
django-pyodbc-azure==1.11.13.1

# Unicode slugification
awesome-slugify==1.6.5

# Time zones support
pytz==2017.2
pytz==2018.5

# Redis support
django-redis==4.8.0
redis>=2.10.5
django-redis==4.9.0
redis>=2.10.6

requests==2.18.1
requests==2.19.1
requests-cache==0.4.13
File renamed without changes.
12 changes: 6 additions & 6 deletions requirements/production.txt → src/requirements/production.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@

# WSGI Handler
# ------------------------------------------------
gevent==1.2.2
gunicorn==19.7.1
gevent==1.3.5
gunicorn==19.9.0

# Static and Media Storage
# ------------------------------------------------
boto==2.47.0
django-storages-redux==1.3.2
boto==2.49.0
django-storages-redux==1.3.3


# Email backends for Mailgun, Postmark, SendGrid and more
# -------------------------------------------------------
django-anymail==0.10
#django-anymail==0.10

# Raven is the Sentry client
# --------------------------
raven==6.1.0
raven==6.9.0

# custom packages
python-dateutil
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 86d502a

Please sign in to comment.