kashifpk / PyCK

Python Code Karigar - A web framework aimed at being easy to use and powerful
http://pyck.compulife.com.pk
Other
4 stars 0 forks source link

Pluggable apps infrastructure improvements #37

Open kashifpk opened 10 years ago

kashifpk commented 10 years ago

Currently the method of specifying pluggable app names as strings in a list isn't very pythonic. Allow importing apps and then including them in the enabled_apps list. Imported apps may reside in project's app folder or may be a pre-built pyck app downloaded and installed in the system/virtualenv. Example contents of apps/init.py may look like:

from pyckapps import register, admin, cms
import myapp1, myapp2

enabled_apps = [register, admin, cms, myapp1, myapp2]

Ideally pluggable apps (specially pre-installed ones) should provide a method to override the url prefix so that if a different url prefix than the default app name is desired it can be done in apps/init.py

kashifpk commented 10 years ago

Given some further thought using subapps as egg files would increase project dependencies and mostly offers "use but don't change" scenarios. Having the subapp inside the project gives the freedom to modify the app if required which in the long run would improve app quality and features from contributions of developers using the apps.

Closing this ticket.

kashifpk commented 9 years ago

With the release of Pyramid 1.6 we now have pyramid.config.Configurator.root_package attribute and init method. Sub apps can use pyramid.config.Configurator.root_package to reference the root package making import-able subapps much easier to do. Re-opening this ticket as this now involves much less work.