Fixes in modules
This commit is contained in:
parent
1b65781f8a
commit
81847b6e00
5 changed files with 26 additions and 8 deletions
|
|
@ -8,7 +8,7 @@ import re
|
|||
from pathlib import Path
|
||||
from base64 import b64encode
|
||||
from paramecio.libraries.db.webmodel import WebModel
|
||||
from paramecio.modules.admin2.models.admin import UserAdmin2
|
||||
from paramecio.modules.admin2.models.admin import UserAdmin2, LoginTries2
|
||||
from subprocess import call
|
||||
from urllib.parse import urlparse
|
||||
|
||||
|
|
@ -221,7 +221,9 @@ def start():
|
|||
|
||||
conn=WebModel.connection()
|
||||
|
||||
useradmin=UserAdmin(conn)
|
||||
useradmin=UserAdmin2(conn)
|
||||
|
||||
logintries=LoginTries2(conn)
|
||||
|
||||
# Check if db exists
|
||||
|
||||
|
|
@ -250,11 +252,13 @@ def start():
|
|||
|
||||
shutil.copy(workdir+'/settings/modules.py.admin', path_settings+'/modules.py')
|
||||
|
||||
shutil.copy(workdir+'/settings/config_admin.py.sample', path_settings+'/config_admin.py')
|
||||
#shutil.copy(workdir+'/settings/config_admin.py.sample', path_settings+'/config_admin.py')
|
||||
|
||||
sql=useradmin.create_table()
|
||||
|
||||
if not useradmin.query(sql):
|
||||
tries_sql=logintries.create_table()
|
||||
|
||||
if not useradmin.query(sql) or not useradmin.query(tries_sql) :
|
||||
print('Error: cannot create table admin, you can create this table with padmin.py')
|
||||
else:
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,22 @@
|
|||
from bottle import request, response
|
||||
from itsdangerous.url_safe import URLSafeTimedSerializer
|
||||
from settings import config
|
||||
from paramecio.libraries.keyutils import create_key_encrypt, create_key_encrypt_256, create_key
|
||||
|
||||
try:
|
||||
|
||||
from settings import config
|
||||
|
||||
except:
|
||||
|
||||
class config:
|
||||
cookie_name='paramecio.session'
|
||||
key_encrypt=create_key_encrypt_256(30)
|
||||
session_opts={'session.data_dir': 'sessions', 'session.type': 'file', 'session.path': 'paramecio'}
|
||||
|
||||
import inspect
|
||||
|
||||
|
||||
|
||||
class Session(dict):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
from bottle import request, response, redirect
|
||||
from settings import config
|
||||
#from settings import config
|
||||
import inspect
|
||||
from paramecio.wsgiapp import app
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ debug=False
|
|||
|
||||
reloader=False
|
||||
|
||||
admin_folder='admin'
|
||||
admin_folder='/admin'
|
||||
|
||||
host='localhost'
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ list_modules=[]
|
|||
|
||||
from paramecio.modules.welcome import index
|
||||
|
||||
from paramecio.modules.admin2 import index
|
||||
#from paramecio.modules.admin2 import index
|
||||
|
||||
from paramecio.modules.lang import index
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue