diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-11-19 00:20:58 -0300 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-11-19 00:20:58 -0300 |
commit | 1e597a8ee8cd2db3c37c8715410e81cc1972ddc3 (patch) | |
tree | ec9bd804faefe93a4e83bf06057e311ff3a7b3fe /askbot/deployment | |
parent | e0dcb50e48b25f7fe641d54b5338e09486b7157e (diff) | |
download | askbot-1e597a8ee8cd2db3c37c8715410e81cc1972ddc3.tar.gz askbot-1e597a8ee8cd2db3c37c8715410e81cc1972ddc3.tar.bz2 askbot-1e597a8ee8cd2db3c37c8715410e81cc1972ddc3.zip |
added mandatory generation of secret key to askbot-setup
Diffstat (limited to 'askbot/deployment')
-rw-r--r-- | askbot/deployment/__init__.py | 15 | ||||
-rw-r--r-- | askbot/deployment/messages.py | 3 |
2 files changed, 11 insertions, 7 deletions
diff --git a/askbot/deployment/__init__.py b/askbot/deployment/__init__.py index 6be1528f..fd4fd20f 100644 --- a/askbot/deployment/__init__.py +++ b/askbot/deployment/__init__.py @@ -9,6 +9,7 @@ from askbot.deployment import messages from askbot.deployment.messages import print_message from askbot.deployment import path_utils from askbot.utils import console +from askbot.utils.functions import generate_random_key DATABASE_ENGINE_CHOICES = ('1', '2', '3', '4') @@ -129,7 +130,6 @@ def askbot_setup(): #separated all the directory creation process to make it more useful - def deploy_askbot(options): """function that creates django project files, all the neccessary directories for askbot, @@ -186,21 +186,26 @@ def deploy_askbot(options): ) def collect_missing_options(options_dict): + options_dict['secret_key'] = generate_random_key() if options_dict['database_engine'] == '2':#sqlite while True: value = console.simple_dialog( 'Please enter database file name' ) + database_file_name = None if os.path.isfile(value): - print 'file %s exists, please choose another' % value + message = 'file %s exists, use it anyway?' % value + if console.get_yes_or_no(message) == 'yes': + database_file_name = value elif os.path.isdir(value): print '%s is a directory, choose another name' % value elif value in path_utils.FILES_TO_CREATE: print 'name %s cannot be used for the database name' % value elif value == path_utils.LOG_DIR_NAME: print 'name %s cannot be used for the database name' % value - else: - options_dict['database_name'] = value + + if database_file_name: + options_dict['database_name'] = database_file_name return options_dict else:#others @@ -208,7 +213,7 @@ def collect_missing_options(options_dict): if options_dict[key] is None: key_name = key.replace('_', ' ') value = console.simple_dialog( - 'Please enter %s' % key_name, + '\nPlease enter %s' % key_name, required=True ) options_dict[key] = value diff --git a/askbot/deployment/messages.py b/askbot/deployment/messages.py index 0d264695..f2c512bc 100644 --- a/askbot/deployment/messages.py +++ b/askbot/deployment/messages.py @@ -19,8 +19,7 @@ CANT_INSTALL_INTO_FILE = '%(path)s is a file\ncannot install there' SHOULD_ADD_APP_HERE = 'Directory %(path)s?\nalready has a Django ' \ + 'project - do you want to add askbot app to that project?' -HOW_TO_DEPLOY_NEW = 'Done. Please find further instructions in the file below:'\ - + '\n%(help_file)s' +HOW_TO_DEPLOY_NEW = 'Done. Please find further instructions at http://askbot.org/doc/' HOW_TO_ADD_ASKBOT_TO_DJANGO = HOW_TO_DEPLOY_NEW |