Fixes in config_admin
This commit is contained in:
parent
a0c7d7bc20
commit
6f298d469c
4 changed files with 36 additions and 10 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -4,8 +4,5 @@ __pycache__
|
|||
modules/*
|
||||
!modules/welcome
|
||||
!modules/admin
|
||||
settings/*
|
||||
!settings/__init__.py
|
||||
!settings/config.py.sample
|
||||
themes/*
|
||||
!themes/default/
|
||||
|
|
|
|||
30
console.py
30
console.py
|
|
@ -5,7 +5,7 @@ import os
|
|||
import shutil
|
||||
import getpass
|
||||
from pathlib import Path
|
||||
from paramecio.cromosoma import WebModel
|
||||
from paramecio.cromosoma.webmodel import WebModel
|
||||
from paramecio.modules.admin.models.admin import UserAdmin
|
||||
|
||||
def start():
|
||||
|
|
@ -73,7 +73,7 @@ def start():
|
|||
|
||||
host_db=input('MySQL database server host, by default localhost: ').strip()
|
||||
|
||||
db=input('MySQL database name, by default paramecio: ').strip()
|
||||
db=input('MySQL database name, by default paramecio_db: ').strip()
|
||||
|
||||
user_db=input('MySQL database user, by default root: ').strip()
|
||||
|
||||
|
|
@ -95,11 +95,33 @@ def start():
|
|||
f.close()
|
||||
|
||||
#user=UserAdmin()
|
||||
|
||||
#Create db
|
||||
|
||||
sql='create database '+
|
||||
if db=="":
|
||||
db='paramecio_db'
|
||||
|
||||
if not WebModel.query(WebModel, sql)
|
||||
WebModel.connections={'default': {'name': 'default', 'host': host_db, 'user': user_db, 'password': pass_db, 'db': '', 'charset': 'utf8mb4', 'set_connection': False} }
|
||||
|
||||
sql='create database '+db
|
||||
|
||||
if not WebModel.query(WebModel, sql):
|
||||
print('Error: cannot create database, check the data of database')
|
||||
|
||||
else:
|
||||
|
||||
WebModel.query(WebModel, 'use '+db)
|
||||
|
||||
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...')
|
||||
pass
|
||||
|
||||
# Question about install admin site.
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
# You need install cromosoma for use this.
|
||||
|
||||
#from cromosoma.webmodel import WebModel
|
||||
from paramecio.cromosoma.webmodel import WebModel
|
||||
|
||||
#server_used="wsgiref"
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ theme='default'
|
|||
|
||||
#Base directory for save modules
|
||||
|
||||
base_modules="modules"
|
||||
#base_modules="modules"
|
||||
|
||||
#Type server used for connect to the internet...
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ default_module="welcome"
|
|||
|
||||
#Modules with permissions to access for users
|
||||
|
||||
modules=['welcome']
|
||||
modules=['paramecio.modules.welcome']
|
||||
|
||||
#Activate sessions?
|
||||
|
||||
|
|
|
|||
7
settings/config_admin.py.sample
Normal file
7
settings/config_admin.py.sample
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
from paramecio.citoplasma.i18n import I18n
|
||||
|
||||
modules_admin={'ausers': [I18n.lang('admin', 'users_admin', 'User\'s Admin'), 'paramecio.modules.admin.admin.ausers']}
|
||||
|
||||
#modules_admin={'ausers': [I18n.lang('admin', 'users_admin', 'User\'s Admin'), 'paramecio.modules.admin.admin.ausers'], 'module_father': [ I18n.lang('common', 'submodule', 'ModuleFather') , {'submodule': ['This is a module', 'paramecio.modules.admin.admin.ausers'] } ] }
|
||||
Loading…
Add table
Add a link
Reference in a new issue