Fixes in admin
This commit is contained in:
parent
a18cf5504f
commit
e079968174
3 changed files with 12 additions and 6 deletions
|
|
@ -80,7 +80,7 @@ def prepare_app():
|
||||||
app_mounts={}
|
app_mounts={}
|
||||||
|
|
||||||
for key_app, added_app in config.apps.items():
|
for key_app, added_app in config.apps.items():
|
||||||
|
print(added_app)
|
||||||
controller_path=import_module(added_app[0])
|
controller_path=import_module(added_app[0])
|
||||||
|
|
||||||
controller_base=os.path.dirname(controller_path.__file__)
|
controller_base=os.path.dirname(controller_path.__file__)
|
||||||
|
|
|
||||||
|
|
@ -265,7 +265,8 @@ def start():
|
||||||
|
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
config_text=config_text.replace("modules=['paramecio.modules.welcome']", "modules=['paramecio.modules.welcome', 'paramecio.modules.admin2', 'paramecio.modules.lang']")
|
config_text=config_text.replace("modules=['paramecio.modules.welcome']", "modules=['paramecio.modules.welcome', 'paramecio.modules.lang']")
|
||||||
|
config_text=config_text.replace("apps={}", "apps={'admin2': ['paramecio.modules.admin2', 'admin_app', '/admin/']}")
|
||||||
|
|
||||||
with open(path_settings+'/config.py', 'w') as f:
|
with open(path_settings+'/config.py', 'w') as f:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,12 +44,17 @@ cookie_name='paramecio_session'
|
||||||
if hasattr(config, 'cookie_name'):
|
if hasattr(config, 'cookie_name'):
|
||||||
cookie_name=config.cookie_name
|
cookie_name=config.cookie_name
|
||||||
|
|
||||||
admin_folder='/admin/'
|
admin_folder='/admin'
|
||||||
|
|
||||||
if hasattr(config, 'admin_folder'):
|
if hasattr(config, 'admin_folder'):
|
||||||
admin_folder=config.admin_folder
|
admin_folder=config.admin_folder
|
||||||
|
|
||||||
@app.get(admin_folder.rstrip('/'), name="admin_app.home_admin")
|
@app.get(admin_folder)
|
||||||
|
def redirect_home():
|
||||||
|
|
||||||
|
redirect(app.get_url('admin_app.home_admin'))
|
||||||
|
|
||||||
|
@admin_app.get('/home', name="admin_app.home_admin")
|
||||||
def home_admin(session={}):
|
def home_admin(session={}):
|
||||||
|
|
||||||
#s=get_session()
|
#s=get_session()
|
||||||
|
|
@ -304,5 +309,5 @@ def check_login_tries(request, db):
|
||||||
|
|
||||||
return you_cannot_login
|
return you_cannot_login
|
||||||
|
|
||||||
app.mount(admin_folder, admin_app)
|
#app.mount(admin_folder, admin_app)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue