Skip to content

wangyichengsh/data_analysis_platform-backend

Repository files navigation

Data Analysis Platform Backend

A system allowed SQL developers customize query web pages including inputs,outputs and SQL etc.

Demo (You can login in as a developer or as a user)

User guide

Installation

pip3 install -r requirements.txt

unzip css files and js files for frontend(optional)

cd static && unzip admin.zip && unzip codemirror.zip
rm admin.zip codemirror.zip
cd ..

Configuration

Web configurations are in AnlsTool/setting/setting.py. Modify it with database setting, as following:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'anls',
        'USER': 'user',
        'PASSWORD': 'password',
        'HOST': 'localhost',
        'PORT': 5432,
    }
}

Database configurations are in apps/utils/conf/db.conf. Modify it as following:

[PSGQuery]
db_type = postgre
host = localhost
port = 5432
database = opendata
user = username
password = password

[ORCQuery]
db_type = oracle
host = localhost
port = 1521
database = orcl
user = username
password = password

[MysqlQuery]
db_type = mysql
host = localhost
port = 3306
database = name
user = user
password = passowrd

Also edit the func_name in db_tools/import_nt_data.py according to the name in apps/utils/conf/db.conf as following:

exec_info = [{'exec_id':'1','chinese_name':'Postgre','func_name':'PSGQuery','db_type':0},
             {'exec_id':'2','chinese_name':'Oracle','func_name':'ORCQuery','db_type':1},
             {'exec_id':'3','chinese_name':'MySQL','func_name':'MysqlQuery','db_type':2}]
db_type database
0 Postgre
1 Oracle
2 MySQL

Create database

CREATE DATABASE anls OWNER user;

Run the following command in Terminal:

python3 manage.py makemigrations
python3 manage.py migrate

Create super user

python3 manage.py createsuperuser

Create base data

python3 db_tools/import_nt_data.py

Run

$ uwsgi --ini uwsgi.ini

About

The backend of Data Analysis Platform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published