Django usage
susuusus opened this issue · 5 comments
Hi, any example to implement this in django. Thanks
Hi @susuusus , we've been wanting to add Django support for a while now, but none of us is familiar with it enough to do that.
If you're up for the challenge, we're open for contributions and would definitely help with the implementation if you can contribute an initial PR for Django support. Pyctuator's API is rather simple, so adding support for a new framework is relatively straightforward, assuming you're familiar with the framework.
Hi Team,
Any update on this, I suppose it is a very useful feature. Thanks
Hi @jijunnniu , the previous comment still applies.
If you are up to the task, I can point you to where you should start.
I can look into this if someone else isn't and someone can point me.
Thanks @mittal-umang, this will be great.
To get started, clone the project and follow the instructions in https://github.com/SolarEdgeTech/pyctuator#contributing.
Next, in order to add support for django (or any other web-framework) you'll need to:
- Add django dependencies as optional (for the sake of non django users)
- Implement
PyctuatorRouter
in a new filepyctuator/impl/django_pyctuator.py
(see any of the other implementation) - Create optional "web framework integration" in
pyctuator/pyctuator.py
(seeframework_integrations
, the key should be the name of the django package, guess itsdjango
) - Create a "django test server" in a new file
tests/django_test_server.py
which will be used by the end-to-end test - Register the "django test server" in
@pytest.fixture
in thetest/test_pyctuator_e2e.py
test - Document the integration of pyctuator in the readme file
- Add an example in the examples folder
It'll indeed be great of you can do this.
Thanks!