-
-
Notifications
You must be signed in to change notification settings - Fork 690
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
Load plugins from a --plugins-dir=plugins/
directory
#211
Comments
The easiest way to implement this in Python 2 would be
Implementing it this way would force this kind of plugin to be self-contained in a single file. I think that's OK: if you want a more complex plugin you can use the standard pluggy-powered setuptools mechanism to build it. |
New option causing Datasette to load and evaluate all of the Python files in the specified directory and register any plugins that are defined in those files. This new option is available for the following commands: datasette serve mydb.db --plugins=plugins/ datasette publish now/heroku mydb.db --plugins=plugins/ datasette package mydb.db --plugins=plugins/
This needs unit tests. I also need to manually test the |
Here's the result of running:
Where
|
This worked as well:
|
Added unit tests in 33c6bca |
Here's the result of running this:
|
In #14 and 33c7c53 I've added working support for setuptools entry_points plugins. These can be installed from PyPI using
pip install ...
.I imagine some projects will benefit from being able to add plugins without first publishing them to PyPI. Datasette already supports loading custom templates like so:
I propose an additional option,
--plugins-dir=
which specifies a directory full ofblah.py
files which will be loaded into Datasette when the application server starts.This will also need to be supported by
datasette publish
as those Python files should be copied up as part of the deployment.The text was updated successfully, but these errors were encountered: