Make technology really work for your business
Setup a virtualenv and install requirements (this example uses virtualenvwrapper):
mkvirtualenv fractal_labs -p python3.11
pip install -r dev-requirements.txtCreate database migrations:
./manage.py makemigrations
Create database tables:
./manage.py migrate
./manage.py runserverTo build JavaScript and CSS files, first install npm packages:
npm installThen build (and watch for changes locally):
npm run dev-watchCelery can be used to run background tasks.
Celery requires Redis as a message broker, so make sure it is installed and running.
You can run it using:
celery -A fractal_labs worker -l INFOOr with celery beat (for scheduled tasks):
celery -A fractal_labs worker -l INFO -BDocker:
make translationsNative:
./manage.py makemessages --all --ignore node_modules --ignore venv
./manage.py makemessages -d djangojs --all --ignore node_modules --ignore venv
./manage.py compilemessagesTo setup Google Authentication, follow the instructions here.
To install the Git commit hooks run the following:
$ pre-commit install --install-hooksOnce these are installed they will be run on every commit.
For more information see the docs.
To run tests:
./manage.py testOr to test a specific app/module:
./manage.py test apps.utils.tests.test_slugsOn Linux-based systems you can watch for changes using the following:
find . -name '*.py' | entr python ./manage.py test apps.utils.tests.test_slugs