Comments (5)
Fixed in 3206d43
from kolibri.
Two options:
-
Running
django.setup()
before enabling/disabling a plugin (inkolibri.utils.cli.plugin
). That way, we just know that the django stack is ready when loadingkolibri_plugin
which requires less carefulness when writing plugins. -
Moving the import of
urls
modules toMyKolibriPlugin.url_module
. This way, we know that loadingkolibri_plugin
is less error prone because it doesn't depend on a functional django stack. So for instance if a plugin has broken something in the Django stack (for instance its views or models are invalid), we can still enable/disable the plugin.
from kolibri.
I'm wondering if option 2 is too restrictive. That way, a plugin cannot access its own models when it's being enabled. On the other hand, things like migrations may not have been fired.
Can anybody advice on what plugins currently HAVE to be able to do when enabled? I can't see that any of the core plugins have custom enable()
class methods anyways.
from kolibri.
I'm wondering if option 1 is too restrictive. That way, a plugin cannot access its own models when it's being enabled. On the other hand, things like migrations may not have been fired.
Following up on this: Since one may run enable->disable->enable
, with each operation starting and exiting Kolibri, I believe that plugins should not make lots of assumptions about initial states while running enable
. This is just a caution.
Anyways, because commands such as collectstatic
and migrate
have to be run, we also have to run django.setup()
anyways.
Here's a rough vision of what enabling a plugin could look like:
$ kolibri plugin enable kolibri.plugins.learn
Enabling plugin: kolibri.plugins.learn
Verifying dependencies... OK!
Collecting static assets (JS/CSS/images)........ OK!
Running database migrations............ OK!
Plugin enabled. Please start/restart Kolibri.
from kolibri.
Replacing this issue with #2510
from kolibri.
Related Issues (20)
- CSV Report generation API tests fail when the current date in the active timezone is different to the UTC date HOT 1
- Update `kolibri` command usage in `kolibri_sentry_plugin` documentation HOT 3
- User is not able to select whether to allow using mobile data in Mac app HOT 1
- Downloads inside HTML5 apps do not work HOT 7
- Pre-commit hooks not looking out for print statements HOT 2
- Allow customizable demographic fields to be set from the backend. HOT 6
- Quiz Creation: Saving quiz, issues in Learn
- Quiz Creation: Replace TabsWithOverflow with KListWithOverflow HOT 1
- Quiz Creation: Move `handleReplacements` logic from `ReplaceQuestions` to `useQuizCreation` HOT 7
- Perseus renderer does not responsively update to the current input modality
- Security contact for vulnerability report HOT 2
- Infinite Loading on search in Kolibri Documentation Search HOT 6
- Getting "Username is duplicated" message when importing a user on my second facility and the user is already extant in the first facility HOT 3
- Write tests for the `useQuizResources` module
- Quiz creation: Known issues, bugs, quick fixes
- Quiz creation: Snackbars improvements
- Error raised during insufficient storage handling HOT 8
- 'On my own' device - Merging a user is not working HOT 3
- Create pnpm webpack resolver plugin
- Update the search select dropdowns for grade levels and accessibility options so they are in a consistent, correct order HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kolibri.