Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

239 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Torn Exchange Website

This is a code repository for domain https://tornexchange.com. It runs on Django framework, written in Python.

Compatibility

This project is only compatible with Python 3.8.10.

Setup Instructions

  1. Install Requirements: Install all the required packages using the following command:

    pip install -r requirements.txt

    Note: If you are running into issues with numpy & panda due to incompatibilities with working with Python 3.8.10, update the requirements.txt :

    from

    numpy==1.22.2
    pandas==1.0.5
    

    to

    numpy>=1.20.0
    pandas>=1.3.0
    
  2. PostgreSQL Setup: Ensure you have PostgreSQL installed and running. Create a database and configure the connection details in a .env file.

  3. Generate a Secret Key: Use the following command to generate a Django secret key:

    python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"  

    Copy the output and save it for the next step.

  4. Create .env File: Create a .env file with the following information:

    SYSTEM_API_KEY=""
    SECRET_KEY=""
    
    # Database
    POSTGRES_DB="postgres"
    POSTGRES_USER="postgres"
    POSTGRES_PASSWORD=""
    POSTGRES_HOST="localhost"
    POSTGRES_PORT="5432" #default port
    
    # Logging
    SENTRY_DSN_URL=""
    
    # Local stuff
    DJANGO_DEBUG="False"
    
    #Other
    CACHE_DIR=""
    500_ERRORS_FILE=""
    
  5. Set up caching folder

    mkdir /path/to/cache
    chmod 755 /path/to/cache

    Currently the setup is done for file-based caching. Caching folder should sit outsite the repository/app root folder.

  6. Run Migrations: Apply the database migrations using the following command:

    python manage.py migrate
  7. Collecting Static: Make the server's ui and images work using the following command:

    python manage.py collectstatic
  8. Run the Server: Start the development server using the following command:

    python manage.py runserver

    Note: If your server lacks ui and images do the following: In your .env file set DJANGO_DEBUG to True

    DJANGO_DEBUG="True"

    Run the server

    python manage.py runserver

    Close the server using Ctrl + C Set DJANGO_DEBUG to False

    DJANGO_DEBUG="False"

About

Django backend for Torn Exchange website

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages