使用Django快速搭建博客
- Python: 2.X
- Django: 1.10.x
- Mysql
- 博客文章 markdown 渲染,代码高亮
- 三方社会化评论系统支持(畅言)
- 三种皮肤自由切换
- 阅读排行榜/最新评论
- 多目标源博文分享
- 博文归档
- 友情链接
wget https://github.com/jhao104/django-blog/archive/master.zip
or
git clone [email protected]:jhao104/django-blog.git
pip install -r requirements.txt #安装所有依赖
setting.py配置自己的数据库
配置畅言:到http://changyan.kuaizhan.com/注册站点,将templates/message.html中js部分换成你在畅言中生成的js。
python manage.py makemigrations blog
python manage.py migrate
python manage.py runserver
# 初始化用户名密码
python manage.py createsuperuser
# 按照提示输入用户名、邮箱、密码即可
# 登录后台 编辑类型、标签、发布文章等
http://ip:port/admin
浏览器中打开http://127.0.0.1:8000/即可访问
-
Configure the right environment.
-
AttributeError: module 'blog.views' has no attribute 'GetComment'
File "/Users/kylewong/Playground/Django/django-blog/blog/urls.py", line 25, in <module>
url(r'^getComment/$', views.GetComment, name='get_comment'),
AttributeError: module 'blog.views' has no attribute 'GetComment'
Solution: Comment url(r'^getComment/$', views.GetComment, name='get_comment'),
- Django admin login
请输入一个正确的 用户名 和密码. 注意他们都是区分大小写的. solution 4. Database
-
Launch MySQL
django.db.utils.OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' ([Errno 61] Connection refused)")
-
Create the database
django_blog
for receiving the migration data. -
Create the superuser