Easily connect your discord app to django to create a web app for your discord bot using django models and REST API's.
- Ceate your .env file in the root of the directory then create a variable and put your token there
DISCORD_API_TOKEN=<your token here>
- Ceate your virtual environment
python -m venv venv
- Install Proeject requirements
pip install -r requirements.txt
windows:
.\venv\Scripts\activate
Linux/Mac:
source venv/bin/activate
- Create migrations and migrate
python manage.py makemigrations
python manage.py migrate
- Create a superuser for django's admin panel (optional)
python manage.py createsuperuser
- Run the server
python manage.py runserver
- Locate to ./discord_bot and run main.py
cd ./discord_bot
python main.py