Django app to save CSV file data to MySQL DB and fetch it in JSON format from the DB.
Instructions to run the app:
Setup DB:
- Run your MySQL server with user root and no password configuration or change the mysql connector code accordingly to add the password.
- Run the following command in mysql shell > set global max_allowed_packet=67108864; (The sample file is of very large size and default allowed packet limit size of mysql won't allow the program to insert all the data which will result in an error).
- Create a new database named 'django1'
Run the app:
- Install virtualenv: > pip install virtualenv
- Create a virtual environment: > virtualenv <virtual_environment_name>
- Activate the virtual environment (Windows): > .\<virtual_environment_name>\Scripts\activate.bat
- Install all the dependencies: > pip install -r requirements.txt
- Run the migrate commands: > python manage.py migrate
- Run the app: > python manage.py runserver
- Access the app on: > localhost:8000
Try out the app :) - Once done you can deactivate the virtual environment (Windows): > .\<virtual_environment_name>\Scripts\deactivate.bat
