Skip to content

Latest commit

 

History

History
executable file
·
65 lines (43 loc) · 1.32 KB

README.rst

File metadata and controls

executable file
·
65 lines (43 loc) · 1.32 KB

Django-MySQL Dashboard

Introduction

An initial version of using Django as the website development tool based on python and show your data in MySQL database;

Overview

Check the data in MySQL database by MySQL Workbench:

for_readme/ss_mysql_workbench.png

And the dashboard website will be like:

for_readme/ss_dashboard.png

How to run

  1. Log into MySQL database

  2. Add the example database of news:

    mysql> create database ithome_news;
    mysql> use ithome_news;
    mysql> source /home/con/code/python/Django_MySQL_Table/ithome_news.sql
  3. Modify password for your database in setting.py

    # Database
    DATABASES = {
       'default': {
       'ENGINE': 'django.db.backends.mysql',
       'NAME': 'ithome_news',
       'USER': 'root',
       ######## modify with your password here ########
       'PASSWORD': 'pwd',
       ################################################
       'CONN_MAX_AGE': 3600,
       }
       }
  4. Run Django server

    python3 manage.py runserver 8000
  5. Open browser and input http://127.0.0.1:8000/table_example

More

Thanks for your support.