Fixed config and README cleanup

This commit is contained in:
Daniel Roy Greenfeld 2016-09-22 17:38:22 -07:00
parent 68b808aa9b
commit ce8a711cf6
3 changed files with 36 additions and 1 deletions

View File

@ -6,9 +6,9 @@ container_commands:
command: "source /opt/python/run/venv/bin/activate && python manage.py collectstatic --noinput"
option_settings:
"aws:elasticbeanstalk:application:environment":
DJANGO_SETTINGS_MODULE: "config.settings.production"
REDIS_ENDPOINT_ADDRESS: '`{ "Fn::GetAtt" : [ "MyElastiCache", "RedisEndpoint.Address"]}`'
REDIS_PORT: '`{ "Fn::GetAtt" : [ "MyElastiCache", "RedisEndpoint.Port"]}`'
option_settings:
"aws:elasticbeanstalk:container:python":
WSGIPath: "config/wsgi.py"
NumProcesses: 3

View File

@ -138,3 +138,36 @@ See detailed `cookiecutter-django Docker documentation`_.
.. _`cookiecutter-django Docker documentation`: http://cookiecutter-django.readthedocs.io/en/latest/deployment-with-docker.html
{% endif %}
{% if cookiecutter.use_elasticbeanstalk %}
Elastic Beanstalk
~~~~~~~~~~~~~~~~~~
```
# creates the directory of environments (servers)
eb init -p python3.4 {{ cookiecutter.project_slug }}
# Creates the environment (server) where the app will run
eb create {{ cookiecutter.project_slug }}
# Note: This will fail on a postgres error, because postgres doesn't exist yet
# Make sure you are in the right environment
eb list
# If you are not in the right environment
eb use {{ cookiecutter.project_slug }}
# Set the environment variables
python ebsetenv.py
# Go to EB AWS config. Create new RDS database (postgres, 9.4.9, db.t2.micro)
# Get some coffee, this is going to take a while
# Deploy again
eb deploy
# Take a look
eb open
```
{% endif %}

View File

@ -13,6 +13,8 @@ def main():
command = ['eb', 'setenv']
failures = []
for key, value in dotenv.Dotenv('.env').items():
if key.startswith('POSTGRES'):
continue
if value:
command.append("{}={}".format(key, value))
else: