-
-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Look for Unicorn components in all INSTALLED_APPS by default #210
Comments
Definitely not a technical problem to implement this. It was mostly a performance optimization (to skip checking every installed app) and to provide an "easy" on-ramp with the One question I have is whether this would this work for your use-case?
|
|
Oh, and this could also be dont with a mgmt cmd. Sockpuppet does this, you just need to add a parameter to the command which specifies the app where the scaffolding has to be placed. I do that in GDAPS mgmt cmd too. ./manage.py startunicorn <my_app> <my_component> could create
Then you must call this with |
My performance optimization comment was because (currently) all apps are checked the first time a component is loaded (it happens here:
I like this approach and it seems reasonably straight-forward to implement, and potentially less confusing for end-users. I'll try to whip up a PR when I get a chance and will attach it to this issue. |
I started looking into how to get this working. Loading the components from I think I'm going to still default templates to a "unicorn" folder underneath the application's template folder. I think it makes sense to keep |
This is released in https://github.com/adamghill/django-unicorn/releases/tag/0.30.0. |
I'm just new to unicorn, and faced the first problem I see as newcomer. First there was only the "unicorn" app where components could live. Then, thanks to #15 there is a setting where you can define apps with components to look for.
But in a large scale application this is bad(TM).
Why can't unicorn just look at all installed apps and see if there is a
components
folder, hence load components from there? And any app could provide templates as well.Is there any technical problem that prevents such a feature?
Background: I wrote a Django plugin system (GDAPS) which aims for installing apps dynamically (more or less) - but my main application does not know which plugin app is going to be installed. So adding an app to an array in settings.py does not work here. and doesn't have to.
I use this feature in GDAPS as well. GDAPS looks for the
urls
module of each installed app and loads them dynamically, assembling all urlpatterns together. Unicorn could do that with components.The text was updated successfully, but these errors were encountered: