Code Monkey home page Code Monkey logo

open5e-api's Introduction

open5e is being rebuilt in Django and Vue.js!

Open5e is a community project driven by a small number of volunteers in their spare time. We welcome any and all contributions! Please join our Discord to help out: https://discord.gg/9RNE2rY or check out the issue board if you'd like to see what's being worked on!

The Django API uses Django REST Framework for its browsability and ease of use when developing CRUD endpoints. It uses django's default SQLite database, and pulls the data from the /data directory.

Development using Django Server

To do any python development on the django application itself, I would suggest using django's built-in server as it allows for various things (such as debug mode and quick reloads). Here's the general process for getting that up and running.

First, install pipenv from here (https://pipenv.readthedocs.io/en/latest/).

Once pipenv is installed locally, you can then use it to install of the project dependencies defined in the Pipfile.

pipenv install

Quick Setup

If you want to work with existing data sources and just get working you can quickly stand up the server with

pipenv run python manage.py quicksetup

followed by

pipenv run python manage.py runserver

This will stand up the server with full content and search index at http://localhost:8000.

Manual Setup Steps

If you want to customize your setup, particularly useful if adding new content sources, then you will need to use the built-in django migration function to define your database, making sure to run it within the pipenv environment.

pipenv run python manage.py migrate

You will then need to collect the static files (this makes django-resk-framework look presentable when viewing it in html).

pipenv run python manage.py collectstatic --noinput

Finally, you will need to load the SRD data from the json files in the /data folder. This is using the custom populatedb command.

pipenv run python manage.py populatedb --flush ./data/WOTC_5e_SRD_v5.1/

At that point, you will be able to run the django server normally (within the pipenv environment).

pipenv run python manage.py runserver

And your server should be available at http://localhost:8000.

open5e-api's People

Contributors

augustjohnson avatar colbyrush avatar cparadis6191 avatar daft-develop avatar dependabot[bot] avatar eepmoody avatar gbalbuena avatar mccrossin avatar michaeleconomy avatar peterkos avatar realdeuce avatar roberthead avatar tetra-cube avatar thelukester92 avatar txtsd avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.