Flog

May 23, 2022 · View on GitHub

中文版 README

Moved to flog-api-v4 and flog-front. This repo has been deprecated.

Documentation Status Lint Status Build Status codecov Code Style: Black

Icons made by Freepik from www.flaticon.com

The blog website is created when I'm learning flask.

Contributors

Andy Zhou on Github

Thanks To

Projects

Books

People

Without these projects, the website cannot be developed.
At the same time, thanks to GreyLi, it was his Python Web Development with Flask that took me into the wonderful world of Flask.

Functions

  • Login / Register (requires email verification) / Logout / Delete Account
  • Collect
  • Write
  • Comment
  • Notifications
  • Two languages support (zh_CN and en_US)
  • Web API

Plans

I'm currently planning to add access tokens and refresh tokens to api v3. It might use flask-apispec and flask-jwt-extended.

About the online demo

This demo demonstrates how Flog works. Due to Heroku's limitations, you can only see the English version of the website and you cannot upload images to it.

Yet you can still experience most of Flog's features such as the web api, the group chatting room and the notification system.

Web API Documents

api v1 & v2 ReadTheDocs

api v3 Swagger Doc Redoc

Run Flog locally

I recommend you to use pipenv to manage your dependencies. For example:

# clone the project and change to that directory
pipenv install --dev --pre
pipenv shell
flask deploy # initialize database
flask forge # generates fake data
flask create-admin
flask run

Docker

Note that Flog uses sqlite3 as the database for the docker container and that means the data cannot be stored forever.

docker pull andyzhouty/flog
docker run andyzhouty/flog -d -p 5000:5000

Unittests

# activate the virtual environment
pytest # or `pipenv run pytest`

Available Settings for Flog

Config NameDefault ValueDescription
FLOG_EMAILflog_admin@example.comThe email address used for deploying flog.
FLOG_EMAIL_PASSWORDflog_email_passwordThe email password for FLOG_EMAIL
FLOG_ADMINflog_adminThe username of the administrator of flog.
FLOG_ADMIN_EMAILflog_admin@example.comThe administrator's email address.
FLOG_ADMIN_PASSWORDflog_admin_passwordThe administrator's password.
DATABASE_PRODsqlite:///./data.sqliteThe URL of the database in production.
DATABASE_DEVsqlite:///./data-dev.sqliteThe URL of the database in development.
DATABASE_TESTsqlite:///:memoryThe URL of the database in testing.

FAQ

  1. Q: Why 'Flog'?
    A: 'Flog' is a combination of 'Flask' and 'Blog'. The word sounds (and looks) like 'frog'. So I use a frog as its icon.

  2. Q: Why can't the website be updated frequently?
    The website cannot be updated on time because I'm a student in Middle School now. There is much homework.