The (django) webapp for the scenario-explorer of the "Stadt-Land-Energie" project.
License: GPLv3
Moved to settings.
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.
This app comes with Celery.
To run a celery worker:
cd slapp
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 slapp
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 slapp
celery -A config.celery_app worker -B -l info
Sentry is an error logging aggregator service. You can sign up for a free account at https://sentry.io/signup/?code=cookiecutter or download and host it yourself. The system is set up with reasonable defaults, including 404 logging and integration with the WSGI application.
You must set the DSN url in production.
First you have to set up all tables in the database by runnning:
python manage.py migrate
Afterwards you have to load in data. To simplify data commands a Makefile has been
added, which can be used by command make
.
You can load all data by running (or you can run them one-by-one):
make load_regions load_data
And you can empty all data by running:
make empty_data empty_regions
This application is ready to be deployed via Caprover. Make sure to define the following Environmental Variables:
REDIS_URL= DATABASE_URL=postgis:// DJANGO_DEBUG=False DJANGO_SETTINGS_MODULE=config.settings.production DJANGO_SECRET_KEY= DJANGO_ADMIN_URL= DJANGO_ALLOWED_HOSTS= DJANGO_ACCOUNT_ALLOW_REGISTRATION=True SENTRY_DSN= POSTGRES_HOST= POSTGRES_PORT= POSTGRES_DB= POSTGRES_USER= POSTGRES_PASSWORD= STARTUP_COMMAND=/start CELERY_BROKER_URL=redis:// MAP_ENGINE_TILING_SERVICE_TOKEN= MAP_ENGINE_TILING_SERVICE_STYLE_ID= MAP_ENGINE_USE_DISTILLED_MVTS=
See detailed cookiecutter-django Docker documentation.