mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-26 11:34:00 +03:00
Inspired by @natea, Make the deploy to Heroku instructions nicely formatted and EMAIL_BACKEND default
This commit is contained in:
parent
3680c7b60e
commit
73824b1e97
|
@ -9,21 +9,25 @@ LICENSE: BSD
|
|||
Deployment
|
||||
------------
|
||||
|
||||
* heroku create
|
||||
* heroku addons:add heroku-postgresql:dev
|
||||
* heroku addons:add pgbackups
|
||||
* heroku addons:add sendgrid:starter
|
||||
* heroku addons:add memcachier:dev
|
||||
* heroku pg:promote HEROKU_POSTGRESQL_COLOR
|
||||
* heroku config:add DJANGO_CONFIGURATION=Production
|
||||
* heroku config:add DJANGO_SECRET_KEY=RANDOM_SECRET_KEY
|
||||
* heroku config:add DJANGO_AWS_ACCESS_KEY_ID=YOUR_ID
|
||||
* heroku config:add DJANGO_AWS_SECRET_ACCESS_KEY=YOUR_KEY
|
||||
* heroku config:add DJANGO_AWS_STORAGE_BUCKET_NAME=BUCKET
|
||||
* git push heroku master
|
||||
* heroku run python {{cookiecutter.repo_name}}/manage.py syncdb --noinput --settings=config.settings
|
||||
* heroku run python {{cookiecutter.repo_name}}/manage.py migrate --settings=config.settings
|
||||
* heroku run python {{cookiecutter.repo_name}}/manage.py collectstatic --settings=config.settings
|
||||
Run these commands to deploy the project to Heroku:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
heroku create
|
||||
heroku addons:add heroku-postgresql:dev
|
||||
heroku addons:add pgbackups
|
||||
heroku addons:add sendgrid:starter
|
||||
heroku addons:add memcachier:dev
|
||||
heroku pg:promote HEROKU_POSTGRESQL_COLOR
|
||||
heroku config:add DJANGO_CONFIGURATION=Production
|
||||
heroku config:add DJANGO_SECRET_KEY=RANDOM_SECRET_KEY
|
||||
heroku config:add DJANGO_AWS_ACCESS_KEY_ID=YOUR_ID
|
||||
heroku config:add DJANGO_AWS_SECRET_ACCESS_KEY=YOUR_KEY
|
||||
heroku config:add DJANGO_AWS_STORAGE_BUCKET_NAME=BUCKET
|
||||
git push heroku master
|
||||
heroku run python {{cookiecutter.repo_name}}/manage.py syncdb --noinput --settings=config.settings
|
||||
heroku run python {{cookiecutter.repo_name}}/manage.py migrate --settings=config.settings
|
||||
heroku run python {{cookiecutter.repo_name}}/manage.py collectstatic --settings=config.settings
|
||||
|
||||
Run this script: (TODO - automate this)
|
||||
|
||||
|
|
|
@ -100,6 +100,10 @@ class Common(Configuration):
|
|||
join(BASE_DIR, 'fixtures'),
|
||||
)
|
||||
########## END FIXTURE CONFIGURATION
|
||||
|
||||
########## EMAIL CONFIGURATION
|
||||
EMAIL_BACKEND = values.Value('django.core.mail.backends.smtp.EmailBackend')
|
||||
########## END EMAIL CONFIGURATION
|
||||
|
||||
########## MANAGER CONFIGURATION
|
||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#admins
|
||||
|
@ -357,7 +361,6 @@ class Production(Common):
|
|||
########## EMAIL
|
||||
DEFAULT_FROM_EMAIL = values.Value(
|
||||
'{{cookiecutter.project_name}} <{{cookiecutter.project_name}}-noreply@{{cookiecutter.domain_name}}>')
|
||||
EMAIL_BACKEND = values.Value('django.core.mail.backends.smtp.EmailBackend')
|
||||
EMAIL_HOST = values.Value('smtp.sendgrid.com')
|
||||
EMAIL_HOST_PASSWORD = values.SecretValue(environ_prefix="", environ_name="SENDGRID_PASSWORD")
|
||||
EMAIL_HOST_USER = values.SecretValue(environ_prefix="", environ_name="SENDGRID_USERNAME")
|
||||
|
|
Loading…
Reference in New Issue
Block a user