Code Monkey home page Code Monkey logo

csvgenerator's Introduction

Fake Data CSV Generator (Django, Celery)

Web generator of CSV files with fake data

Demo

Live demo of project you may check here - https://csvfaker.herokuapp.com/

Login: test
Password: test

Description

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.

Built with

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

Running locally

Please note, that this repo is configured for Heroku deploy.

To run project locally, you would need to perform following steps:

  1. Pull repo.
  2. 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'),
# )
  1. 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
  1. 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
  • If you are using RabbitMQ, make sure that it's running on your machine.
  1. 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

csvgenerator's People

Contributors

mariob0y avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.