Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

Database Website on Django

The following report is based on a DBMS of an online Art Gallery Online Shopping Store made using Django (front-end) and MYSQL_8.0 (for database storage).

  • Als Erste(r) kommentieren

  • Gehören Sie zu den Ersten, denen das gefällt!

Database Website on Django

  1. 1. DATABASE MANAGEMENT SYSTEM LAB PROJECT PROJECT TITLE: ONLINE SHOPPING STORE Submitted By: Meharunisa Ashraf 2017-EE-02 2017ee2@student.uet.edu.pk Hamda Anees 2017-EE-07 2017ee7@student.uet.edu.pk Submitted To: Sir Umer Shahid Department of Electrical Engineering University of Engineering & Technology Lahore
  2. 2. Contents Abstract: .....................................................................................................................................................................3 Introduction:...............................................................................................................................................................3 ONLINE SHOPPING STORE:.........................................................................................................................................4 ER DIAGRAM: .........................................................................................................................................................4 RELATIONAL SCHEMA: ...........................................................................................................................................5 Django framework: ....................................................................................................................................................5 Model: ....................................................................................................................................................................6 View:.......................................................................................................................................................................6 Template:................................................................................................................................................................6 PythonAnywhere: ......................................................................................................................................................6 Methodology:.............................................................................................................................................................6 Create the database tables:....................................................................................................................................7 Create the database views:.....................................................................................................................................7 Create the database Templates:.............................................................................................................................8 Functionality:............................................................................................................................................................10  Cover page ....................................................................................................................................................10 1st User:................................................................................................................................................................10  Signup page...................................................................................................................................................10  Login page.....................................................................................................................................................11  Home page....................................................................................................................................................11  Cart Page.......................................................................................................................................................12  Order Page ....................................................................................................................................................12 2nd User: ..............................................................................................................................................................13  Staff Page ......................................................................................................................................................13 3rd User: ...............................................................................................................................................................13  Admin Page...................................................................................................................................................13 Github Link: ......................................................................................................................................................14 Website link:.....................................................................................................................................................14 Demo Video:.....................................................................................................................................................14 Conclusion: ...............................................................................................................................................................14
  3. 3. ABSTRACT: This report introduces the process of creating part of a course management system which is a data- driven website used by the instructors and students. This website has four major components: grade, marking, group, and submission. The major part of the group component and minor part of marking component are implemented by me and the implementation details will be introduced in the report. The implementation uses a tool called Django Framework which is an excellent open source web application frame work for complex data-driven website development. The major part of this report will introduce how to use Django to create a database table, web page user interface and inner logic to handle user request by going through the group component implementation process. INTRODUCTION: This project report will introduce how to build part of a course management system using the Django framework. Django is an open source web application frame work which is written in Python. This course management system built using Django has four major components each of which has different functionality but similar architecture. In the project report I will demonstrate details of using Django to build one major component of this system: the group component, which is my major contribution to the whole system. Also the technique and process which is showed here can be applied to build the other three components in the course management system as well as other complex database-driven websites.
  4. 4. ONLINE SHOPPING STORE: Developed a shopping website built with Django html. This projects aims to develop an online shopping for customers with the goal so that it is very easy to shop your loved things from an extensive number of online shopping sites available on the web. With the help of this you can carry out an online shopping from your home. Here is no compelling reason to go to the crowed stores or shopping centers during festival seasons. You simply require a PC or a laptop and one important payment sending option to shop online. To get to this online shopping system all the customers will need to have an email and password to login and proceed your shopping. We have divided the work in group as created models and populated data and wrote views with html pages. ER DIAGRAM:  I have not mentioned Admin as Entity in ER Diagram because I will be using it as Django Administration.  I will be using Cart by creating virtual session. I will not make a model for it.  Order List Relation contains the ID’s of customer, Staff, Product, Orders.  Staff will be seeing the order list placed by all the customers.
  5. 5. RELATIONAL SCHEMA: DJANGO FRAMEWORK: Django is an open source web application frame work written in Python. The primary goal of Django is to make the development of complex, data-based websites easier. Thus Django emphasizes the reusability and plug ability of components to ensure rapid developments. Django consists of three major parts:  model  view  template
  6. 6. Model: Model is a single, definitive data source which contains the essential field and behavior of the data. Usually one model is one table in the database. Each attribute in the model represents a field of a table in the database. Django provides a set of automatically-generated database application programming interfaces (APIs) for the convenience of users. View: View is short form of view file. It is a file containing Python function which takes web requests and returns web responses. A response can be HTML content or XML documents or a “404 error” and so on. The logic inside the view function can be arbitrary as long as it returns the desired response. To link the view function with a particular URL we need to use a structure called URLconf which maps URLs to view functions. Template: Django’s template is a simple text file which can generate a text-based format like HTML and XML. The template contains variables and tags. Variables will be replaced by the result when the template is evaluated. Tags control the logic of the template. We also can modify the variables by using filters. For example, a lowercase filter can convert the variable from uppercase into lowercase. Python is the language used to build the Django framework. PYTHONANYWHERE: PythonAnywhere is an online integrated development environment and web hosting service based on the Python programming language. Established by Giles Thomas and Robert Smithson in 2012, it gives in-program admittance to worker based Python and Bash order line interfaces, alongside a code editorial manager with linguistic structure featuring. Program documents can be moved to and from the administration utilizing the client's program. Web applications facilitated by the administration can be composed utilizing any WSGI-based application structure. PythonAnywhere was made by Resolver Systems, who likewise delivered Resolver One, a Python-based Spreadsheet program. On 16 October 2012 the item was obtained by another organization, PythonAnywhere LLP, who will create and keep up the item later on, and have taken on the current improvement group. METHODOLOGY: This online shopping store website is basically approached by three types of users which are Admin, Customer and Staff.
  7. 7. Create the database tables: To get started, we need to create a backend of the system which is the database. All the tables in the database for this website include information for customers, products, catalogue, and orders. For example: Create the database views: First, it is used to pass parameters to the template and call the right template for the user. Every time we input a URL in the address bar or click a hyperlink in the system, Django will call the right view function based on that URL. Then the function will return a template as well as the corresponding parameters. Thus we can see the actual web page displaying the information we need. Second, if we submit something such as create group, the function will have an http request as its input parameter. Based on that parameter the database is updated or the user is provided the required information. The view function for creating a group is given below:
  8. 8. Create the database Templates: Being a web framework, Django needs a convenient way to generate HTML dynamically. The most common approach relies on templates. A template contains the static parts of the desired HTML output as well as some special syntax describing how dynamic content will be inserted. For a hands-on example of creating HTML pages with templates. For example:
  9. 9. FUNCTIONALITY:  Cover page 1st User:  Signup page A visitor can create an account with the Sign-Up page.
  10. 10.  Login page Customer uses Login page to open account and accesses the website content.  Home page Products are displayed in home page with option of catalogue. It is similar for all users.
  11. 11.  Cart Page After logging in customer/user can access the cart having the selected products to buy.  Order Page This page will be having all the orders placed by one user id, it will show if the order is still pending or completed with quantity of product and all other information about it.
  12. 12. 2nd User:  Staff Page Staff member with assigned id can access this page only. It will show all the orders placed by all the customers. 3rd User:  Admin Page The admin page is restricted only for administrators where they can add new products, catalogue etc.
  13. 13. Github Link: https://github.com/MeharunisaAshraf/Django_Eshop Website link: http://mehrunisaashraf.pythonanywhere.com/ Demo Video: https://drive.google.com/file/d/1ENPFdK_R2C- JyvTh1Z4ZamiDskcyRrMS/view?usp=sharing CONCLUSION: The Django framework gives us a simple and reliable way to create online website. It provides powerful functionalities and concise syntax to help programmers deal with the database, the web page and the inner logic. Within the Django framework, we have successfully accomplished the requirements of the system. Once this system passes the testing phase, it can be used to serve customers. It will make the work for staff/admin to manage the data much easier. In short, this system will bring great user experience to both customers and staff members. The only limitation for this system is that although the developers have been testing it with various use cases, it may still encounter problems during real time use. However, even if that happens, the flexibility of Django would provide a simple way to fix the problem, as well as add new features into the system.

×