Django App to interface with the AtlantisBot API
Project description
AtlantisBot API (Django App)
This is a Django App made to create an API that interfaces with AtlantisBot's Database.
Setup
-
Install the app
# Or 'pip install atlantisbot-api' poetry add atlantisbot-api
-
Add
"atlantisbot_api"
to yourINSTALLED_APPS
(insettings.py
):INSTALLED_APPS = [ ... 'atlantisbot_api' ]
-
(Optional, Discord Oauth) Setup Discord Oauth settings and API keys in your
settings.py
(sensitive configuration)DISCORD_OAUTH2_CLIENT_ID = 'CLIENT_ID' DISCORD_OAUTH2_CLIENT_SECRET = 'CLIENT_SECRET' DISCORD_OAUTH2_REDIRECT_URI = 'https://your-website-callback-url.com' DISCORD_API_BASE_URL = 'https://discord.com/api/v6' DISCORD_AUTHORIZATION_BASE_URL = DISCORD_API_BASE_URL + '/oauth2/authorize' DISCORD_TOKEN_URL = DISCORD_API_BASE_URL + '/oauth2/token' if 'http://' in DISCORD_OAUTH2_REDIRECT_URI: os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = 'true'
-
Include API paths in your project
urls.py
:path('atlantisbot/', include('atlantisbot_api.urls'))
-
Run
python manage.py migrate
to create theatlantisbot
models. -
Your API paths should now be running at the following routes:
# Database API Routes /atlantisbot/api/ # Discord API Oauth routes /atlantisbot/api/oauth/user/ /atlantisbot/api/oauth/authorize/
Docs
Management Commands
-
python manage.py clear_secretsanta
- Clears receiving and giving_to fields on every Secret Santa entry
-
python manage.py roll_secretsanta
- Make pairs for Secret Santa
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
atlantisbot_api-1.0.12.tar.gz
(11.5 kB
view hashes)
Built Distribution
Close
Hashes for atlantisbot_api-1.0.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85b54bd963862d57c8f081d32f45247c53ce9b8cd372807ff36764fd73b20c9c |
|
MD5 | 2cefaac4e254a90a09f7ee650654306b |
|
BLAKE2b-256 | f9f53636a9574ebd2d47730508368ce85a502b7e3e8b04a92e7abba9e257702a |