Django rest framework + ionic2 + django channels - django-rest-framework

I want to develop real time native application and considering using Django as backend and ionic2 as frontend. But through the research i realize that websocket is needed for the app to be real-time. And django channels is the option.
The question is "is it possible to combinate django rest framework, ionic2 and django channels altogether?" And additionally if I try to implement push notification using cordova plugin, could it be also work altogether? I know this question is quite bad but I am quite a beginner so i want to know before trying this approach..
any advice will be great for me, Thanks buddies in advance!

Yes, it is.
Ionic is going to be only a consumer of your Django-rest-framework API and your Django services. In other words, the front-end can be in any technology you want.
On the other side, Django-rest-framework + Channels work perfectly together. They are supposed to be. I've recently built a project with those technologies and I can guarantee that there is a perfect separation between the asynchronous processes and the typical Django HTTP runserver process.

Related

How can I implement frontend in API without using a framework?

hope you are having a great day.
I will get straight to the point, I have an application in Spring. I am using API calls from postman to retrieve my data.
Now I am asked to implement a front-end but without a framework, I was told that only ajax and javascript should do the trick.
How would I be able to implement this?
Keep in mind it is not an MVC application, but rather an API.
Thanks in advance
Several ways of doing so ! You can use
Javascript
Jquery
Angular JS
Check if below article helps
How to call a REST web service API from JavaScript?

Use Angular with Laravel

Anyone know if the best aproach to use laravel and angular is to use angular as Front-End and laravel as back end , or can i use both of them in all in One ?
In the case of each option can you explain please why is that the best aproach ?
Thanks Guys !
The best approach is to create a RESTFUL api in laravel as the backend, and use angular as the font-end client. This is currently the most popular approach as angular is great for creating what are known as "Single Page Applications" (SPA's). SPA's are popular because they allow you to create a seamless user experience by appropriately handling asynchronous behaviour. By keeping your REST api separate from your UI, you can also then add other clients as needed, such as a mobile/native client.

Making AJAX call from chrome extension to Meteor web app

Hi I have made a web app to practice Meteor and am now trying to make a companion chrome extension. I am having difficulty finding resources on how to make AJAX calls to my meteor app/mongodb.
An example of what I am trying to do is find specific words on a webpage and search them in my mongodb.
Any resources or information on how to best do this would be appreciated.
I suppose you know how to make Ajax call from client. So you are having difficulty in building a REST API in Meteor. Although it is not recommended to build a REST API with Meteor, you can still do it. If you use case just require a REST API and does not have much to do with reactivity, I think you should not go with Meteor, just Node and Express should be fine.
But if you really want to use Meteor, here is the solution: Meteor has a package named webapp which let you handle HTTP requests, that is enough for building a simple REST API. If you API is more complex, check out this community package nimble:restivus it has a better API and useful functions

React Native Phone-based login

Are there any good resources for having Phone-based login for React Native?
I came across the blog post below which was using Parse + Twilio. Has anyone implemented this for React Native or worked with a similar solution?
http://blog.parse.com/announcements/phone-based-login-can-you-dig-it/
2 things:
1) parse is being deprecated, so don't bet on using that. See https://github.com/ParsePlatform/parse-server/wiki/Migrating-an-Existing-Parse-App
2) It seems like this is less about React-native and more about communicating with an API. All you'd need to do in React-native is send some data back and forth between a server based on tokens sent and verified on a phone.
You can have a look at react-native-digits https://github.com/fixt/react-native-digits. It is a port of Twitter's phone-based login digits. I've not used it personally though

Phonegap and Django Authentication

I am in the middle of building a PhoneGap (Cordova) app which I would like to be able to talk to a Django site of mine. The steps needed to get the app working are:
Authenticate the user (stay logged-in across app restarts) (e.g. get session cookie from Django for communication with the service - where to store?). Note: The Django endpoint uses https.
When app receives push notification load some data from my django site.
Make selection on data and submit response back to my django site (will need the csrf token?)
I was able to sort out the push notifications but now I am wondering which solution would work best for the communication with Django.
As I understand there are two possible approaches:
Either to implement a REST service with something like tastypie or
try to setup the communication via ajax (e.g. jQuery)
At the moment I am thinking that going simply ajax might be the best approach since the app is fairly small and there are no additional requirement for a REST API.
It would be great if anyone could give me any pointers on how to solve this or share some experiece / code. Especially the steps of the authentication process are unclear to me.
I am not sure if this is still an open question but it is sure an interesting one.
I would strongly suggest on using the django-tastypie and you could start by using the docs which are indeed a great point of reference.
My experience until now has shown that I should always start by making my api clear(and rest) than choosing an easier faster solution(e.g. ajax) because if your app is a successful one, frameworks like tastypie help you scale.
The authentication process is pretty straightforward if you choose the basic one.
You just ask for the user credentials and there are many clients implementing the client side basic auth.
Fortunately, tastypie supports more than this. For example, the api authentication and you could read more here.
If you need anything else, please let me know.
Regards,
Michael.

Resources