本网站打算解决的问题 python
1. 若是我是文章做者, 是否能本身定制发布到首页的时间
2. 若是我是读者, 是否能逃离机器算法造成的信息茧房git
项目开发中所需的其余第三方库, 会在具体的应用开发中列出
建立python虚拟环境github
python -m venv venv/buzzfeenv
进入虚拟环境,建立django工程redis
source venv/buzzfeenv/bin/activate
安装django2.1.7算法
pip install django
建立django工程sql
django-admin startproject buzzfe
将vscode中pythonpath 配置为刚刚建立的python虚拟环境数据库
"python.pythonPath": "/home/dpeng/app/venv/buzzfeenv/bin/python",
启动djangodjango
python manage.py runserver 打开浏览器, 输入 127.0.0.1:8000,你将看见 django 启动的默认页面
注意 你须要在版本管理前 务必添加 .gitignore 可选添加 README.md 和 LICENSE
git add . git status git commit -m '第一次提交' git push -u origin master
account浏览器
python manage.py startapp account
articlesession
python manage.py startapp article
使用django自带 auth.user, 需将account放置在第一个
'account.apps.AccountConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'article.apps.ArticleConfig',
时间及时区及语言设置
TIME_ZONE = 'Asia/Shanghai' USE_TZ = False
templates设置
'DIRS': [os.path.join(BASE_DIR, 'templates').replace('\\', '/'),],
postgresql 数据库配置
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'db_buzzfe', 'USER': 'db_admin', 'PASSWORD': 'db_mima', } }
static 静态文件配置
STATIC_URL = '/static/' STATICFILES_DIRS = ( os.path.join(BASE_DIR, "static"), )
欲知项目开发后事如何,且等下回更新...