mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-01-23 15:54:12 +03:00
Now includes message for missing .env file. Fixed #819
This commit is contained in:
parent
c4ad073f0d
commit
d31e86fc8a
|
@ -1,5 +1,6 @@
|
||||||
"""Converts a .env file to Elastic Beanstalk environment variables"""
|
"""Converts a .env file to Elastic Beanstalk environment variables"""
|
||||||
|
|
||||||
|
import os
|
||||||
from sys import exit
|
from sys import exit
|
||||||
from subprocess import check_call
|
from subprocess import check_call
|
||||||
|
|
||||||
|
@ -10,10 +11,15 @@ except ImportError:
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
if not os.path.exists('.env'):
|
||||||
|
print('ERROR!! .env file is missing!')
|
||||||
|
print("Please copy 'env.example' to '.env' and add appropriate values")
|
||||||
|
exit()
|
||||||
command = ['eb', 'setenv']
|
command = ['eb', 'setenv']
|
||||||
failures = []
|
failures = []
|
||||||
for key, value in dotenv.Dotenv('.env').items():
|
for key, value in dotenv.Dotenv('.env').items():
|
||||||
if key.startswith('POSTGRES'):
|
if key.startswith('POSTGRES'):
|
||||||
|
print('Skipping POSTGRES values - Amazon RDS provides these')
|
||||||
continue
|
continue
|
||||||
if value:
|
if value:
|
||||||
command.append("{}={}".format(key, value))
|
command.append("{}={}".format(key, value))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user