eltrufas / osuchan-backend

Django backend API for osu!chan

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

osu!chan backend API

Requirements

  • Python 3

Setup (bash)

  1. Setup and build osuchan-frontend submodule
    $ cd osuchan-frontend
    $ npm install
    $ npm run build
  2. Initialise project environment with pipenv
    $ pipenv install
  3. Setup new PostgreSQL database
    1. Install PostgreSQL (if using local database)
    2. Enter psql shell
    3. Create a new database
      CREATE DATABASE osuchan;
    4. Create a new user for django
      CREATE USER django WITH PASSWORD 'password';
    5. Modify user connection parameters
      ALTER ROLE django SET client_encoding TO 'utf8';
      ALTER ROLE django SET default_transaction_isolation TO 'read committed';
      ALTER ROLE django SET timezone TO 'UTC';
    6. Give django user all permissions on database
      GRANT ALL PRIVILEGES ON DATABASE osuchan TO django;
  4. Install RabbitMQ (if using local queue)
  5. Add a custom domain to your hosts file that resolves to localhost
  6. Create an osu apiv2 oauth client for your development environment with the redirect uri as <custom host>/osuauth/callback where <custom host> is the host you defined in the previous step
  7. Make a copy of local_settings.template.py named local_settings.py and modify contents for sensitive/environment-specific info (and ensure it isn't being committed)
  8. Run migrations
    $ pipenv run python manage.py migrate
  9. Start celery worker (use --pool solo on windows)
    $ pipenv run celery --app osuchan worker --loglevel info
  10. Start development server
    $ pipenv run python manage.py runserver

About

Django backend API for osu!chan

License:GNU Affero General Public License v3.0


Languages

Language:Python 99.1%Language:HTML 0.9%