Note
These docs are still a WIP, please provide feedback for better docs!
To get the server started, run the following commands.
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver --settings=factoriomaps.settings.dev-example.py
The settings files are located in factoriomaps/settings/. We've provided an example settings file to use as a guide, please copy this file into a new settings file & modify that for your personal use. To use your copied settings file, simply run your manage.py commands with the --settings flag or set the DJANGO_SETTINGS_MODULE environment variable.
Warning
Please git ignore the settings file you use for personal use. Do not push this to a repository.
We are using Postgres as our database technology. It is recommended, although not required, that you configure one. This can be done by either installing Postgres on your local system or using a Docker container.
Once that is complete, all that is left is configuring the Django settings file to use your newly installed database. To do so, simply create or modify the DATABASE variable in your settings file like so:
DATABASES = {
'default': {
'HOST': 'localhost',
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': '<database_name>',
'USER': '<user>',
'PASSWORD': '<password>',
'PORT': 5432
}
}
Once this is complete, you will need to rerun migrations in your newly created database:
python manage.py migrate
To build the developer docs, first you will need to pip install Sphinx & sphinx_rtd_theme. Then, simply run:
# for linux
docs/make html
# for windows
docs/make.bat html
Then open docs/build/index.html in any browser.
In order for your documentation to be picked up by Sphinx and autodoc, simply write explicit doc strings. The doc strings are in rst, so rst syntax applies. For more details, here's a good primer.
I'm currently working on a good way for Sphinx and autodoc to automagically pick up new files to be documented. Until then, the docs/source directory mostly mirrors our code base in structure. Simply add an .rst file to the appropriate location and let autodoc do it's magic.
Write more tests!