Using Python Packages in Django

26 views
Skip to first unread message

djangorobert

unread,
Mar 11, 2018, 2:09:22 PM3/11/18
to Django users
Have a question may be silly but want to know when using a library like the Python rx library package 
how would I use it in django?

Would I have to create a model?
or could I use it in a View Thanks


I was thinking in a View but was unsure if i could with a Function view instead 

Thanks 
IF you have had experience with it i would appreciate your INfo thanks.

Jani Tiainen

unread,
Mar 11, 2018, 4:02:18 PM3/11/18
to django...@googlegroups.com
Hi.

Django is just Python so you can use any library as you see fit.

You don't need to create any special models for that unless you want to store something to database.

If that package creteates output you want to show in template just calling it from a view is sufficient.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/094bbd87-d1fd-4885-981d-8507f8cb3b2d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

djangorobert

unread,
Mar 11, 2018, 6:03:09 PM3/11/18
to Django users
Hi Jani thanks 
I was thinking something like this 

from rx import Observable, Observer


people = ['robert', 'anna', 'jake', 'harry', 'lacey']

class MyObserver(Observer):
     templates = 'peron/people.html'
     context = {}
    def on_next(self, x):
        print("Found: {}".format(x))

    def on_error(self, e):
        print("Sorry got an error for: {e}".format(e))

    def on_completed(self):
        print('All Done')

p = Observable.from_iterable(people)
subscribe = p.subscribe(MyObserver())
return render(request, templates, context)

On Sunday, March 11, 2018 at 3:02:18 PM UTC-5, Jani Tiainen wrote:
Hi.

Django is just Python so you can use any library as you see fit.

You don't need to create any special models for that unless you want to store something to database.

If that package creteates output you want to show in template just calling it from a view is sufficient.
11.3.2018 20.10 "djangorobert" <djangoc...@gmail.com> kirjoitti:
Have a question may be silly but want to know when using a library like the Python rx library package 
how would I use it in django?

Would I have to create a model?
or could I use it in a View Thanks


I was thinking in a View but was unsure if i could with a Function view instead 

Thanks 
IF you have had experience with it i would appreciate your INfo thanks.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages