qsoyq / Sanic-MDL-Blog

An async Python server running Material Design Lite Blog template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Codacy Badge Code Issues

Material Design Lite Blog Using Sanic

A Sanic (asynchronous) server running with the blog template from Material Design Lite . Eventually will become a 'live' blog template with an admin dashboard.

Prerequisites

You need several packages first for all pip packages to completely install.

So here is a list of packages required:

python & python-dev >=3.6
unixodbc
unixodbc-dev
libsqliteodbc

Installation

pip install -r requirements.txt

Configuration

100% following Sanic's import from config: http://sanic.readthedocs.io/en/latest/sanic/config.html#from-a-file

Example config:

DB_URI = 'Driver=SQLite3;Database=app.db'
DB_TYPE = 'sql'
DEMO_CONTENT = False

Either you can create a config file config.py file in same directory as main.py or you may load the program with the location of the file to variable config_file like so:

MY_SETTINGS=/path/to/config_file python3 main.py

Starting Server

NOTICE:

While I have gotten this to work on Windows with Sanic 4.1, this will not run on Windows with Sanic 5+,
not by choice, but because required packages for Sanic aren't supported on Windows at this time.

To start the server: python3 run.py

To access server: http://127.0.0.1:8000

About

An async Python server running Material Design Lite Blog template


Languages

Language:HTML 53.5%Language:Python 26.4%Language:CSS 20.1%