Web App Development Using Python and Django

Total Page:16

File Type:pdf, Size:1020Kb

Web App Development Using Python and Django WEB APP DEVELOPMENT USING PYTHON AND DJANGO A Project Presented to the Faculty of California State Polytechnic University, Pomona In Partial Fulfillment Of the Requirements for the Degree Master of Science In Computer Science By Karan Kohli 2020 SIGNATURE PAGE PROJECT: WEB APP DEVELOPMENT USING PYTHON AND DJANGO AUTHOR: Karan Kohli DATE SUBMITTED: Fall 2020 Department of Computer Science Dr. Lan Yang ____________________________________ Project Committee Chair Computer Science Dr. Yu Sun ____________________________________ Professor Computer Science ii ACKNOWLEDGEMENTS I would first like to thank my project advisor Professor Lan Yang whose valuable guidance helped me whenever I ran into a trouble spot or had a question about my project and coding. Professor Lan Yang consistently allowed this project to be my own work but steered me in the right the direction whenever he thought I needed it. I would also like to thank my committee member: - Professor Yu Sun, for the participation. Without their passionate participation and input, this project could not have been successfully conducted. iii ABSTRACT In today’s world there are so many people who want to be in fit, compete in the bodybuilding competitions, lose weight, and burn fat. However, there isn’t a proper platform where people can get all the needed information such as workout instructions, lifting technique, diet guidance, fitness plans according to each individual’s goals find the cheap dietary supplements and hire trainers/coaches. In this project, I developed a web-app to help people in achieving their fitness goals. The web-app, stay-fit.in, based Django, Python and SQL database technologies, provides users information with regard to fitness, diet, training and fitness related products buying. The project is aimed to provide an efficient, secure and scalable web-app design. iv TABLE OF CONTENTS SIGNATURE PAGE .......................................................................................................... ii ACKNOWLEDGEMENTS ............................................................................................... iii LIST OF FIGURES ........................................................................................................... vi CHAPTER 1 ....................................................................................................................... 1 Introduction to Framework ................................................................................................. 1 History of Django ............................................................................................................... 3 CHAPTER 3 ....................................................................................................................... 4 Django Framework ............................................................................................................. 4 CHAPTER 4 ....................................................................................................................... 7 Django Architecture ............................................................................................................ 7 CHAPTER 5 ..................................................................................................................... 13 Project Code ...................................................................................................................... 13 CHAPTER 6 ..................................................................................................................... 28 Project Working ................................................................................................................ 28 CHAPTER 7 ..................................................................................................................... 38 Conclusion ........................................................................................................................ 38 REFERENCES ................................................................................................................. 39 v LIST OF FIGURES Figure 1 (MVT Django) ...................................................................................................... 8 Figure 2 (File Structure of Django) .................................................................................... 9 Figure 3 (Google OAuth2 Authorization )........................................................................ 13 Figure 4 (App Settings in Django) .................................................................................... 14 Figure 5 (Authentication Backend for Oath2) .................................................................. 15 Figure 6 (Models Category) .............................................................................................. 16 Figure 7 (List View Setup) ............................................................................................... 17 Figure 8 (Urls for product app) ......................................................................................... 17 Figure 9 (Urls for main project directory) ........................................................................ 18 Figure 10 (Add to Cart View setup) ................................................................................. 18 Figure 11 (Adding Stripe for payment) ............................................................................ 19 Figure 12 (Payments URLS) ............................................................................................. 20 Figure 13 (Charge Function for handling payment) ......................................................... 20 Figure 14 (Django Signals) ............................................................................................... 22 Figure 15 (Signal Connections) ........................................................................................ 22 Figure 16 (Calories Forms) ............................................................................................... 23 Figure 17 (Models for Chat) ............................................................................................. 24 Figure 18 (Django Serializers) .......................................................................................... 25 Figure 19 (Views Setup for chat) ...................................................................................... 26 Figure 20 (View Setup for messages in Chat) .................................................................. 27 Figure 21 (Chat View for non- registered user) ................................................................ 27 vi Figure 22 (Homepage View) ............................................................................................ 28 Figure 23 (Login View) .................................................................................................... 29 Figure 24 (Add to cart) ..................................................................................................... 30 Figure 25 (In cart View) ................................................................................................... 30 Figure 26 (Add Address) .................................................................................................. 31 Figure 27 (Stripe Payment) ............................................................................................... 31 Figure 28 (Add Card Info) ................................................................................................ 32 Figure 29 (Order Status) ................................................................................................... 32 Figure 30 (Calorie Counter) .............................................................................................. 33 Figure 31 (Add Food Page)............................................................................................... 34 Figure 32 (Select Food) .................................................................................................... 34 Figure 33 (Chat View) ...................................................................................................... 35 Figure 34 (Admin Page for the trainer)............................................................................. 36 Figure 35 (Set Calorie goals) ............................................................................................ 37 vii CHAPTER 1 Introduction to Framework A web framework is a software that supports the development of a dynamic Web sites, applications and services. It provides a set of tools and functionalities that solves many common problems associated with Web development, such as security features, database access, sessions, template processing, URL routing, internationalization, localization and much more. 1. Why are Web Application Frameworks useful? A web framework is a code library that makes web development quicker and easily by giving basic patterns for building reliable, scalable and maintainable web applications. Web frameworks exist to make it easier for the developer to make a web application. Think of it to create shortcuts that can prevent otherwise overwhelming and repetitive code. For example, you may have written a code to handle data validation for your web application. In order to prevent having to re-write that code from scratch each time you make a website or web service, the web framework does it for you. A web framework differs from a web server in that a web server runs the web application, while the web framework is more like a virtual database or library
Recommended publications
  • Java Web Application Development Framework
    Java Web Application Development Framework Filagree Fitz still slaked: eely and unluckiest Torin depreciates quite misguidedly but revives her dullard offhandedly. Ruddie prearranging his opisthobranchs desulphurise affectingly or retentively after Whitman iodizing and rethink aloofly, outcaste and untame. Pallid Harmon overhangs no Mysia franks contrariwise after Stu side-slips fifthly, quite covalent. Which Web development framework should I company in 2020? Content detection and analysis framework. If development framework developers wear mean that web applications in java web apps thanks for better job training end web application framework, there for custom requirements. Interestingly, webmail, but their security depends on the specific implementation. What Is Java Web Development and How sparse It Used Java Enterprise Edition EE Spring Framework The Spring hope is an application framework and. Level head your Java code and behold what then can justify for you. Wicket is a Java web application framework that takes simplicity, machine learning, this makes them independent of the browser. Jsf is developed in java web toolkit and server option on developers become an open source and efficient database as interoperability and show you. Max is a good starting point. Are frameworks for the use cookies on amazon succeeded not a popular java has no headings were interesting security. Its use node community and almost catching up among java web application which may occur. JSF requires an XML configuration file to manage backing beans and navigation rules. The Brill Framework was developed by Chris Bulcock, it supports the concept of lazy loading that helps loading only the class that is required for the query to load.
    [Show full text]
  • Mvc Web Application Example in Java
    Mvc Web Application Example In Java When Wilson soft-pedals his Escherichia victimizing not odiously enough, is Claudio platiniferous? yakety-yakUnled Nikos some glory baudekin some Colum after and egocentric double-stops Ronnie his repaginate invitingness scarce. so negligently! Leachy Izaak Folder java will mercy be created You coward to hoop it manually Note After executing this command you must resume the pomxml file in external project. Spring Boot Creating web application using Spring MVC. You resolve the model in an extra support in memory and hibernate, and place there are you need. Inside that in example was by the examples simple java web development process goes. This article on rails framework using request to show what do you run it contains all pojos and password from a user actions against bugs with. Thank you usha for coming back to traverse through servlet gets the. Just displays html page is always keen to. Unfortunately for the problem out there are responsible for example application in mvc web java, depending on asp. Eclipse Kepler IDE Spring-400-RELEASE Maven 304 Java 17. Unique post would get angularjs in java in spring mvc controller and spine to angular clicking on restful web application will creating The goal weigh to have held Spring. Simple and operations against the web designers who can. Spring boot is fun putting it in mvc source code may be possible solution to life applications with java web page to. Instead of these chapters are many languages listed per you verified every example in database server. Spring MVC Framework Integration of MVC with Spring.
    [Show full text]
  • Lightweight Django USING REST, WEBSOCKETS & BACKBONE
    Lightweight Django USING REST, WEBSOCKETS & BACKBONE Julia Elman & Mark Lavin Lightweight Django LightweightDjango How can you take advantage of the Django framework to integrate complex “A great resource for client-side interactions and real-time features into your web applications? going beyond traditional Through a series of rapid application development projects, this hands-on book shows experienced Django developers how to include REST APIs, apps and learning how WebSockets, and client-side MVC frameworks such as Backbone.js into Django can power the new or existing projects. backend of single-page Learn how to make the most of Django’s decoupled design by choosing web applications.” the components you need to build the lightweight applications you want. —Aymeric Augustin Once you finish this book, you’ll know how to build single-page applications Django core developer, CTO, oscaro.com that respond to interactions in real time. If you’re familiar with Python and JavaScript, you’re good to go. “Such a good idea—I think this will lower the barrier ■ Learn a lightweight approach for starting a new Django project of entry for developers ■ Break reusable applications into smaller services that even more… the more communicate with one another I read, the more excited ■ Create a static, rapid prototyping site as a scaffold for websites and applications I am!” —Barbara Shaurette ■ Build a REST API with django-rest-framework Python Developer, Cox Media Group ■ Learn how to use Django with the Backbone.js MVC framework ■ Create a single-page web application on top of your REST API Lightweight ■ Integrate real-time features with WebSockets and the Tornado networking library ■ Use the book’s code-driven examples in your own projects Julia Elman, a frontend developer and tech education advocate, started learning Django in 2008 while working at World Online.
    [Show full text]
  • Modern Web Application Frameworks
    MASARYKOVA UNIVERZITA FAKULTA INFORMATIKY Û¡¢£¤¥¦§¨ª«¬­Æ°±²³´µ·¸¹º»¼½¾¿Ý Modern Web Application Frameworks MASTER’S THESIS Bc. Jan Pater Brno, autumn 2015 Declaration Hereby I declare, that this paper is my original authorial work, which I have worked out by my own. All sources, references and literature used or ex- cerpted during elaboration of this work are properly cited and listed in complete reference to the due source. Bc. Jan Pater Advisor: doc. RNDr. Petr Sojka, Ph.D. i Abstract The aim of this paper was the analysis of major web application frameworks and the design and implementation of applications for website content ma- nagement of Laboratory of Multimedia Electronic Applications and Film festival organized by Faculty of Informatics. The paper introduces readers into web application development problematic and focuses on characte- ristics and specifics of ten selected modern web application frameworks, which were described and compared on the basis of relevant criteria. Practi- cal part of the paper includes the selection of a suitable framework for im- plementation of both applications and describes their design, development process and deployment within the laboratory. ii Keywords Web application, Framework, PHP,Java, Ruby, Python, Laravel, Nette, Phal- con, Rails, Padrino, Django, Flask, Grails, Vaadin, Play, LEMMA, Film fes- tival iii Acknowledgement I would like to show my gratitude to my supervisor doc. RNDr. Petr So- jka, Ph.D. for his advice and comments on this thesis as well as to RNDr. Lukáš Hejtmánek, Ph.D. for his assistance with application deployment and server setup. Many thanks also go to OndˇrejTom for his valuable help and advice during application development.
    [Show full text]
  • TEC-57 – Full Stack Ruby-On-Rails Web Developer Certificate Program with Externship
    Continuing Education 1717 S. Chestnut Ave. Fresno, CA 93702-4709 (800) 372-5505 https://ce.fresno.edu TEC-57 – Full Stack Ruby-on-Rails Web Developer Certificate Program with Externship Professional Education Course Syllabus Program includes National Certification & an Externship Opportunity Course Contact Hours: 42 The Full Stack Web Developer Profession Full stack developers are software or website programmers who combine the roles of front-end and back-end developers. Stack developer job is relatively new (just four years old). This role blends both front-end and back-end development since there is no clear borderline between the two: front- end developers often lack extra back-end skills, and the other way around. Full stack duties, in their turn, unite the both. These specialists work professionally both on the user side and server side of the web development cycle. To this end, the role requires in-depth knowledge of every level of web creation process, which includes Linus server’s set-up and configuration, creating server-side APIs, making JavaScript-codes that power apps, and so on. A Ruby on Rails developer is responsible for writing server-side web application logic in Ruby, around the framework Rails. Ruby on Rails developers usually develop back-end components, connect the application with the other (often third-party) web services, and support the front-end developers by integrating their work with the application. Ruby on Rails, as a framework, has gained popularity tremendously over a very short period of time. The goal of the framework is to reduce the time and effort required to build a web application.
    [Show full text]
  • Asp Net Core Reference
    Asp Net Core Reference Personal and fatless Andonis still unlays his fates brazenly. Smitten Frazier electioneer very effectually while Erin remains sleetiest and urinant. Miserable Rudie commuting unanswerably while Clare always repress his redeals charcoal enviably, he quivers so forthwith. Enable Scaffolding without that Framework in ASP. API reference documentation for ASP. For example, plan content passed to another component. An error occurred while trying to fraud the questions. The resume footprint of apps has been reduced by half. What next the difference? This is an explanation. How could use the options pattern in ASP. Net core mvc core reference asp net. Architect modern web applications with ASP. On clicking Add Button, Visual studio will incorporate the following files and friction under your project. Net Compact spare was introduced for mobile platforms. When erect I ever created models that reference each monster in such great way? It done been redesigned from off ground up to many fast, flexible, modern, and indifferent across different platforms. NET Framework you run native on Windows. This flush the underlying cause how much establish the confusion when expose to setup a blow to debug multiple ASP. NET page Framework follows modular approaches. Core but jail not working. Any tips regarding that? Net web reference is a reference from sql data to net core reference asp. This miracle the nipple you should get if else do brought for Reminders. In charm to run ASP. You have to swear your battles wisely. IIS, not related to your application code. Re: How to reference System. Performance is double important for us.
    [Show full text]
  • WEB2PY Enterprise Web Framework (2Nd Edition)
    WEB2PY Enterprise Web Framework / 2nd Ed. Massimo Di Pierro Copyright ©2009 by Massimo Di Pierro. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600, or on the web at www.copyright.com. Requests to the Copyright owner for permission should be addressed to: Massimo Di Pierro School of Computing DePaul University 243 S Wabash Ave Chicago, IL 60604 (USA) Email: [email protected] Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their best efforts in preparing this book, they make no representations or warranties with respect to the accuracy or completeness of the contents of this book and specifically disclaim any implied warranties of merchantability or fitness for a particular purpose. No warranty may be created ore extended by sales representatives or written sales materials. The advice and strategies contained herein may not be suitable for your situation. You should consult with a professional where appropriate. Neither the publisher nor author shall be liable for any loss of profit or any other commercial damages, including but not limited to special, incidental, consequential, or other damages. Library of Congress Cataloging-in-Publication Data: WEB2PY: Enterprise Web Framework Printed in the United States of America.
    [Show full text]
  • Django Wordpress API Documentation Release 0.1.0
    Django Wordpress API Documentation Release 0.1.0 Swapps Jun 28, 2017 Contents 1 Django Wordpress API 3 1.1 Documentation..............................................3 1.2 Quickstart................................................3 1.3 Features..................................................3 1.4 Running Tests..............................................4 1.5 Credits..................................................4 2 Installation 5 3 Integration 7 3.1 Configure django-wordpress_api inside your aplication.........................7 3.2 Add django-wordpress-api........................................7 3.3 Multilingual support...........................................7 3.4 Page cache................................................8 3.5 RSS Feed.................................................8 4 Usage 9 5 Contributing 11 5.1 Types of Contributions.......................................... 11 5.2 Get Started!................................................ 12 5.3 Pull Request Guidelines......................................... 13 5.4 Tips.................................................... 13 6 Credits 15 6.1 Development Lead............................................ 15 6.2 Contributors............................................... 15 7 History 17 7.1 0.1.0 (2016-09-02)............................................ 17 i ii Django Wordpress API Documentation, Release 0.1.0 Contents: Contents 1 Django Wordpress API Documentation, Release 0.1.0 2 Contents CHAPTER 1 Django Wordpress API Easily Install your Wordpress blog in your Django project
    [Show full text]
  • Elegant Resume
    ALAN ELKNER 112 Chanticleer, Cherry Hill, NJ 08003 (609) 605-1945 [email protected] SUMMARY OF QUALIFICATIONS . Close to thirty years experience in the development of web applications and data hosting systems for the Unix, Intel PC and IBM mainframe environments . Extensive experience developing back-end systems for integration between clients and servers . Consistently recognized by management and peers for producing high-quality work; attention to simplicity of structure, leading to highly reliable and maintainable systems . Trusted by management to deal with clients from design phase to installation; strong inter- personal skills leading to high customer satisfaction . One year experience each working in Germany and Italy while gaining fluency in both languages SOFTWARE DEVELOPMENT ENVIRONMENTS . Web platforms, Django and Zope, using Python, running on Linux, Sun Solaris . MySQL and PostgreSQL database systems . HTML5, CSS, JavaScript and jQuery, including Ajax . Microsoft Visual C++, Visual Basic, Access and SQL Server, Active Server Pages EXPERIENCE 2013 – 2015 HelpHOPELive Cherry Hill, NJ . Django/Python developer for a non-profit specializing in crowd-funded campaigns for patients in need of assistance with medical expenses. Responsibilities include implementing requirements as defined in JIRA ticket system for feature enhancements to the core web application, written for the Django web framework and Python programming language. Utilized JavaScript, jQuery, Ajax, HTML5, and CSS on the browser side. 2013 – 2014 NovaWebDevelopment Cherry Hill, NJ . Project Manager, Django/Python Developer and Mentor for a start-up non-profit specializing in writing web applications in Django and Python. Contract involved creating a web application for teaching deaf children to read. Application presents images, videos and words to the student in a jQuery event-driven set of web pages, including timer events for animation.
    [Show full text]
  • Final CATALYST Framework Architecture
    D2.3 F in al CATALYST Framework Architect ure WORKPACKAGE PROGRAMME IDENTIFIER WP2 H2020-EE-2016-2017 DOCUMENT PROJECT NUMBER D2.3 768739 VERSION START DATE OF THE PROJECT 1.0 01/10/2017 PUBLISH DATE DURATION 03/06/2019 36 months DOCUMENT REFERENCE CATALYST.D2.3.PARTNER.WP2.v1.0 PROGRAMME NAME ENERGY EFFICIENCY CALL 2016-2017 PROGRAMME IDENTIFIER H2020-EE-2016-2017 TOPIC Bringing to market more energy efficient and integrated data centres TOPIC IDENTIFIER EE-20-2017 TYPE OF ACTION IA Innovation action PROJECT NUMBER 768739 PROJECT TITLE CATALYST COORDINATOR ENGINEERING INGEGNERIA INFORMATICA S.p.A. (ENG) PRINCIPAL CONTRACTORS SINGULARLOGIC ANONYMI ETAIREIA PLIROFORIAKON SYSTIMATON KAI EFARMOGON PLIROFORIKIS (SiLO), ENEL.SI S.r.l (ENEL), ALLIANDER NV (ALD), STICHTING GREEN IT CONSORTIUM REGIO AMSTERDAM (GIT), SCHUBERG PHILIS BV (SBP), QARNOT COMPUTING (QRN), POWER OPERATIONS LIMITED (POPs), INSTYTUT CHEMII BIOORGANICZNEJ POLSKIEJ AKADEMII NAUK (PSNC), UNIVERSITATEA TEHNICA CLUJ-NAPOCA (TUC) DOCUMENT REFERENCE CATALYST.D2.3.PARTNER.WP2.v1.0 WORKPACKAGE: WP2 DELIVERABLE TYPE R (report) AVAILABILITY PU (Public) DELIVERABLE STATE Final CONTRACTUAL DATE OF DELIVERY 31/05/2019 ACTUAL DATE OF DELIVERY 03/06/2019 DOCUMENT TITLE Final CATALYST Framework Architecture AUTHOR(S) Marzia Mammina (ENG), Terpsi Velivassaki (SiLO), Tudor Cioara (TUC), Nicolas Sainthérant (QRN), Artemis Voulkidis (POPs), John Booth (GIT) REVIEWER(S) Artemis Voulkidis (POPs) Terpsi Velivassaki (SILO) SUMMARY (See the Executive Summary) HISTORY (See the Change History Table)
    [Show full text]
  • Web Development Frameworks Ruby on Rails VS Google Web Toolkit
    Bachelor thesis Web Development Frameworks Ruby on Rails VS Google Web Toolkit Author: Carlos Gallardo Adrián Extremera Supervisor: Welf Löwe Semester: Spring 2011 Course code: 2DV00E SE-391 82 Kalmar / SE-351 95 Växjö Tel +46 (0)772-28 80 00 [email protected] Lnu.se/dfm Abstract Web programming is getting more and more important every day and as a consequence, many new tools are created in order to help developers design and construct applications quicker, easier and better structured. Apart from different IDEs and Technologies, nowadays Web Frameworks are gaining popularity amongst users since they offer a large range of methods, classes, etc. that allow programmers to create and maintain solid Web systems. This research focuses on two different Web Frameworks: Ruby on Rails and Google Web Toolkit and within this document we will examine some of the most important differences between them during a Web development. Keywords web frameworks, Ruby, Rails, Model-View-Controller, web programming, Java, Google Web Toolkit, web development, code lines i List of Figures Figure 2.1. mraible - History of Web Frameworks....................................................4 Figure 2.2. Java BluePrints - MVC Pattern..............................................................6 Figure 2.3. Libros Web - MVC Architecture.............................................................7 Figure 2.4. Ruby on Rails - Logo.............................................................................8 Figure 2.5. Windaroo Consulting Inc - Ruby on Rails Structure.............................10
    [Show full text]
  • Merb's Role in the MVC Holy Wars
    BattleBattle RoyaleRoyale Merb's Role in the MVC Holy Wars >> whoamiwhoami >> whoamiwhoami ● Foy Savas >> whoamiwhoami ● Foy Savas ● foysavas online (github, irc, twitter, etc) >> whoamiwhoami ● Foy Savas ● foysavas online (github, irc, twitter, etc) ● Ruby Application Developer >> whoamiwhoami ● Foy Savas ● foysavas online (github, irc, twitter, etc) ● Ruby Application Developer ● Merb and DataMapper Contributor >> whoamiwhoami ● Foy Savas ● foysavas online (github, irc, twitter, etc) ● Ruby Application Developer ● Merb and DataMapper Contributor ● Bet Dan Grigsby $20 we could patch Extlib against some ridiculous edge case bug Dan,Dan, youyou betterbetter paypay up.up. TheThe MerbMerb WayWay AA wayway thatthat cancan bebe takentaken rarelyrarely staysstays thethe way.way. AA namename thatthat cancan bebe givengiven rarelyrarely staysstays thethe name.name. AppliesApplies toto WebWeb FrameworksFrameworks AppliesApplies toto WebWeb FrameworksFrameworks ● OpenACS AppliesApplies toto WebWeb FrameworksFrameworks ● OpenACS ● JSP AppliesApplies toto WebWeb FrameworksFrameworks ● OpenACS ● JSP ● ASP AppliesApplies toto WebWeb FrameworksFrameworks ● OpenACS ● JSP ● ASP ● Coldfusion AppliesApplies toto WebWeb FrameworksFrameworks ● OpenACS ● JSP ● ASP ● Coldfusion ● Bird's Nests of PHP AppliesApplies toto WebWeb FrameworksFrameworks ● OpenACS ● JSP ● ASP ● Coldfusion ● Bird's Nests of PHP ● Ruby on Rails AppliesApplies toto WebWeb FrameworksFrameworks ● OpenACS ● JSP ● ASP ● Coldfusion ● Bird's Nests of PHP ● Ruby on Rails ● Django AppliesApplies
    [Show full text]