Skip to content

A web application made using Python 3, Django 2, and PostgreSQL. Application allows to import users from csv file and change their balance.

Notifications You must be signed in to change notification settings

dawidbudzynski/points_app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Point App

General info

A web application made using Python 3, Django 2, and PostgreSQL.

Application allows to import users from csv file and change their balance.

Main functions

  • importing users from csv file using management command
  • displaying all users
  • making changes to users balance

Technologies

  • Python 3.7
  • Django 2.2
  • PostgreSQL

Setup

To run this project locally:

  1. In docker-compose.yaml replace temporary_secret_key with your own secret key (https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/#secret-key)

  2. Build containers and run collectstatic

docker-compose build
docker-compose run app sh -c 'python manage.py collectstatic'
  1. Import users from csv file
docker-compose run app sh -c 'python manage.py import_users_data temp/users.csv'
  1. Start containers
docker-compose up
  1. Application will be available at http://0.0.0.0:8000/

  2. To run tests

docker-compose run app sh -c 'python manage.py test'

Heroku deployment

To deploy application to Heroku:

  1. Sign up to Heroku account and install Heroku CLI https://devcenter.heroku.com/articles/heroku-cli
  2. In Heroku dashboard create new application
  3. In CLI connect to remote of your application
heroku git:remote -a <your-application-name>
  1. Log in to Container Registry
heroku container:login
  1. Build a local image with correct tag
docker build -t registry.heroku.com/<your-application-name>/web .
  1. Push your secret key
heroku config:set SECRET_KEY=SOME_SECRET_VALUE -a <your-application-name>
  1. Create and connect PostgreSQL
heroku addons:create heroku-postgresql:hobby-dev -a <your-application-name>
  1. Push local image to Heroku registry
docker push registry.heroku.com/<your-application-name>/web
  1. Release changes
heroku container:release -a <your-application-name> web
  1. Run manage.py migrate on Heroku
heroku run python manage.py migrate

About

A web application made using Python 3, Django 2, and PostgreSQL. Application allows to import users from csv file and change their balance.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published