angularjs

How do I use angularjs to send a http PUT Request using an id

How do I use angularjs to send a http PUT Request using an id Question: I have developed a Restful API in python that works with my database and table called groups. I have created script which allows me to GET & POST and I want to create script for PUT that will update a …

Total answers: 1

Web scraping – how to access content rendered in JavaScript via Angular.js?

Web scraping – how to access content rendered in JavaScript via Angular.js? Question: I’m trying to scrape data from the public site asx.com.au The page http://www.asx.com.au/asx/research/company.do#!/ACB/details contains a div with class ‘view-content’, which has the information I need: But when I try to view this page via Python’s urllib2.urlopen that div is empty: import urllib2 …

Total answers: 1

django-rest-framework how to make model serializer fields required

django-rest-framework how to make model serializer fields required Question: I have a model that I’m filling out step by step, it means I’m making a form wizard. Because of that most fields in this model are required but have null=True, blank=True to avoid raising not null errors when submitting part of the data. I’m working …

Total answers: 6

Is it possible to use AngularJS with the Jinja2 template engine?

Is it possible to use AngularJS with the Jinja2 template engine? Question: I have a Flask site and I want to use the AngularJS JavaScript framework. Unfortunately, it seems as if the delimiters overlap. How do I use Angular with Jinja2 if both rely on double curly braces ({{ expr }})? Is it even possible? …

Total answers: 2

Django REST Framework upload image: "The submitted data was not a file"

Django REST Framework upload image: "The submitted data was not a file" Question: I am leaning how to upload file in Django, and here I encounter a should-be-trivial problem, with the error: The submitted data was not a file. Check the encoding type on the form. Below is the detail. Note: I also looked at …

Total answers: 2

Get Authenticated user from token in Django Rest Framework

Get Authenticated user from token in Django Rest Framework Question: I am new in Django and I have managed to build a small API using DRF. I have my angular.js client end posting user auth details and DRF returns a token which looks like this: { ‘token’ : ‘9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b’ } Based on the tutorial, I …

Total answers: 2

User Authentication in Django Rest Framework + Angular.js web app

User Authentication in Django Rest Framework + Angular.js web app Question: I’m working on a webapp where users can login to see their online wine cellar. I’ve got the Django REST models setup, as well as the front-end design in Angular but I’m having trouble putting the pieces together and my main issue is for …

Total answers: 2

Django Rest Framework File Upload

Django Rest Framework File Upload Question: I am using Django Rest Framework and AngularJs to upload a file. My view file looks like this: class ProductList(APIView): authentication_classes = (authentication.TokenAuthentication,) def get(self,request): if request.user.is_authenticated(): userCompanyId = request.user.get_profile().companyId products = Product.objects.filter(company = userCompanyId) serializer = ProductSerializer(products,many=True) return Response(serializer.data) def post(self,request): serializer = ProductSerializer(data=request.DATA, files=request.FILES) if serializer.is_valid(): serializer.save() …

Total answers: 23

Flask RESTful cross-domain issue with Angular: PUT, OPTIONS methods

Flask RESTful cross-domain issue with Angular: PUT, OPTIONS methods Question: I’ve developed a small write-only REST api with Flask Restful that accepts PUT request from a handful of clients that can potentially have changing IP addresses. My clients are embedded Chromium clients running an AngularJS front-end; they authenticate with my API with a simple magic …

Total answers: 9