Web generator of CSV files with fake data
Live demo of project you may check here - https://csvfaker.herokuapp.com/
Login: test
Password: test
Online service for generating CSV files with fake (dummy) data, developed with Python and Django.
App lets you create .CSV file with data of choice. You may choose type of data, text of headers, order of columns and number of rows.
This scheme may be later generated into .CSV file and downloaded.
Task of file generation is handled via Celery, and code of task is stored at dummy_gen/tasks.py
.
Django - The web framework used
Celery - Distributing of tasks
Heroku Redis - Brocker
Faker - Generator of data for .CSV files
Celery progress and Django celery results- for task progress tracking and task results storing, respectively
AWS S3 - Storing generated .CSV files
Whitenoise - Static files management
ElaAdmin Template - Bootstrap template
Please note, that this repo is configured for Heroku deploy.
To run project locally, you would need to perform following steps:
- Pull repo.
- In
settings.py
, change following configurations:
- Change
CELERY_BROKER_URL
to your Redis, or delete this line if you are using RabbitMQ - Remove or comment lines:
# AWS S3 SETTINGS
# AWS_ACCESS_KEY_ID = os.environ.get('AWS_ACCESS_KEY_ID')
# AWS_SECRET_ACCESS_KEY = os.environ.get('AWS_SECRET_ACCESS_KEY')
# AWS_STORAGE_BUCKET_NAME = os.environ.get('AWS_STORAGE_BUCKET_NAME')
# AWS_URL = os.environ.get('AWS_URL')
# AWS_DEFAULT_ACL = None
# AWS_S3_SIGNATURE_VERSION = 's3v4'
# AWS_QUERYSTRING_AUTH = True
# AWS_S3_REGION_NAME = 'eu-central-1'
# AWS_S3_ADDRESSING_STYLE = "virtual"
# MEDIA_URL = AWS_URL + '/media/'
# DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
# django_heroku.settings(locals())
# STATICFILES_DIRS = (
# os.path.join(BASE_DIR, 'static'),
# )
- In a root folder (one where
manage.py
located) run commands:
pip3 install -r requirements.txt
python manage.py makemigrations
python manage.py migrate
python createsuperuser
python manage.py runserver
- Brocker server:
- If you are using Redis, start worker (command for Windows below, run in root folder):
celery -A planeks.celery worker -l --loglevel=info
- In case of trouble, check this guide
- If you are using RabbitMQ, make sure that it's running on your machine.
- In case of trouble, check this guide
- Saving .CSV files:
- To save .CSV files locally,
open dummy_gen/tasks.py
- Comment section at lines 84-91
- Write where files should be saved on disk at line 42