A Django application for generating dummy data by user-defined schemas with arbitrary fields.
Check challenge requirements in the requirements folder. Don't expect perfection (especially regarding the frontend side and git), yet there is some decency.
Also, check Tasks in the Projects tab for the planned tasks.
Go to https://datagen-challenge.herokuapp.com/ (give a minute if stalled - Heroku bootup)
and use the next credentials:
username: preview
password: githubtest
-
Run
docker compose up
-
export DJANGO_SETTINGS_MODULE=config.settings.local_docker
-
run
worker celery --workdir datagen -A config worker -l INFO
orexport WORKER_LOCAL=True
to call celery task asrun()
(inprocess) instead ofdelay()
Check the content of the Makefile
and pre-commit
. Run make add_git_hooks
and then import somewhere (in user wide environment variables (as hooks often are run outside of IDE environment scope or in /.env
) Git Guardian key as described here.
There is no requirements.txt
, so to upload to Heroku: add poetry build pack
Then add services and their credentials to environment variables (check settings.heroku module):
- Heroku CloudAMQP addon or whatever for RabbitMQ
- PostgreSQL URI (Heroku provides a free addon)
- Amazon S3 (walkthrough) for storing static files and generated datasets (privately)
- Requirement that different fields can have different parameters.
- I wanted to use Django form validators, so I could have error handling for free.
- Just a few days before I experimented with Faker, so had an idea that there could be a hundred different fields with different parameters (and even different languages). YAGNI...
Having the first two aspects, I needed to have a separate form/model (whatever entity) for handling each field. So my first solution was to use multiple forms for validation and JSON field for storage https://github.com/furioness/django-challenge-planeks/tree/old_JSON_fields - a relatively simple solution.
Later, I got feedback that is better to store those fields in separate models, and there is too much code for such a task.
Got it! Now we have an even more complex solution :)
But what they probably meant is just to have a single model for storing all fields with all required parameters (I eventually searched GitHub for other solutions). That indeed is much more simple, but I never thought about it because of the third aspect.