? English ∙ 简体中文
A blog based on python3.10
and Django4.0
.
Markdown
and code highlighting.Markdown
.Redis
cache and automatic cache refresh.django-compressor
to automatically compress css
and js
. The mysql client has been modified from pymysql
to mysqlclient
. For details, please refer to pypi to check the preparations before installation.
Install using pip: pip install -Ur requirements.txt
If you don't have pip, install it as follows:
OS X/Linux computer, execute in terminal:
curl http://peak.telecommunity.com/dist/ez_setup.py | python
curl https://bootstrap.pypa.io/get-pip.py | python
Windows computers:
Download the two files http://peak.telecommunity.com/dist/ez_setup.py and https://raw.github.com/pypa/pip/master/contrib/get-pip.py, double-click to run.
Modify djangoblog/setting.py
to modify the database configuration as follows:
DATABASES = {
'default' : {
'ENGINE' : 'django.db.backends.mysql' ,
'NAME' : 'djangoblog' ,
'USER' : 'root' ,
'PASSWORD' : 'password' ,
'HOST' : 'host' ,
'PORT' : 3306 ,
}
}
Execute in mysql database:
CREATE DATABASE ` djangoblog ` /* !40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */ ;
Then execute in the terminal:
python manage.py makemigrations
python manage.py migrate
Execute in terminal:
python manage.py createsuperuser
Execute in terminal:
python manage.py create_testdata
Execute in terminal:
python manage.py collectstatic --noinput
python manage.py compress --force
Execution: python manage.py runserver
Open the browser: http://127.0.0.1:8000/ and you can see the effect.
For local installation and deployment, please refer to the DjangoBlog deployment tutorial for detailed deployment introduction.
This project already supports the use of docker for deployment. If you have a docker environment, you can use docker for deployment. For details, please refer to: docker deployment
More configuration introduction to integrate elasticsearch
If you have any questions, please feel free to submit an Issue, or send a description of the problem to my email address liangliangyy#gmail.com
. I will answer it as soon as possible. It is recommended to submit an Issue.
If this project has helped you, please leave your URL here so that more people can see it. Your reply will be my motivation to continue updating and maintaining it.
If you think this project is helpful to you, you are welcome to buy me a cup of coffee. Your support is my biggest motivation. You can scan the QR code below to pay for me. Thank you.
Thanks jetbrains