Add a short description here!
Project description
django-discord-py
An easy-to-use, easy-to-start with Discord.py bot with Django built right in.
Discord bots are really cool, and Django provides a lot of functionality for free. For a lot of developers this project may be too heavy weight to make sense. However, if you’re used to Django and want to start writing Discord bots then this should be a great place for you to start.
Important Notes Before We Get Started
If you’re new to developing django or have never installed a django server as a package before you may be used to running python manage.py <command>. For this project you will instead run
python -m django_discord.py <command>
If you don’t want this you can also install this package as normal and import the parts you want to use in your django project.
Prerequisites
By default this project requires Redis. Find installation instructions for you system at their site: https://redis.com
Installation
We recommend installing from PIP
pip install --upgrade django_discord_py
If you want to install from source
git clone <this_repo> cd <this_repo> pip install -e "."
Basic Bot Usage
Using the console_scripts entrypoint
python3 -m venv your_venv source your_venv/bin/activate pip install --upgrade django_discord_py discord_bot
Using the module directly
python3 -m venv your_venv source your_venv/bin/activate pip install --upgrade django_discord_py python -m django_discord.py.entrypoints.channels_entrypoint
Basic Django Server Usage
Using the console_scripts entrypoint
python3 -m venv your_venv source your_venv/bin/activate pip install --upgrade django_discord_py django_server
Using the module directly
python3 -m venv your_venv source your_venv/bin/activate pip install --upgrade django_discord_py python -m django_discord.py.entrypoints.http_entrypoint
Making Changes & Contributing
This project uses pre-commit, please make sure to install it before making any changes:
pip install pre-commit cd django-discord-py pre-commit install
It is a good idea to update the hooks to the latest version:
pre-commit autoupdate
Don’t forget to tell your contributors to also install and use pre-commit.
Extending The Server For Your Own Needs
Obviously, you will want your bot to do more than just respond to ?hi. To extend this bot you can set DJANGO_SETTINGS_MODULE in your environment to your own settings file. From there you will have all the normal controls over Django that you’re used to.
For ease-of-use you can see .env.example for a list of import environment variables.
Note
This project has been set up using PyScaffold 4.3.1. For details and usage information on PyScaffold see https://pyscaffold.org/.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django-discord-py-2023.1.28.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f5fa0570778a49514d30c50d7c64e09b09d0bc887e61ffc893df11ea5adc876 |
|
MD5 | b906616e19936ac0ff8481730b59b95c |
|
BLAKE2b-256 | fdcd7cc35eb183b008453793f37000b3b96aabb4fa8e3fdf9812f14ebe973c12 |
Hashes for django_discord_py-2023.1.28.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f0ac6f8c5fad8b26aa528e554b182098e3a1e6398d9bfa888754b6a37831fad |
|
MD5 | af570446f0650394ffc830e62917f934 |
|
BLAKE2b-256 | b31291224310f9679ddb18965a83f85605ca27b0bfc5a6956b3ccf74316c2b1e |