Skip to content

languede/LP2T2X

Repository files navigation

ECO system project repository (by LP2T2X)

The concept

Eco Rewards is a reward system focusing on increasing consumers’ awareness of environment protection during their daily activities. The system aims at helping people to make more eco-friendly purchases.

Target audience

Consumers who want to contribute their efforts on protecting environment.
Consumers who are lacking awareness of environment protection

Overview

image https://drive.google.com/file/d/1RXOT-DT5sB8NG5My6jmeXHQK9m78LEOr/view?usp=sharing

The Wiki

https://outline.touryx.com:9443/s/49999f0e-d491-4c2e-b02c-9cb3ae08aa84

Using Docker (Recommand)

Assume you have docker & docker-compose installed

By default, the container will listen on 127.0.0.1:8000

  1. Clone this repo then go to directory LP2T2X
  2. Edit environment variable in the docker-compose.yml as needed.
  3. run docker compose up -d or docker-compose up -d depands how you installed docker-compose.

You may copy and paste following command to simply deploy it.

mkdir -p ~/git && \
git clone https://github.com/languede/LP2T2X.git && \
cd LP2T2X && \
sudo docker compose up -d

Done!

Menual Install

I am using anaconda to manage all the packages, it is strongly recommand to install Miniconda/Anaconda on your local system before you depoly this Django project.

About installing Anaconda please refer to their official documents: https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html

Step-by-step guide

If not useing anaconda, refer to the root path LP2T2X/ use the requirements.txt to create a python virtual environment

  1. Clone this repo by run git clone https://github.com/languede/LP2T2X.git
  2. Go to the project directory LP2T2X/ECO/
  3. In case you have anaconda installed, create virtual environment from the environment.yml file, run conda env create -f environment.yml
  4. Find and Edit setting.py under the path 'LP2T2X/ECO/eco/'
  5. Edit the list variable ALLOWED_HOSTS by append/adding for example localhost or anyother ip you want.
  6. Back to the project root directory which contain the manage.py file
  7. In the terminal, type python manage.py runserver to run Django project

p.s. If there were missing pacakages, try pip install <missing pacakage> to fix this error

p.s. use python manage.py runserver 0.0.0.0:8080 to make the web server listen on 0.0.0.0 and port 8080

Note:

For MacOS user:

Since zsh does not support django-phonenumber-field[phonenumberslite] Please type bash in mac's terminal to switch default shall to bash,
That is:
run bash in terminal // switch to bash shell
refer to environment.yml in LP2T2X/ECO/ to see the packages list

pip3 install django-phonenumber-field
pip3 install django-simple-history
pip3 install pyzbar opencv-python
pip3 install pillow

direct to manage.py , type: python3 manage.py runserver <host_address:port_number>

To run this Django project, you need to install following pacakages

please refer to the environment.yml file to see full pacakages used in this project

Pillow

pip install pillow

django-phonenumber-field

pip install django-phonenumber-field[phonenumberslite]

django-simple-history

pip install django-simple-history

pyzbar and opencv-python

pip install pyzbar opencv-python

install stripes for payment

pip install stripe3