From 8558f0d9c1c91573e51917c3adadc6dbb0426cca Mon Sep 17 00:00:00 2001 From: Antonio de la Rosa Date: Wed, 9 Dec 2015 16:14:39 +0100 Subject: [PATCH] Fixes in config_admin --- console.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/console.py b/console.py index 53c203b..4a0a52a 100644 --- a/console.py +++ b/console.py @@ -115,13 +115,25 @@ def start(): admin=input('Do you want create admin site? y/n: ') if admin=='y' or admin=='Y': - useradmin=UserAdmin() - sql=useradmin.create_table() - if not WebModel.query(WebModel, sql): - print('Error: cannot create table admin, you can create this table with padmin.py') - else: - print('Created admin site...') + try: + + shutil.copy(workdir+'/settings/config_admin.py.sample', path_settings+'/config_admin.py') + + useradmin=UserAdmin() + + sql=useradmin.create_table() + + if not WebModel.query(WebModel, sql): + print('Error: cannot create table admin, you can create this table with padmin.py') + else: + print('Created admin site...') + + except: + + print('Error: cannot copy the file padmin.py. Check if exists and if you have permissions for this task') + + pass # Question about install admin site.