Skip to content
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

Django usage #68

Open
susuusus opened this issue Oct 6, 2021 · 5 comments
Open

Django usage #68

susuusus opened this issue Oct 6, 2021 · 5 comments

Comments

@susuusus
Copy link

susuusus commented Oct 6, 2021

Hi, any example to implement this in django. Thanks

@MatanRubin
Copy link
Member

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.

@jijunnniu
Copy link

Hi Team,
Any update on this, I suppose it is a very useful feature. Thanks

@michaelyaakoby
Copy link
Member

Hi @jijunnniu , the previous comment still applies.
If you are up to the task, I can point you to where you should start.

@mittal-umang
Copy link

I can look into this if someone else isn't and someone can point me.

@michaelyaakoby
Copy link
Member

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:

  1. Add django dependencies as optional (for the sake of non django users)
  2. Implement PyctuatorRouter in a new file pyctuator/impl/django_pyctuator.py (see any of the other implementation)
  3. Create optional "web framework integration" in pyctuator/pyctuator.py (see framework_integrations, the key should be the name of the django package, guess its django)
  4. Create a "django test server" in a new file tests/django_test_server.py which will be used by the end-to-end test
  5. Register the "django test server" in @pytest.fixture in the test/test_pyctuator_e2e.py test
  6. Document the integration of pyctuator in the readme file
  7. Add an example in the examples folder

It'll indeed be great of you can do this.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants