Skip to content

kinitrupti/Drycleaners

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Winterfell Dry Cleaners Web App Development

Winterfell Dry Cleaners is the biggest dry cleaning shop in town. They are very busy these days and need to improve their IT systems. Last month, they began development of a new web app and need your help building a component. In the past, staff wrote down a list of items a customer brought in for cleaning. They then handed the customer a piece of paper with an order number on it so they could identify the order upon collection. This process has been replaced with a new system that stores this information in a database. You can see the schema in the section below. You will need to recreate the database using this information. Staff members want to be able to look up an order by ID and print an invoice to give to the customer. Your job is to build this page for the new app. It needs to have the following functionality and design elements: Allow staff to enter an order ID and press a submit button. The page will then show the the following information for the matching order: i. Customer name ii. Order date iii. Line item table iv. VAT breakdown table The item table should have the below four columns. Show the total of all lines as the last row. i. Item name ii. Item price iii. Quantity iv. Line total All prices include VAT so a VAT breakdown needs to appear below the item table. It should have three columns: i. Total excluding VAT ii. VAT charged at 20% iii. Total including VAT

Basic Installation

  1. Install pip
$ sudo apt-get install python-pip
  1. Update pip to latest version (using sudo with pip requires the -H flag)
$ sudo -H pip install --upgrade pip
  1. Install Django
$ pip install django
  1. Download Dry cleaners app from Github repo.

  2. Edit the following lines of drycleaners/settings.py to match your environment

  3. Create the application database

sudo python manage.py migrate
  1. Create an admin user
sudo python manage.py create superuser
Username (leave blank to use 'root'): admin
Email address: [email protected]
Password:
Password (again):
Superuser created successfully.
  1. At this point, you should have enough configured to run the app using Python's development server. Run the following command and browse to http://localhost:8000
sudo python manage.py runserver 

Using MySQL instead of SQLite3

  1. Install MySQL client and Python MySQL driver
$ sudo apt-get install mysql-client
$ sudo -H pip install mysql-python
  1. Create the MySQL database and user
$ mysql -u root -p [-h servername]
create database 'drycleaners';
grant all on 'drycleaners'.* to 'drycleaners'@'%' identified by 'mysecretpassword';
exit;
  1. Update drycleaners/settings.py.
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'drycleaners',
        'USER': 'drycleaners',
        'PASSWORD': 'mysecretpassword',
        'HOST': 'servername',
        'PORT': '',
    }
}

About

A customer management app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published