Fixes in console.py for create new paramecio2 site
This commit is contained in:
parent
bc05d7725e
commit
deeec158d6
1 changed files with 8 additions and 44 deletions
|
|
@ -8,7 +8,7 @@ import re
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from base64 import b64encode
|
from base64 import b64encode
|
||||||
from paramecio2.libraries.db.webmodel import WebModel
|
from paramecio2.libraries.db.webmodel import WebModel
|
||||||
from paramecio2.modules.admin.models.admin import UserAdmin
|
from paramecio2.modules.admin.models.admin import UserAdmin, LoginTries
|
||||||
from subprocess import call
|
from subprocess import call
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
|
|
@ -80,49 +80,7 @@ def start():
|
||||||
|
|
||||||
print('Error: cannot copy the file index.py to app.py. Check if exists and if you have permissions for this task')
|
print('Error: cannot copy the file index.py to app.py. Check if exists and if you have permissions for this task')
|
||||||
|
|
||||||
"""
|
|
||||||
try:
|
|
||||||
|
|
||||||
shutil.copy(workdir+'/frontend/padmin.py', args.path+'/padmin.py')
|
|
||||||
|
|
||||||
except:
|
|
||||||
|
|
||||||
print('Error: cannot copy the file padmin.py. Check if exists and if you have permissions for this task')
|
|
||||||
|
|
||||||
try:
|
|
||||||
|
|
||||||
shutil.copy(workdir+'/frontend/i18nadmin.py', args.path+'/i18nadmin.py')
|
|
||||||
|
|
||||||
except:
|
|
||||||
|
|
||||||
print('Error: cannot copy the file i18nadmin.py. Check if exists and if you have permissions for this task')
|
|
||||||
|
|
||||||
try:
|
|
||||||
|
|
||||||
shutil.copy(workdir+'/frontend/regenerate.py', args.path+'/regenerate.py')
|
|
||||||
|
|
||||||
except:
|
|
||||||
|
|
||||||
print('Error: cannot copy the file regenerate.py. Check if exists and if you have permissions for this task')
|
|
||||||
|
|
||||||
try:
|
|
||||||
|
|
||||||
shutil.copy(workdir+'/frontend/create_module.py', args.path+'/create_module.py')
|
|
||||||
|
|
||||||
except:
|
|
||||||
|
|
||||||
print('Error: cannot copy the file create_module.py. Check if exists and if you have permissions for this task')
|
|
||||||
|
|
||||||
|
|
||||||
try:
|
|
||||||
|
|
||||||
shutil.copy(workdir+'/settings/modules.py', path_settings+'/modules.py')
|
|
||||||
|
|
||||||
except:
|
|
||||||
|
|
||||||
print('Error: cannot copy the file modules.py. Check if exists and if you have permissions for this task')
|
|
||||||
|
|
||||||
"""
|
|
||||||
if args.symlink==True:
|
if args.symlink==True:
|
||||||
try:
|
try:
|
||||||
os.symlink(workdir, args.path+'/paramecio2', True)
|
os.symlink(workdir, args.path+'/paramecio2', True)
|
||||||
|
|
@ -182,6 +140,8 @@ def start():
|
||||||
|
|
||||||
e_q=input('Email for site: ')
|
e_q=input('Email for site: ')
|
||||||
|
|
||||||
|
conf=conf.replace("no-reply@example.com", e_q)
|
||||||
|
|
||||||
#if e_q=='':
|
#if e_q=='':
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -232,6 +192,7 @@ def start():
|
||||||
conn=WebModel.connection()
|
conn=WebModel.connection()
|
||||||
|
|
||||||
useradmin=UserAdmin(conn)
|
useradmin=UserAdmin(conn)
|
||||||
|
logintries=LoginTries(conn)
|
||||||
|
|
||||||
# Check if db exists
|
# Check if db exists
|
||||||
|
|
||||||
|
|
@ -268,6 +229,9 @@ def start():
|
||||||
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:
|
||||||
|
|
||||||
|
sql_login=logintries.create_table()
|
||||||
|
logintries.query(sql_login)
|
||||||
|
|
||||||
# Add admin module to config
|
# Add admin module to config
|
||||||
with open(path_settings+'/config.py', 'r') as f:
|
with open(path_settings+'/config.py', 'r') as f:
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue