Now with production capabilities.

master
Michael Kennedy 8 years ago
parent fca73115a3
commit 457cad7764

@ -1,5 +1,22 @@
import ssl
import mongoengine import mongoengine
def global_init(): def global_init(user=None, password=None, port=27017, server='localhost', use_ssl=True):
mongoengine.register_connection(alias='core', name='demo_dealership') if user or password:
data = dict(
username=user,
password=password,
host=server,
port=port,
authentication_source='admin',
authentication_mechanism='SCRAM-SHA-1',
ssl=use_ssl,
ssl_cert_reqs=ssl.CERT_NONE)
mongoengine.register_connection(alias='core', name='demo_dealership', **data)
data['password'] = '*************'
print(" --> Registering prod connection: {}".format(data))
else:
print(" --> Registering dev connection")
mongoengine.register_connection(alias='core', name='demo_dealership')

@ -22,14 +22,19 @@ def print_header():
print('----------------------------------------------') print('----------------------------------------------')
print('| |') print('| |')
print('| SERVICE CENTRAL v.02 |') print('| SERVICE CENTRAL v.02 |')
print('| demo edition |') print('| prod edition |')
print('| |') print('| |')
print('----------------------------------------------') print('----------------------------------------------')
print() print()
def config_mongo(): def config_mongo():
mongo_setup.global_init() mongo_setup.global_init(
'the_db_admin',
'the-password-3809b81f-ba37-403d-8013-a1ebaf13cf94',
10001,
'107.170.211.24'
)
def user_loop(): def user_loop():

Loading…
Cancel
Save