Visualization platform for the SpectrumX project
License: MIT
Docker Compose is the recommended deployment method for this project.
If using the production deployment, create the secrets files:
rsync -aP .envs/.local/ .envs/.production/
Then set the secrets that will be used by the SVI services in these files.
This will create an external network so that jupyter containers not in the compose files can reattach to when the services are restarted.
./compose/create-network.sh
To select the environment, set the COMPOSE_FILE
environment variable to the desired
docker-compose file, i.e.:
# for development:
export COMPOSE_FILE=docker-compose.local.yml
# for production:
export COMPOSE_FILE=docker-compose.production.yml
Then proceed with other compose commands.
docker compose build
docker compose up
docker compose down
docker compose logs -f
-
To create a normal user account, just go to Sign Up and fill out the form. Once you submit it, you'll see a "Verify Your E-mail Address" page. Go to your console to see a simulated email verification message. Copy the link into your browser. Now the user's email should be verified and ready to go.
-
To create a superuser account, use this command:
python manage.py createsuperuser
For convenience, you can keep your normal user logged in on Chrome and your superuser logged in on Firefox (or similar), so that you can see how the site behaves for both kinds of users.
Running type checks with mypy:
mypy spectrumx_visualization_platform
To run the tests, check your test coverage, and generate an HTML coverage report:
coverage run -m pytest
coverage html
open htmlcov/index.html
pytest
Moved to Live reloading and SASS compilation.
This app comes with Celery.
To run a celery worker:
cd spectrumx_visualization_platform
celery -A config.celery_app worker -l info
Please note: For Celery's import magic to work, it is important where the celery commands are run. If you are in the same folder with manage.py, you should be right.
To run periodic tasks, you'll need to start the celery beat scheduler service. You can start it as a standalone process:
cd spectrumx_visualization_platform
celery -A config.celery_app beat
or you can embed the beat service inside a worker with the -B
option (not recommended for production use):
cd spectrumx_visualization_platform
celery -A config.celery_app worker -B -l info
See detailed Auth0 documentation.
- Modify the
requirements/base.txt
to includesocialaccount
indjango-allauth
django-allauth[socialaccount]==65.0.2 # https://github.com/pennersr/django-allauth
fido2==1.1.3 # https://github.com/Yubico/python-fido2
- Add Environment Variables to
.envs/.local/.django
# Auth0
AUTH0_DOMAIN=https://[DOMAIN].us.auth0.com
- Add Auth0 to
config/settings/base.py
# Auth0 Configuration
SOCIALACCOUNT_PROVIDERS = {
"auth0": {
"AUTH0_URL": env("AUTH0_DOMAIN"),
"OAUTH_PKCE_ENABLED": True,
"SCOPE": [
"openid",
"profile",
"email",
],
}
}
# Add 'allauth.socialaccount.providers.auth0' to INSTALLED_APPS
INSTALLED_APPS += ["allauth.socialaccount.providers.auth0"]
- Add a
Social Application
in the Django Admin for Auth0
- Provider:
Auth0
- Provider ID:
auth0
- Name:
SpectrumX Auth0 Provider
- Client ID:
[CLIENT_ID]
- Secret:
[SECRET]
- Key:
auth0
- Sites:
[CONFIGURED SITE]
(localhost:8000, etc.)
- Login through the social application by visiting the login page at
/accounts/auth0/login