Code Monkey home page Code Monkey logo

invent's Introduction

sales-and-inventory-management-system (using django)

To setup virtual environment for the project and to install dependencies type : pipenv install
After that to start the WebApp type : python manage.py runserver
For authentication :
Superuser : 'yogesh' | Password : 'password'
Sample user for testing : username - 'sampleuser' | password - 'password@123'

SQL

  1. Initial db and user creation
create database sims;
create user simsadmin with encrypted password 'password';
grant all privileges on database sims to simsadmin;

Total Migrations :

admin
 [X] 0001_initial
 [X] 0002_logentry_remove_auto_add
 [X] 0003_logentry_add_action_flag_choices
auth
 [X] 0001_initial
 [X] 0002_alter_permission_name_max_length
 [X] 0003_alter_user_email_max_length
 [X] 0004_alter_user_username_opts
 [X] 0005_alter_user_last_login_null
 [X] 0006_require_contenttypes_0002
 [X] 0007_alter_validators_add_error_messages
 [X] 0008_alter_user_username_max_length
 [X] 0009_alter_user_last_name_max_length
 [X] 0010_alter_group_name_max_length
 [X] 0011_update_proxy_permissions
contenttypes
 [X] 0001_initial
 [X] 0002_remove_content_type_name
home
 [X] 0001_initial
sessions
 [X] 0001_initial

SQL to create view and demonstrate joins :

create view home_SupplierProductCostView as
select b.id, b.sname, sum(a.quantity*a.selling_price) as price
from home_inventory as a right join home_supplier as b
on a.supplier_id = b.id
group by a.supplier_id,b.id
order by b.id;

select * from home_SupplierProductCostView;

Instructions for hosting to heroku :

Install following :

  1. django-heroku
  2. gunicorn

After installing Create Procfile in project root with following line:

web: gunicorn project_name.wsgi
web: python project/manage.py runserver 0.0.0.0:$PORT

Add following lines in settings.py :

import django_heroku

Activate Django-Heroku.

django_heroku.settings(locals())

Then set DEBUG = False

Finally Run following commands in projects root directory :

heroku login
heroku create app-name
git add .
git commit -m "msg"
git push heroku master
heroku ps:scale web=1
heroku run bash
cd SIMS
python3 manage.py migrate
python3 manage.py loaddata supplier
python3 manage.py loaddata inventory
python3 manage.py createsuperuser
heroku open

invent's People

Contributors

juanshocl avatar dependabot[bot] avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.