A blog system based on python3.8
and Django4.0
.
Markdown
and highlighting.Markdown
supporting.Memcache
supported, with cache auto refresh.django-compressor
integrated, auto-compressed css
, js
.Change MySQL client from pymysql
to mysqlclient
, more details please reference pypi , checkout preperation before installation.
Install via pip: pip install -Ur requirements.txt
If you do NOT have pip
, please use the following methods to install:
OS X / Linux, run the following commands:
curl http://peak.telecommunity.com/dist/ez_setup.py | python
curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python
Windows:
Download http://peak.telecommunity.com/dist/ez_setup.py and https://raw.github.com/pypa/pip/master/contrib/get-pip.py, and run with python.
Most configurations are in setting.py
, others are in backend configurations.
I set many setting
configuration with my environment variables (such as: SECRET_KEY
, OAUTH
, mysql
and some email configuration parts.) and they did NOT been submitted to the GitHub
. You can change these in the code with your own configuration or just add them into your environment variables.
Files in test
directory are for travis
with automatic testing. You do not need to care about this. Or just use it, in this way to integrate travis
for automatic testing.
In bin
directory, we have scripts to deploy with Nginx
+Gunicorn
+virtualenv
+supervisor
on linux
and Nginx
configuration file. You can reference with my article
More deploy detail in this article.
Modify DjangoBlog/setting.py
with database settings, as following:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'djangoblog',
'USER': 'root',
'PASSWORD': 'password',
'HOST': 'host',
'PORT': 3306,
}
}
Run the following command in MySQL shell:
CREATE DATABASE `djangoblog` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */;
Run the following commands in Terminal:
python manage.py makemigrations
python manage.py migrate
Run command in terminal:
python manage.py createsuperuser
Run command in terminal:
python manage.py create_testdata
Run command in terminal:
python manage.py collectstatic --noinput
python manage.py compress --force
Execute: python manage.py runserver
Open up a browser and visit: http://127.0.0.1:8000/ , the you will see the blog.
If you have any question, please use Issue or send problem descriptions to my email liangliangyy#gmail.com
. I will reponse you as soon as possible. And, we recommend you to use Issue.
If this project helps you, please submit your site address here to let more people see it.
Your reply will be the driving force for me to continue to update and maintain this project.
🙏🙏🙏
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。