{"id":18553001,"url":"https://github.com/lunarwhite/tiny-zhihu-web","last_synced_at":"2025-04-09T22:32:14.352Z","repository":{"id":106260088,"uuid":"365928177","full_name":"lunarwhite/tiny-zhihu-web","owner":"lunarwhite","description":"Community QA forum. 仿知乎问答社区论坛","archived":false,"fork":false,"pushed_at":"2024-07-06T01:22:47.000Z","size":14141,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-06T04:23:39.652Z","etag":null,"topics":["flask","jquery","python","sql-server","web-app"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lunarwhite.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-10T05:29:45.000Z","updated_at":"2024-07-06T01:22:43.000Z","dependencies_parsed_at":"2024-04-12T03:27:38.447Z","dependency_job_id":"a4d3d537-774f-4afc-ad93-1f4f8b63ddf1","html_url":"https://github.com/lunarwhite/tiny-zhihu-web","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunarwhite%2Ftiny-zhihu-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunarwhite%2Ftiny-zhihu-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunarwhite%2Ftiny-zhihu-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunarwhite%2Ftiny-zhihu-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lunarwhite","download_url":"https://codeload.github.com/lunarwhite/tiny-zhihu-web/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248123814,"owners_count":21051537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","jquery","python","sql-server","web-app"],"created_at":"2024-11-06T21:15:47.861Z","updated_at":"2025-04-09T22:32:09.334Z","avatar_url":"https://github.com/lunarwhite.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tiny-zhihu-web\n\n![GitHub Repo stars](https://img.shields.io/github/stars/lunarwhite/tiny-zhihu-web?color=orange)\n![GitHub watchers](https://img.shields.io/github/watchers/lunarwhite/tiny-zhihu-web?color=yellow)\n![GitHub forks](https://img.shields.io/github/forks/lunarwhite/tiny-zhihu-web?color=green)\n![GitHub top language](https://img.shields.io/github/languages/top/lunarwhite/tiny-zhihu-web)\n![GitHub License](https://img.shields.io/github/license/lunarwhite/tiny-zhihu-web?color=white)\n\n仿知乎写的 web 社区论坛\n\n更多细节请看 [design doc](https://lunarwhite.notion.site/Web-Design-doc-0caa15a1e6e240e7bf94a51de015b61c) 和 [development doc](https://lunarwhite.notion.site/Web-Dev-doc-46f17ec280d049669b589db9f8dbb02b)\n\n```\n.\n├── config.py # 配置数据库\n├── dbOper.py # 操作数据库\n├── env\n│   ├── bin\n│   ├── include\n│   ├── lib\n│   ├── lib64 -\u003e lib\n│   ├── pyvenv.cfg\n│   └── share\n├── initdb.sql # 数据库脚本\n├── izhihu.ini # 项目初始化\n├── izhihu.py # 项目主入口\n├── izhihu.sock # 配置 Nginx\n├── LICENSE\n├── log\n│   ├── access.log # 访问日志\n│   └── error.log # 错误日志\n├── README.md\n├── requirements.txt # Python 依赖库\n├── static\n│   ├── css\n│   └── images\n├── templates\n│   ├── about.html # 关于\n│   ├── answer.html # 回答\n│   ├── base.html # 父界面\n│   ├── changeInfo.html # 修改信息\n│   ├── comment.html # 评论\n│   ├── error.html # 提示错误\n│   ├── index.html # 主界面\n│   ├── login.html # 登录\n│   ├── question.html # 问题\n│   ├── regist.html # 注册\n│   └── user.html # 用户个人\n└── wsgi.py\n```\n\n## 1 Overview\n\n- Ubuntu Server `18.04`\n- SQL Server `2019 (RTM-CU10)`\n- Python `3.6.9`\n- Flask `1.1.2`\n- Nginx `1.14.0 (Ubuntu)`\n\n## 2 Setup\n\n- clone repo：`git clone https://github.com/lunarwhite/tiny-zhihu-web.git`\n- 更新 pip：`pip3 install --upgrade pip`\n- 为项目创建虚拟环境：`conda create --name \u003cenv_name\u003e python=3.6`\n- 激活 env：`conda activate \u003cenv_name\u003e`\n- 安装 Python 库依赖：`pip3 install -r requirements.txt`\n- 数据库创建：执行 `initdb.sql` SQL 脚本\n\n## 3 Deploy\n\n- 数据库连接：修改 `config.py` 文件参数\n  ```python\n  HOSTNAME = '127.0.0.1' # 主机内网 ip\n  PORT     = '1433' # 端口\n  DATABASE = 'izhihu' # 数据库名称\n  USERNAME = 'sa' # 用户名\n  PASSWORD = \u003cpassword\u003e # 密码\n  ```\n- 刷新 Nginx\n  ```bash\n  sudo systemctl restart nginx\n  ```\n- 启动 uwsgi\n  ```python\n  uwsgi izhihu.ini\n  ```\n\n## 4 Reference\n\n- [Flask Tutorial in Visual Studio Code](https://code.visualstudio.com/docs/python/tutorial-flask)\n- [Python SQL 驱动程序 - pymssql](https://docs.microsoft.com/zh-cn/sql/connect/python/pymssql/python-sql-driver-pymssql?view=sql-server-ver15)\n- [快速入门：安装 SQL Server 并在 Ubuntu 上创建数据库](https://docs.microsoft.com/zh-cn/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-ver15)\n- [使用 Windows 上的 SQL Server Management Studio 管理 Linux 上的 SQL Server](https://docs.microsoft.com/zh-cn/sql/linux/sql-server-linux-manage-ssms?view=sql-server-ver15)\n- [Nginx 服务器 SSL 证书安装部署](https://cloud.tencent.com/document/product/400/35244)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flunarwhite%2Ftiny-zhihu-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flunarwhite%2Ftiny-zhihu-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flunarwhite%2Ftiny-zhihu-web/lists"}