Fixes in config_admin

This commit is contained in:
Antonio de la Rosa 2015-12-09 16:14:39 +01:00
parent 6f298d469c
commit 8558f0d9c1

View file

@ -115,13 +115,25 @@ def start():
admin=input('Do you want create admin site? y/n: ') admin=input('Do you want create admin site? y/n: ')
if admin=='y' or admin=='Y': if admin=='y' or admin=='Y':
try:
shutil.copy(workdir+'/settings/config_admin.py.sample', path_settings+'/config_admin.py')
useradmin=UserAdmin() useradmin=UserAdmin()
sql=useradmin.create_table() sql=useradmin.create_table()
if not WebModel.query(WebModel, sql): if not WebModel.query(WebModel, sql):
print('Error: cannot create table admin, you can create this table with padmin.py') print('Error: cannot create table admin, you can create this table with padmin.py')
else: else:
print('Created admin site...') 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 pass
# Question about install admin site. # Question about install admin site.