API Contracts on Django REST API

Curl Request to verify API Contracts, on Django REST Framework Request a particular file API Contracts domain/files/(id) : Fetch the specified file for download curl example: sys2@sys2-HP-Compaq-8100-Elite-SFF-PC:~$ curl –user vidya:root@123 http://127.0.0.1:8000/files/26/ {“url”:”http://127.0.0.1:8000/files/26/”,”file”:”http://127.0.0.1:8000/uploads/uploads/file1.csv”} browser example: http://127.0.0.1:8000/files/26/ domain/files : Displays a list of files uploaded curl example: sys2@sys2-HP-Compaq-8100-Elite-SFF-PC:~$ curl –user vidya:roo.0.1:8000/files/ {“count”:2,”next”:null,”previous”:null,”results”:[{“url”:”http://127.0.0.1:8000/files/26/”,”file”:”http://127.0.0.1:8000/uploads/uploads/file1.csv”},{“url”:”http://127.0.0.1:8000/files/28/”,”file”:”http://127.0.0.1:8000/uploads/uploads/file2.csv”}]} browser example: http://127.0.0.1:8000/files/ POST A…

getting started with Django project

Following are the steps to set up  the Django project: 1.Create virtual environment for  the particular project and install django. a. Install virtual environment: sudo apt-get install python virtualenv. b. Create projects folder. c. Create folder for project1. d. virtualenv project1env –> command to create virtual environment for particular project1 e. source poject1env/bin/activate –> command…

Django Assignment

Steps:                 1. Uploading the file: It will upload the file and save that file into upload folder created by user. Once you click on the upload button it will redirect to  other page it says whether the file is uploaded successfully or not.                 2. Listing the files: This will displays the…

Ubuntu Ports, Process Commands

sudo netstat -peanut : Lists all the processes with ports sudo netstat -peant | grep “:9300 ” user@user-HP-Compaq-8100-Elite-SFF-PC:/opt/logstash/bin$ sudo netstat -lanpt | grep LIST | grep java tcp        0      0 127.0.0.1:63342         0.0.0.0:*               LISTEN      6493/java tcp        0      0 0.0.0.0:39953           0.0.0.0:*               LISTEN      6493/java tcp        0      0 127.0.0.1:6942          0.0.0.0:*               LISTEN      6493/java tcp        0      0 127.0.0.1:35040         0.0.0.0:*               LISTEN      6493/java…

Samples on Play

http://ics-software-engineering.github.io/play-example-mysql/ http://pedrorijo.com/blog/play-slick/   https://github.com/daxyonis https://alexgaribay.com/2014/06/16/authentication-in-play-framework-using-java/ Chat Application http://matthiasnehlsen.com/blog/2013/06/23/angularjs-and-play-framework/ Reactive, real-time log search with Play, Akka, AngularJS and Elasticsearch Forums built with Play https://github.com/hakandilek/publicplay https://devhub.io/repos/eljaydub-play2-crud http://www.programcreek.com/java-api-examples/index.php?source_dir=play2-crud-master/project-code/app/play/utils/crud/views/Utils.java#showField-FieldMetadata-fieldMetadata-Object-o Improving Play! 2.1 with Knockout.js   http://vyazici.blogspot.in/2012/03/chat-application-with-play-framework.html http://www.vdzon.com/2015/08/24/creating-a-web-application-with-play-akka-and-java/ http://geeks.aretotally.in/tag/play-framework-2/ https://dzone.com/articles/persistence-and-dao-testing-0 https://github.com/ianrae/mettle-framework https://www.toptal.com/java/building-modern-web-applications-with-angularjs-and-play-framework https://github.com/unterstein/play-knockout-sample http://www.ibm.com/developerworks/library/wa-playful-web-dev-1-trs-bluemix/   Optimizing Static Asset Loading with Play Framework FORMS https://github.com/JoseVte/template-api-rest-java-playframework.git https://github.com/opensas/play-demo/wiki/Step-6—styling-form JPA Neat Explanation of using JPA…

How to set up Nodejs for development and production environments on Ubuntu 16.04

Node.js is a Javascript platform for server-side programming that allows users to build network applications quickly. By leveraging Javascript on both the front-end and the back-end, development can be more consistent and be designed within the same system. NPM: makes it easy to share and reuse Javascript code. The bits of reusable code are called…

Real time scenarios on GIT

git clone https://github.com/beingsagir/play-java-spring-data-jpa.git git add -all : add all files new and modified locally git add -A && git commit -m “Comment formatting, 24 hour cache loader, api/contact.” add all files new and modified locally, commit them locally. How to see what has changed before actually doing commit # show differences between index and working…

NoSuchMethodError in javax.persistence.Table.indexes()[Ljavax/persistence/Index

URL url = Thread.currentThread().getContextClassLoader() .getResource(“javax/persistence/Table.class”); System.out.println(url); I’ve ran into the same problem. The question here is that play-java-jpa artifact (javaJpa key in the build.sbt file) depends on a different version of the spec (version 2.0 -> “org.hibernate.javax.persistence” % “hibernate-jpa-2.0-api” % “1.0.1.Final”). When you added hibernate-entitymanager 4.3 this brought the newer spec (2.1) and a different…