hoyho / my_blog

my blog here2say.com
https://here2say.com
0 stars 0 forks source link

Dday Blog

my personal blog here2say.com

using Django with python 3.6 theme:google Material design

Previously it host at digital ocean but now migrated to Tencent Cloud for domestic visiting

How to run on your local machine

  1. prepare youe environment by running:

    python3 -m venv env
    source env/bin/activate
  2. then install dependences

    pip install -r requirements.txt
  3. set DEBUG = True in my_blog/settings.py

  4. run server with port 8000

    python manage.py runserver

Run in docker

  1. build docker build -t here2say .

  2. run

    assume you are in porject base directory now

docker run -d -p 8000:80 --name my_blog --restart=always -v $(pwd)/media:/app/media -v $(pwd)/database:/app/database here2say

  1. test it curl localhost:8000

FAQ:

when update any css or js file please remember to execute: python manage.py collectstatic and refresh browser page forcely

when change the field of model run:

python manage.py makemigrations
python manage.py migrate

Deployment

  1. update setting at my_blog/autostartwebsite.sh and my_blog/webconfig_uwsgi.ini or
  2. use docker (still under development)

======= issue

when editing the articles on admin panel please be careful to save markdown text you need to paste markdown text to richtext box under source mod see me