Re: Is it possible to use REST API on Django template ?

2020-12-03 Thread Suhaib Ali
you can use jquery to fetch api calls

On Wed, Nov 25, 2020 at 7:49 PM Aman Modi  wrote:

>
>
> Hello Django lovers.
>
> I want to use REST API  on Django template but i have no idea how can i do
> that.
> I want to use same API on android app and Django template.
>
> Any suggestion .
>
> Thanks and regard
> Aman Modi
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD%2BVV6LED5wS5sAxE-wy6BjyXEzjdVs4wMSd5zQoSgcJ3Vv8uQ%40mail.gmail.com.


Re: Is it possible to use REST API on Django template ?

2020-11-30 Thread Kris A. Stern
Hey,

Guess you are making some baseless assumptions about the so-called
templates... Can the original poster of the question please clarify what
you really meant before we get more and more confused?

K.S.

On Tue, 1 Dec 2020 at 10:03, Liu Zheng  wrote:

> Hi,
>
> Guys earlier have provided useful links for consuming APIs. Just want to
> emphasize some concepts between server-side and client-side codes.
> A django template is rendered into a page on the *server side*. That
> means, the server does the work and prepares the html content before
> sending it to the browser. In theory, you can call APIs when rendering
> the templates on the server side, but it's almost never a good idea. APIs
> are designed to be consumed by *clients*. The django templates should
> contain the relevant  javascripts (using ajax). These javascripts are not
> executed when the server renders the templates. They are sent as they are
> to the client, and are executed automatically by the browser. If the
> javascript calls API, the browser will come back to your server (this time,
> to the rest api endpoints, instead of the template rendering endpoints) and
> consume your API.
>
> Hope it helps.
>
> Best
> Zheng
>
> On Mon, Nov 30, 2020 at 1:30 AM sree e  wrote:
>
>>
>> Hi
>> find this link
>> https://github.com/sumasreeeduru/Textyfi
>> And go through "api" app , where you will find adding the api in easy way.
>> On Sunday, November 29, 2020 at 12:36:44 PM UTC+5:30 bharath...@gmail.com
>> wrote:
>>
>>> Hi
>>> Use JavaScript or jQuery to call APIs in frontend of Django template.
>>> You can use fetch API using vanilla JavaScript.
>>> You can perform all CRUD operations.
>>> All the best 
>>>
>>> On Sun, 29 Nov 2020, 11:57 am Aman Modi,  wrote:
>>>
 I know how to create API but i just want to know how to use in Django
 template.

 On Wednesday, November 25, 2020 at 8:07:47 PM UTC+5:30
 omkar...@gmail.com wrote:

> Creating REST API in Django is similar to any app on Django. All you
> need to do is, install the djangorestframework library, and serialize your
> models.
>
> YT video 
> https://youtu.be/TmsD8QExZ84
> On Wed, Nov 25, 2020, 7:48 PM Aman Modi  wrote:
>
>>
>>
>> Hello Django lovers.
>>
>> I want to use REST API  on the Django template but I have no idea how
>> can I do that.
>> I want to use the same API on the android app and the Django template.
>>
>> Any suggestion.
>>
>
>> Thanks and regard
>> Aman Modi
>>
>> --
>> 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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com
>> 
>> .
>>
> --
 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.

>>> To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/9219ddfb-a07d-40b4-9e64-8324520043f7n%40googlegroups.com
 
 .
>>>
>>>
 --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/5bea74b3-647b-45ca-9623-4951b08c911fn%40googlegroups.com
>> 
>> .
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAGQ3pf8_75diWytaSsDK7tcDnqSsPizAXq7BzQ7nM-LonrFhMA%40mail.gmail.com
> 
> .
>

-- 
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 

Re: Is it possible to use REST API on Django template ?

2020-11-30 Thread Liu Zheng
Hi,

Guys earlier have provided useful links for consuming APIs. Just want to
emphasize some concepts between server-side and client-side codes.
A django template is rendered into a page on the *server side*. That means,
the server does the work and prepares the html content before sending it to
the browser. In theory, you can call APIs when rendering the templates on
the server side, but it's almost never a good idea. APIs are designed to be
consumed by *clients*. The django templates should contain the relevant
javascripts (using ajax). These javascripts are not executed when the
server renders the templates. They are sent as they are to the client, and
are executed automatically by the browser. If the javascript calls API, the
browser will come back to your server (this time, to the rest api
endpoints, instead of the template rendering endpoints) and consume your
API.

Hope it helps.

Best
Zheng

On Mon, Nov 30, 2020 at 1:30 AM sree e  wrote:

>
> Hi
> find this link
> https://github.com/sumasreeeduru/Textyfi
> And go through "api" app , where you will find adding the api in easy way.
> On Sunday, November 29, 2020 at 12:36:44 PM UTC+5:30 bharath...@gmail.com
> wrote:
>
>> Hi
>> Use JavaScript or jQuery to call APIs in frontend of Django template.
>> You can use fetch API using vanilla JavaScript.
>> You can perform all CRUD operations.
>> All the best 
>>
>> On Sun, 29 Nov 2020, 11:57 am Aman Modi,  wrote:
>>
>>> I know how to create API but i just want to know how to use in Django
>>> template.
>>>
>>> On Wednesday, November 25, 2020 at 8:07:47 PM UTC+5:30
>>> omkar...@gmail.com wrote:
>>>
 Creating REST API in Django is similar to any app on Django. All you
 need to do is, install the djangorestframework library, and serialize your
 models.

 YT video 
 https://youtu.be/TmsD8QExZ84
 On Wed, Nov 25, 2020, 7:48 PM Aman Modi  wrote:

>
>
> Hello Django lovers.
>
> I want to use REST API  on the Django template but I have no idea how
> can I do that.
> I want to use the same API on the android app and the Django template.
>
> Any suggestion.
>

> Thanks and regard
> Aman Modi
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com
> 
> .
>
 --
>>> 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.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/9219ddfb-a07d-40b4-9e64-8324520043f7n%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/5bea74b3-647b-45ca-9623-4951b08c911fn%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGQ3pf8_75diWytaSsDK7tcDnqSsPizAXq7BzQ7nM-LonrFhMA%40mail.gmail.com.


Re: Is it possible to use REST API on Django template ?

2020-11-29 Thread sree e

Hi 
find this link 
https://github.com/sumasreeeduru/Textyfi
And go through "api" app , where you will find adding the api in easy way.
On Sunday, November 29, 2020 at 12:36:44 PM UTC+5:30 bharath...@gmail.com 
wrote:

> Hi 
> Use JavaScript or jQuery to call APIs in frontend of Django template.
> You can use fetch API using vanilla JavaScript.
> You can perform all CRUD operations.
> All the best 
>
> On Sun, 29 Nov 2020, 11:57 am Aman Modi,  wrote:
>
>> I know how to create API but i just want to know how to use in Django 
>> template.
>>
>> On Wednesday, November 25, 2020 at 8:07:47 PM UTC+5:30 omkar...@gmail.com 
>> wrote:
>>
>>> Creating REST API in Django is similar to any app on Django. All you 
>>> need to do is, install the djangorestframework library, and serialize your 
>>> models. 
>>>
>>> YT video 
>>> https://youtu.be/TmsD8QExZ84
>>> On Wed, Nov 25, 2020, 7:48 PM Aman Modi  wrote:
>>>


 Hello Django lovers.

 I want to use REST API  on the Django template but I have no idea how 
 can I do that.
 I want to use the same API on the android app and the Django template.

 Any suggestion.

>>>
 Thanks and regard
 Aman Modi

 -- 
 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.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com
  
 
 .

>>> -- 
>> 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.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/9219ddfb-a07d-40b4-9e64-8324520043f7n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5bea74b3-647b-45ca-9623-4951b08c911fn%40googlegroups.com.


Re: Is it possible to use REST API on Django template ?

2020-11-28 Thread RANGA BHARATH JINKA
Hi
Use JavaScript or jQuery to call APIs in frontend of Django template.
You can use fetch API using vanilla JavaScript.
You can perform all CRUD operations.
All the best 

On Sun, 29 Nov 2020, 11:57 am Aman Modi,  wrote:

> I know how to create API but i just want to know how to use in Django
> template.
>
> On Wednesday, November 25, 2020 at 8:07:47 PM UTC+5:30 omkar...@gmail.com
> wrote:
>
>> Creating REST API in Django is similar to any app on Django. All you need
>> to do is, install the djangorestframework library, and serialize your
>> models.
>>
>> YT video 
>> https://youtu.be/TmsD8QExZ84
>> On Wed, Nov 25, 2020, 7:48 PM Aman Modi  wrote:
>>
>>>
>>>
>>> Hello Django lovers.
>>>
>>> I want to use REST API  on the Django template but I have no idea how
>>> can I do that.
>>> I want to use the same API on the android app and the Django template.
>>>
>>> Any suggestion.
>>>
>>
>>> Thanks and regard
>>> Aman Modi
>>>
>>> --
>>> 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.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9219ddfb-a07d-40b4-9e64-8324520043f7n%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK5m315JpwQ%3DJsts0QtXd6mZy%3Dxbduv4Auzk50tk8GKO%2BXMWZw%40mail.gmail.com.


Re: Is it possible to use REST API on Django template ?

2020-11-28 Thread Aman Modi
I know how to create API but i just want to know how to use in Django 
template.

On Wednesday, November 25, 2020 at 8:07:47 PM UTC+5:30 omkar...@gmail.com 
wrote:

> Creating REST API in Django is similar to any app on Django. All you need 
> to do is, install the djangorestframework library, and serialize your 
> models. 
>
> YT video 
> https://youtu.be/TmsD8QExZ84
> On Wed, Nov 25, 2020, 7:48 PM Aman Modi  wrote:
>
>>
>>
>> Hello Django lovers.
>>
>> I want to use REST API  on the Django template but I have no idea how can 
>> I do that.
>> I want to use the same API on the android app and the Django template.
>>
>> Any suggestion.
>>
>
>> Thanks and regard
>> Aman Modi
>>
>> -- 
>> 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.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9219ddfb-a07d-40b4-9e64-8324520043f7n%40googlegroups.com.


Re: Is it possible to use REST API on Django template ?

2020-11-26 Thread Venu Gopal
Yes, it is possible. Below is the documentation. we will use serialization
to get a django rest API.
https://docs.djangoproject.com/en/3.1/topics/serialization/

On Wed, Nov 25, 2020 at 7:48 PM Aman Modi  wrote:

>
>
> Hello Django lovers.
>
> I want to use REST API  on Django template but i have no idea how can i do
> that.
> I want to use same API on android app and Django template.
>
> Any suggestion .
>
> Thanks and regard
> Aman Modi
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOhYkiw-2jq%2B%3DLaxWZ8gZPsx0fsDLbKWivyZ2skJomj6oygu3Q%40mail.gmail.com.


Re: Is it possible to use REST API on Django template ?

2020-11-25 Thread Kris A. Stern
Maybe this article from JetBrains can help:
https://blog.jetbrains.com/pycharm/2017/01/webinar-adding-a-rest-api-to-a-django-application/

Hope that helps!

Cheers,
K.S.

On Thu, 26 Nov 2020 at 00:20, Farai M  wrote:

> Very possible you can create urls for API with the rest framework then
> create other  urls for your templates .Just install the django rest
> framework you are good to go.
>
> On Wed, Nov 25, 2020, 4:18 PM Aman Modi  wrote:
>
>>
>>
>> Hello Django lovers.
>>
>> I want to use REST API  on Django template but i have no idea how can i
>> do that.
>> I want to use same API on android app and Django template.
>>
>> Any suggestion .
>>
>> Thanks and regard
>> Aman Modi
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com
>> 
>> .
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMeub5NDVFE_A%3DkLYvuTy8r6sNU%2B5QAVaZts8cHnSMqgp2zhmw%40mail.gmail.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMxZ8Sk9CufnYLyrbSLfesZBPPT3V9D6D9jNBctDe1jL3yNuAQ%40mail.gmail.com.


Re: Is it possible to use REST API on Django template ?

2020-11-25 Thread Farai M
Very possible you can create urls for API with the rest framework then
create other  urls for your templates .Just install the django rest
framework you are good to go.

On Wed, Nov 25, 2020, 4:18 PM Aman Modi  wrote:

>
>
> Hello Django lovers.
>
> I want to use REST API  on Django template but i have no idea how can i do
> that.
> I want to use same API on android app and Django template.
>
> Any suggestion .
>
> Thanks and regard
> Aman Modi
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMeub5NDVFE_A%3DkLYvuTy8r6sNU%2B5QAVaZts8cHnSMqgp2zhmw%40mail.gmail.com.


Re: Is it possible to use REST API on Django template ?

2020-11-25 Thread Devender Kumar
Use ajax with django rest framework

On Wed, 25 Nov, 2020, 8:07 pm Omkar Parab,  wrote:

> Creating REST API in Django is similar to any app on Django. All you need
> to do is, install the djangorestframework library, and serialize your
> models.
>
> YT video 
> https://youtu.be/TmsD8QExZ84
> On Wed, Nov 25, 2020, 7:48 PM Aman Modi  wrote:
>
>>
>>
>> Hello Django lovers.
>>
>> I want to use REST API  on the Django template but I have no idea how can
>> I do that.
>> I want to use the same API on the android app and the Django template.
>>
>> Any suggestion.
>>
>> Thanks and regard
>> Aman Modi
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com
>> 
>> .
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJY8mfychw%2BNiKpPvho_whycaT0y2nCQaV2ChecwxPm1VW8yVQ%40mail.gmail.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALZ%3DbEKUb6z_Tf1fj-Bt4ShhcCPE-sdsMkxO2Q2Zpf7uryE03Q%40mail.gmail.com.


Re: Is it possible to use REST API on Django template ?

2020-11-25 Thread Omkar Parab
Creating REST API in Django is similar to any app on Django. All you need
to do is, install the djangorestframework library, and serialize your
models.

YT video 
https://youtu.be/TmsD8QExZ84
On Wed, Nov 25, 2020, 7:48 PM Aman Modi  wrote:

>
>
> Hello Django lovers.
>
> I want to use REST API  on the Django template but I have no idea how can
> I do that.
> I want to use the same API on the android app and the Django template.
>
> Any suggestion.
>
> Thanks and regard
> Aman Modi
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJY8mfychw%2BNiKpPvho_whycaT0y2nCQaV2ChecwxPm1VW8yVQ%40mail.gmail.com.


Is it possible to use REST API on Django template ?

2020-11-25 Thread Aman Modi


Hello Django lovers.

I want to use REST API  on Django template but i have no idea how can i do 
that.
I want to use same API on android app and Django template.

Any suggestion .

Thanks and regard
Aman Modi

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com.