This is a simple Django app for data analyzing and plotting which allows users to upload CSV file and visualize the data. The objective is processing, analyzing, and plotting based on uploaded data. The user has full control over the visibility of the raw data, basic information such as number of rows, columns, null values, datatypes, etc., descriptive statistics such as count, mean, std, max, min, etc. The user can perform basic data cleaning such as handling missing values. Several different options for plotting are available; barplot, scatterplot, histograms. The plot can be saved as a PNG file. Other data processing features and plots will be added in the next version.
-
Anaconda installation and setup :
-
Programming language: Python (version 3.7)
-
Using the terminal or an Anaconda Prompt, create a new environment –
conda create –n webviz python=3.7
-
Activate new environment - $ conda activate webviz
-
Clone this repository from Github: – open terminal and select a project path -
cd PATH
- To clone type -
git clone https://github.com/JagritiG/django-webviz.git
-
Create an virtual environment and activate env
-
Navigate to project django-webviz folder
-
Install requirements.txt using pip -
pip install –r requirements.txt
-
Navigate to project webviz (project name)
-
Run command
ls
to check the right path: [init.py db.sqlite3 manage.py media static viz webviz] -
Create Database & connect it within the settings.py (e.g. MySQL, Postgres)
-
Run following commands for database migrations:
python3 manage.py makemigrations
python3 manage.py migrate
-
Run following command to collect all static files:
python3 manage.py collectstatic
-
Run following command to run the server:
python3 manage.py runserver
-
Open localhost localhost:8000 to see the pages
-
Go to Upload File, localhost:8000/upload/ and upload a csv file and plot the figure
-
To navigate to admin open localhost:8000/admin/ (admin name: admin and password: webviz123)
-
Log into cPanel Account
-
Open File Manager
-
Zip project-folder and upload in the File manager/root directory (e.g. webviz.zip)
-
Database Setup: (MySQL)
- Navigate to cPanel
- Open DATABASES -> MySQL Database
- Create database for the project: give <database-name> and click on <Create Database> (e.g. webviz)
- click <Go Back>
- Create user (Give user name, password) and click on <Create User> (e.g. user1, user123)
- click <Go Back>
- Add user to the database: in the section <Add User To Database> -> select user and database and click on <Add>
- Give Privileges to this user: select all the privileges and click on <Make Changes>
- Now navigate to cPanel -> MySQL Database -> you can see database is created.
-
Configure database credential in settings.py ->
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'database-name', 'USER': 'user-name', 'PASSWORD': 'password', 'HOST': 'localhost', 'PORT': '3306', } }
-
Configure domain name in settings.py
ALLOWED_HOSTS = ['domain_name.com', 'www.domain_name.com']
-
Configure Python App
- Navigate to cPanel -> SOFTWARE and Click on <Python Setup App>
- Click <Create Application>
- Select python version - (e.g. 3.8.6)
- Add Application root -> <project-name> (e.g. webviz)
- Set Application url -> select domain_name.com
- Click <Create App>
-
Install requirements.txt file
- Navigate to cPanel -> SOFTWARE and Click on <Python Setup App>
- Select Aap -> <Edit>
- Add requirements.txt file and click on <Run Pip Install> to install all the required modules
-
Create Database Table
- Navigate to cPanel -> SOFTWARE and Click on <Python Setup App>
- Select Aap ->
- Run Script: manage.py migrate
- To check Database table navigate to **cPanel -> DATABASES -> phpMyAdmin
-
Configure passenger_wsgi.py
- add from webviz.wsgi import application
import os import sys from webviz.wsgi import application