Using Python Packages in Django

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Using Python Packages in Django

djangorobert
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 [hidden email].
To post to this group, send email to [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: Using Python Packages in Django

Jani Tiainen
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" <[hidden email]> 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 [hidden email].
To post to this group, send email to [hidden email].
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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CAHn91ofoDsXZWZHaG9ZqvnxiaFQ%3DuwEUEJWnud8GjQot6UEY8A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Using Python Packages in Django

djangorobert
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" <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="gfwQAUGeAQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">djangoc...@...> 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="gfwQAUGeAQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django-users...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="gfwQAUGeAQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django...@....
Visit this group at <a href="https://groups.google.com/group/django-users" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;">https://groups.google.com/group/django-users.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/django-users/094bbd87-d1fd-4885-981d-8507f8cb3b2d%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/django-users/094bbd87-d1fd-4885-981d-8507f8cb3b2d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/django-users/094bbd87-d1fd-4885-981d-8507f8cb3b2d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/django-users/094bbd87-d1fd-4885-981d-8507f8cb3b2d%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/73e191a1-9a07-46e8-b7aa-83c14d91fda7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.