refer to
- https://uwsgi.readthedocs.io/en/latest/tutorials/Django_and_nginx.html
- https://gist.github.com/evildmp/3094281
- python manage.py makemigrations
- python manage.py migrate
- python manage.py sqlmigrate blog 0001 # 迁移数据库
- 同步数据库 syncdb
- python manage.py runserver
-
创建账户:python manage.py createsuperuser
已创建账号: username:Light, password:lxd123456
-
def detail(request, pk): post = get_object_or_404(Post, pk=pk) post.body = markdown.markdown(post.body, extensions=[ 'markdown.extensions.extra', 'markdown.extensions.codehilite', 'markdown.extensions.toc', ]) return render(request, 'blog/detail.html', context={'post': post})
- python manage.py startapp comments
- 在settings.py中注册这个应用
gunicorn blogproject.wsgi:application -b 67.209.185.139 --reload gunicorn -c gunicorn/gunicorn-conf.py -D --error-logfile gunicorn/error.log blogproject.wsgi
- windows: env\Scripts\activate
- linux: source env/bin/activate
- 写入requirements.txt : pip freeze > requirements.txt
/root/ss_start.sh
- django_markdown : https://github.com/klen/django_markdown
- js markdown解析器: npm install markdown; npm install -g markdown (md2html、optional)