Skip to content

coneypo/Django_MySQL_Table

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

image

And the dashboard website will be like:

image

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.

About

An example of rendering table from MySQL in Django

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published