Open nicozanf opened 5 years ago
Attempting to create applications with dashes and dots in their name via the admin panel reveals an error stating that it's an invalid application name. Digging around within the code revealed a validator called IS_VALID_APPNAME()
that checks to see if the application already exists, or if it matches the regex ^\w+$
(only alphanumerical characters with underscores). I'm not sure about the reason behind this check, possibly backwards compatibility or filesystem compatibility.
The reason is to make this possible:
from applications.app_must_be_valid_python_name.modules import shared_module
Turned out that app names are not the only nonsense thing...
The reason is to make this possible:
from applications.app_must_be_valid_python_name.modules import shared_module
Now tell me why in the hell I cannot rename my models with dashes or dots... those do not get imported anywhere (models, not modules tho).
Ref: #2251
When you open the "site" link (https://mysite.example.com/admin/default/site) the current admin app does not show applications if they have dashes or dots in the name of the related folder, like web2py-book or web2py.book. As soon as you rename it with alphanumerical characthers only, and refresh the web page, the application is listed as usual among the installed ones. The application works fine otherwise, but the admin app does not shot it.