This is Petroly backend for our website Visit us
Note Do not clone this repo directly.
Steps:
-
Fork this repo.
-
Open a new terminal/powershell window.
-
Move to the directory where you want. For example:
-
Clone the repo that you forked, it'll similar to this:
git clone https://github.com/YOUR_NAME/petroly.git
-
Open a new VS Code window, or any other IDE, then drag & drop the cloned folder into VS Code.
We really prefer to set up your python env:
-
install latest python specified in
pyproject.toml
file, we advise you to usepyenv
manager -
install
poerty
from here -
create the virtual environment and install dependencies
poetry install
-
activate the virtual environment
poetry shell
Note If you face an error in installing
psycopg2
, because it need to build from source, you might need to install PostgresSQL, for MacOS
brew install postgresql
-
For first time you need to create a SQLite database, by running the command
python manage.py migrate
-
Run the server
python manage.py runserver
-
Start the telegram bot
python manage.py startbot
Note to use the telegram bot setup you need to generate a telegram bot token from BotFather. and use as an environmental variable named
TELEGRAM_BOT_TOKEN
( we recommend usingsecrets
vscode extension ) in the backend codebase. After naming your bot, change the bot name In your fork from the frontend inNotificationsModal.jsx
in the telegram button component to link it to your bot -
Run the async task for periodic checking
python manage.py qcluster
Warning This process is stopped by only killing the terminal running it. As the periodic checking is run infintely
The main branch is the one that gets deployed into Heroku automaticaly, once any commit detected.
If you find a bug 🐞 throughout your development or testing process, please do not hesitate to file an issue describing the bug you noticed.