Python Project of Ch-117 mixed group ITA
- Install python 3.8 at the link
- Install MongoDB at the link
- Clone the repository
git clone https://github.com/mehalyna/Ch-117-Python-Project-ITA.git
- Install python packages from requirements.txt
pip install -r requirements.txt
- Initialize database
- Install MongoDB Compass
- Set up MongoDB Compass
- Meke connection mongodb://<your_url>:<your_port>
- Create database <your_db_name>
- Create file
.env
in root folder of the project with fields:
FLASK_SECRET_KEY=<your_secret_key> DJANGO_SECRET_KEY=<your_secret_key> DB_NAME=<your_db_name> MONGO_URL=<your_url> PORT=<your_port> EMAIL_HOST_USER=<your_app_email> EMAIL_HOST_PASSWORD=<your_app_email_password> ADMIN_EMAIL=<admin_email> CACHE_LIFETIME=<cache_lifetime_in_min> STRIPE_PUBLIC_KEY=<stripe_public_key> STRIPE_SECRET_KEY=<stripe_secret_key>
- admin
- user
- Create the first administrator user to login in admin.
- Start flask shell from terminal:
-
from models import MongoUser
-
u = MongoUser(firstname='<UserFirstname>', lastname='<UserLastname>', username='<Username>', role='admin', email='<[email protected]>')
- Minimum number of characters for login = 6
-
u.set_password('<UserPassword>')
- Minimum number of characters for password = 8
-
u.save()
Following commands should be run in the 'admin' directory of the projectad
- Run the server
theproject\admin>app.py
- Run the tests
theproject\admin>pytest -v
- To see test coverage
theproject\admin>coverage run -m --omit='*/venv/*' pytest -v theproject\admin>coverage report
Following commands should be run in the 'library' directory of the project
-
Run the server
theproject\library>python manage.py runserver
-
Run the tests
theproject\library>python manage.py test -v 2
-
To see test coverage
theproject\library>coverage run --omit='*/venv/*' manage.py test -v 2 theproject\library>coverage report
Start with our wiki
We are using simpliest github flow to organize our work:
- All Pull Requests should start from prefix #xxx-yyy where xxx - task number and and yyy - short description e.g. #020-CreateAdminPanel
- Pull request should not contain any files that is not required by task.
In case of any violations, pull request will be rejected.