How to use angular 2 in django 1.8? - django

I am novice to angular 2 . i am trying to use angular 2 framework in django 1.8. Is there any way we can use angular 2 in django ? i am looking for a simple example which will help me to build application. can anyone tell me How to do it?
Little help or any link I will appreciate it.

Angular is a framework to create client-side applications, while Django is a framework for server-side applications. I don't really see any use case for using Angular inside Django. Perhaps you're looking for a way to create a bridge between client and backend.
You could create an API with Django and create an client-side interface with Angular 2, if that makes any sense.

Related

is it possible to use regular Django+templates and Django restframework+a javascript framework in the same project?

I'm just wondering since Jquery is used less and less and instead of classic use with Ajax, if it is possible to let for example React or Vue handle all of the functionality where Javascript would be needed with DRF in one hand , and consider all of it as statics.
And in the other hand, keep working with Django and regular templates.
i'm just asking about the possiblity to do so.
Yes. There are many tutorials available for using Django, some with Wagtail as a CMS, with DRF as the backend. You can use a single template, and Vue or ReactJS for the front-end.
Here's a workshop video that might help get you started from the folks at Learn Wagtail: https://www.youtube.com/watch?v=xUWd3o6z2bk
(I chose Wagtail, because it is a popular Django CMS with DRF API endpoints out-of-the box.)

2 step authentication with django rest framework

EDIT
i am looking to implement a 2 step authentication into my django application. Previously , i have used the package django-two-step-auth, however i have made the decision to adopt the django x react.js combination. Unfortunately there is not much documentations talking about using this package with DRF. Has anyone successfully implemented the package in their django x react application?
It would be great if someone could point me in the correct direction!
Thanks

Django, phonegap and heroku. How to combine them?

I have made a web-app using django framework and stored it on heroku.
How can i combine phonegap so that I will be able to create both iOS and Android application that will simply load my hosted website?
I'm having an hard time knowing how to combine both technologies (django and phonegap) together, because phonegap requires the "index.html" and i dont know how to make it navigate to my main page.
And i dont know what "Procfile" to use in order that the heroku server will know how to react both.
I have seen somthing involves rest API for django. I found it hard to understand why should i add it for my website...
A tutorial would also be great !!
Integrating phonegap and django is a pretty broad topic covered here and in this tutorial.
For setting up multiple stacks on the same heroku app, you will probably want to use buildpack-multi.

Django + AngularJS: Recommendations on restful integration

Does anybody have any recommendations on how to integrate AngularJS with a current Django project? I have no experience with AngularJS but I like the asynchronous loading and update of objects, so it seems time to learn. There seem to be a lot of django and AngularJS pypi apps, but is that the best way to integrate?
Any advice on AngularJS integration with Django would be great.
Thanks
you could develop REST api, which returns responses in rest format, you could use tastypie for example.
Related topic how to return in json is here Django-tastypie. Output in JSON to the browser by default

Angular JS and Django

This might be a silly question that might relate to my ignorance about angular js, but is it possible to use a Django framework mostly for backend and database interactions, in conjunction with an Angular JS app/website?
I know angular js still requires Node Js for serving the data so, it seems like that would be a conflict. There was a similar but slightly more technical and specific from what I was looking for here: Django, REST and Angular Routes
What alternatives do I have if I want to experiment with Angular JS but need some database functionality?
Also how do you go about the fact that your code will be open to everyone?
Not a dumb question. But yes, it is totally doable. I put together a git seed for an angular web app with a django rest framework api. Check it out, I think it is exactly what you are looking for. Clone it down and try it out! Easy instructions to follow.
Angular-Django Seed
There is no dependency on NodeJS whatsoever. Your web framework handles server requests, and your angular app runs in the browser. You would use Django to serve the files used by the angular runtime, typically this includes a mix of HTML, JS and CSS files.
Your angular app may request data from the server, in which case it would 'call into' your Django code via an XHR request using the built in $http service (or possibly $resource service).