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"""
|
||||
|
||||
import os
|
||||
from sys import exit
|
||||
from subprocess import check_call
|
||||
|
||||
|
@ -10,10 +11,15 @@ except ImportError:
|
|||
exit()
|
||||
|
||||
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']
|
||||
failures = []
|
||||
for key, value in dotenv.Dotenv('.env').items():
|
||||
if key.startswith('POSTGRES'):
|
||||
print('Skipping POSTGRES values - Amazon RDS provides these')
|
||||
continue
|
||||
if value:
|
||||
command.append("{}={}".format(key, value))
|
||||
|
|
Loading…
Reference in New Issue
Block a user