Skip to content

Website build with django for the Tortoise Community discord server.

License

Notifications You must be signed in to change notification settings

Tortoise-Community/Backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tortoise Community: Website

Discord Python-Versions Django-Version Django-Rest-Framwork-Version Status

Website build with Django for the Tortoise Community Discord Server

This is the code for our website coded in python with the Django Framework. Code here serves for educational purposes and for transparency of data collection, handling and security.

Features

  • Discord Oauth2 verification system for preventing spam and detecting alt-accounts.
  • Real time Top member ranking based on perk system.
  • Markdown compatible pages for hosting events and showcasing projects.
  • Rest API Backend for the bot to interact with the database.
  • Admin dashboard for easily managing the bot from within the Website.

Contributing

We encourage everyone to contribute to the code. All updates are welcome. While contributing to the code please make sure that you push only to the dev branch of the repository Also note that all contributions to the code should follow the pep8 standards. To ease out this process follow the project setup instruction for developers.

Project Setup Instruction

Python 3.9 reqiuired

# Begin by forking the repo to your github account (makes managing conflicts easier)

# Your global Python installation needs to have pipenv
pip install poetry

# Clone the repository from your profile 
https://github.com/<Your-Github-Username>/Website.git

# [development installation] If you are developer/looking to contribute you need to install dependencies for dev
poetry install --dev

# [production installation] If you are setting up site for production just install required dependencies like this
poetry install --no-dev

# Activate the Pipenv shell (aka tell your terminal/whatever to use dependencies from the env in this project)
poetry shell

# The site should now be setup, You won't be able to run the test server because of the missing credentials.

Sample .env file layout

# Bot socket credentials 
BOT_SOCKET_PORT = put_something_here
BOT_SOCKET_IP = put_something_here
BOT_SOCKET_TOKEN = put_something_here

# Database Credentials (Postgres)
DB_NAME = put_something_here
DB_USER = put_something_here
DB_HOST = put_something_here
DB_PASSWORD = put_something_here

# Discord Oauth2 credentials
OAUTH_CLIENT_ID = put_something_here
OAUTH_CLIENT_SECRET = put_something_here

# Other application credentials 
EMAIL_TOKEN = put_something_here
GITHUB_ACCESS_TOKEN = put_something_here
DELETION_CONFIRMATION_KEY = put_something_here

# Django credentials
DEBUG = False
SECRET_KEY = put_something_here

# Discord server webhook credentials
SERVER_ID = put_something_here
WEBHOOK_ID = put_something_here
WEBHOOK_SECRET = put_something_here

# Hashing credentials
HASH_SALT = put_something_here
HASH_ITERATION = put_something_here

After setup

Run development server

poetry run python manage.py runserver

License

MIT - see LICENSE file for details.