diff --git a/paramecio2/app.py b/paramecio2/app.py index 7a2e7b2..442b7da 100644 --- a/paramecio2/app.py +++ b/paramecio2/app.py @@ -70,9 +70,10 @@ def start_app(): a=import_module(module_app) arr_module_path[key_app]=os.path.dirname(sys.modules[module_app].__file__) - - app.register_blueprint(app_name, url_prefix=added_app[2]) - + if config.application_root=='/': + app.register_blueprint(app_name, url_prefix=added_app[2]) + else: + app.register_blueprint(app_name, url_prefix=config.application_root+'/'+added_app[2][1:]) """ module_app=config.apps[added_app][0] @@ -87,7 +88,7 @@ def start_app(): #Add media files support. Only for development. - @app.route('/mediafrom//') + @app.route(config.application_root+'mediafrom//') def send_media_file(module, media_file): file_path=workdir+'/themes/'+config.theme+'/media/'+module+'/'+media_file diff --git a/paramecio2/console.py b/paramecio2/console.py index ea3c9b1..8a6ef13 100755 --- a/paramecio2/console.py +++ b/paramecio2/console.py @@ -269,7 +269,7 @@ def start(): pass # Install modules - """ + if args.modules!=None: if args.modules.strip()!='': @@ -337,18 +337,6 @@ def start(): os.chdir(args.path) - #Regenerating modules.py - - regenerate='regenerate.py' - - os.chmod(regenerate, 0o755) - - if call('./regenerate.py', shell=True) > 0: - print('Error, cannot regenerate the modules.py script') - exit(1) - else: - print('Regeneration of modules.py finished') - # Installing models padmin='padmin.py' diff --git a/paramecio2/libraries/db/webmodel.py b/paramecio2/libraries/db/webmodel.py index 35dfc59..1d7a29d 100644 --- a/paramecio2/libraries/db/webmodel.py +++ b/paramecio2/libraries/db/webmodel.py @@ -349,7 +349,7 @@ class WebModel: distinct (str): Add DISTINCT keyword to self.select method. post (dict): A simple dictionary where post values are saved for use of fields classes files_delete (dict): A simple dictionary that save the fields that have files related. If i delete the row in database i need delete the files related - sql_class (SqlClass): A sql_class used for connect to db. + sqlclass (SqlClass): A sql_class used for connect to db. show_formatted (bool): If True, by default all fields are showed with formatted value using show_formatted method of PhangoField classes and children in select method. If False, raw value is showed. enctype (bool): If True, forms generated using this model are prepared for enctype=multipart/form-data A.K.A. upload files. """ diff --git a/paramecio2/libraries/mtemplates.py b/paramecio2/libraries/mtemplates.py index be800cc..96adeb7 100644 --- a/paramecio2/libraries/mtemplates.py +++ b/paramecio2/libraries/mtemplates.py @@ -1,5 +1,6 @@ # Template frontend from mako. +import gettext from mako.template import Template from flask import session, url_for from mako.lookup import TemplateLookup @@ -89,6 +90,10 @@ class PTemplate: self.add_filter(I18n.lang) + _=gettext.gettext + + self.add_filter(_) + #self.add_filter(make_url) self.add_filter(make_media_url)