dracidoupe / graveyard

Open Source reimplementation of https://www.dracidoupe.cz/
https://nove.dracidoupe.cz/
MIT License
6 stars 4 forks source link
czech django docker draci-doupe dungeons-and-dragons fantasy graveyard mysql pen-and-paper python python-3 rpg social social-media social-network

Graveyard: Place for Dead (and Undead)

Documentation Status

Graveyard is an attempt at open-source reimplementation of DraciDoupe.cz (referred to as DDCZ in this text).

Developer's documentation is at Read the Docs.

Production is running at http://nove.dracidoupe.cz/ . But be warned, we are heading for the root domain soon!

Contributions

Contributions are welcome provided you agree your work will be shared under the same license as Graveyard (MIT). Please use ruff for code formatting and verification (VS Code integration here).

If you don't know where to start, take a look at the roadmap or ask Almad on development Slack or community Discord or in Pošta on DraciDoupe.cz.

Please install EditorConfig support for your editor (plugin for VS Code, plugin for PyCharm/WebStorm/IDEAJ)

Installation

You can run Graveyard either directly on your machine or inside Docker. Arm64 systems (like M1 Mac) are supported.

Installing and running Graveyard directly is faster (on some systems) and removes one lever of indirection, but it makes the setup more complicated.

Running in Docker requires familiarity with it, but it makes setup easier and guarantees consistency with the testing environment (and hopefully in the future, production environment as well).

In both cases, first clone this repository and run all commands in its directory.

Graveyard is not yet compatible with Python 3.10+.

Installing in Docker

Requirements:

Verify you have everything ready by running the test suite:

If you see output like this:

(graveyard-venv) almad@zeruel:~/projects/graveyard$ docker-compose run web python3 manage.py test
Starting graveyard_db_1 ... done
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
....
----------------------------------------------------------------------
Ran 4 tests in 0.000s

OK
Destroying test database for alias 'default'...
(graveyard-venv) almad@zeruel:~/projects/graveyard$

You are all set. Afterwards, install database schema by running

and load data about pages

You are done! Now you can just run the project and develop using

Verify your application works and open http://localhost:8000 (localhost may be a different host if you are not working on linux). If so, create yourself a superuser.

For all commands in the manual that ask for python manage.py command, run docker-compose run web python3 manage.py command instead

Installing on your machine

Graveyard is currently written in Django. Requirements to develop it:

To use the project, clone this repository, enter its directory with cd graveyard and:

(graveyard-venv) almad@zeruel:~/projects/graveyard$ python manage.py test
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
...........
----------------------------------------------------------------------
Ran 11 tests in 0.031s

OK
Destroying test database for alias 'default'...
(graveyard-venv) almad@zeruel:~/projects/graveyard$

Installing on Windows

Follow the list above, except:

After Installation

Installation issues

If you get something like this:

    File "/tmp/pip-install-wfhe9zue/mysqlclient/setup_posix.py", line 29, in mysql_config
        raise EnvironmentError("%s not found" % (_mysql_config_path,))
    OSError: mysql_config not found

you may be using MariaDB fork of MySQL that the Python client is not equipped to talk to, installation-wise. You need to manually symlink the appropriate command:

ln -s /usr/bin/mariadb_config /usr/bin/mysql_config

If even mysql_config is not there, you have to install development headers for the database. That's apt-get install libmariadbclient-dev on Debian.

Old setuptools: pip install setuptools -U

Setup

Create user account

Use python manage.py registeruser command, see manage.py registeruser --help for parameters.

Example:

python manage.py registeruser mytestuser mytestuser@example.com logintograveyard

Debugging with Django Debug Toolbar

from .base import INSTALLED_APPS, MIDDLEWARE

INSTALLED_APPS.append("debug_toolbar")
MIDDLEWARE.insert(
    0,
    "debug_toolbar.middleware.DebugToolbarMiddleware",
)

INTERNAL_IPS = ["127.0.0.1", "::1"]