项目作者: yogesh-kamat

项目描述 :
Inventory management system using Django and Postgresql
高级语言: CSS
项目地址: git://github.com/yogesh-kamat/IMS.git
创建时间: 2019-04-10T17:32:29Z
项目社区:https://github.com/yogesh-kamat/IMS

开源协议:GNU General Public License v3.0

下载


Inventory management system

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
    1. create database sims;
    2. create user simsadmin with encrypted password 'password';
    3. grant all privileges on database sims to simsadmin;

Total Migrations

  1. admin
  2. [X] 0001_initial
  3. [X] 0002_logentry_remove_auto_add
  4. [X] 0003_logentry_add_action_flag_choices
  5. auth
  6. [X] 0001_initial
  7. [X] 0002_alter_permission_name_max_length
  8. [X] 0003_alter_user_email_max_length
  9. [X] 0004_alter_user_username_opts
  10. [X] 0005_alter_user_last_login_null
  11. [X] 0006_require_contenttypes_0002
  12. [X] 0007_alter_validators_add_error_messages
  13. [X] 0008_alter_user_username_max_length
  14. [X] 0009_alter_user_last_name_max_length
  15. [X] 0010_alter_group_name_max_length
  16. [X] 0011_update_proxy_permissions
  17. contenttypes
  18. [X] 0001_initial
  19. [X] 0002_remove_content_type_name
  20. home
  21. [X] 0001_initial
  22. sessions
  23. [X] 0001_initial

SQL to create view and demonstrate joins

  1. create view home_SupplierProductCostView as
  2. select b.id, b.sname, sum(a.quantity*a.selling_price) as price
  3. from home_inventory as a right join home_supplier as b
  4. on a.supplier_id = b.id
  5. group by a.supplier_id,b.id
  6. order by b.id;
  7. 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:

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

Add following lines in settings.py

  1. import django_heroku

Activate Django-Heroku.

  1. django_heroku.settings(locals())

Then set DEBUG = False

Finally Run following commands in projects root directory

  1. heroku login
  2. heroku create app-name
  3. git add .
  4. git commit -m "msg"
  5. git push heroku master
  6. heroku ps:scale web=1
  7. heroku run bash
  8. cd SIMS
  9. python3 manage.py migrate
  10. python3 manage.py loaddata supplier
  11. python3 manage.py loaddata inventory
  12. python3 manage.py createsuperuser
  13. heroku open