Development of this project has been setup to be done from VSCodium. The following additional requirements need to be met:
-
npm has been installed. required for
markdown
lintingsudo apt install -y --no-install-recommends npm
-
setup of other requirements can be done with
make prepare
-
ALL Linting must pass for Merge to be conducted.
make lint
from the root of the project to start a test server use:
# activate python venv
source /tmp/centurion_erp/bin/activate
# enter app dir
cd app
# Start dev server can be viewed at http://127.0.0.1:8002
python manage.py runserver 8002
# Run any migrations, if required
python manage.py migrate
# Create a super suer if required
python manage.py createsuperuser
!!! tip "TL;DR"
Common make commands are make prepare
then make docs
and make lint
Included within the root of the repository is a makefile that can be used during development to check/run different items as is required during development. The following make targets are available:
-
prepare
prepare the repository. init's all git submodules and sets up a python virtual env and other make targets
-
docs
builds the docs and places them within a directory called build, which can be viewed within a web browser
-
lint
conducts all required linting
-
docs-lint
lints the markdown documents within the docs directory for formatting errors that MKDocs may/will have an issue with.
-
-
clean
cleans up build artifacts and removes the python virtual environment
this doc is yet to receive a re-write
within the deploy/
directory there is a docker compose file. running docker compose up
from this directory will launch a full stack deployment locally containing Centurion API, User Interface, a worker and a RabbitMQ server. once launched you can navigate to http://127.0.0.1/
to start browsing the site.
You may need to run migrations if your not mounting your own DB. to do this run docker exec -ti centurion-erp python manage.py migrate
It's advised to setup a python virtual env for development. this can be done with the following commands.
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
To setup the centurion erp test server run the following
cd app
python manage.py runserver 8002
python3 manage.py migrate
python3 manage.py createsuperuser
# If model changes
python3 manage.py makemigrations --noinput
# To update code highlight run
pygmentize -S default -f html -a .codehilite > project-static/code.css
Updates to python modules will need to be captured with SCM. This can be done by running pip freeze > requirements.txt
from the running virtual environment.
!!! danger "Requirement" All models are to have tests written for them, Including testing between dependent models.
See Documentation for further information
cd app
docker build . --tag centurion-erp:dev
docker run -d --rm -v ${PWD}/db.sqlite3:/app/db.sqlite3 -p 8002:8000 --name app centurion-erp:dev