Newer
Older
# **Pets Community**
## **1. Introduction**
This project is called "Pets Community", an online Q&A platform designed for all pets lovers to seek assistance.
**Please use PyCharm as much as possible for the entire project, which can simplify the process of environment configuration.**
You'll need to find Project Interpreter in Preferences of PyCharm to create a new Virtualenv Environment.
> This is a brand new virtual environment and will not be affected by other environments in your computer.
* For Linux and macOS,
```shell script
export FLASK_APP=flasky.py
flask run
```
* For Windows
```shell script
set FLASK_APP=flasky.py
flask run
```
**In the process of using pip to download the package, we have various problems. You can refer to these following information.**
1. If the terminal prompts "Requirement already satisfied: ..." but it cannot find the package we originally installed when running.
* Solution: We need to clear the cache data of PyCharm and reinstall all the packages we need through the "requirements.txt" file.
* And How to Clear the Cache Data: <https://jingyan.baidu.com/article/656db918b1e142a281249cc8.html>
2. Internet speed is too slow resulting in download failure.
* Solution:Download via douban source. <http://pypi.douban.com/simple>
* Reference: <https://blog.csdn.net/ITYTI/article/details/83313463>
3. After excluding the above problems, still cannot install any packet.
* Error info: Cannot connect to proxy solution:
* Solution: It may be caused by a proxy server set on the computer. Just shut off the proxy the sever.
* Reference: <https://www.cnblogs.com/arvinls/p/6149417.html>
### 2. 2 Run with Docker
**You can download the docker image we have prepared from Docker Hub, or you can generate a new docker image based on the Dockerfile inside the code.**
> The premise of using docker is that your computer has docker
#### 2.2.1 Download Docker Image
* Download
```shell
Or from: https://hub.docker.com/r/ydz1020/sm_project/tags
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
* Run
```shell
docker run -d -p 5000:5000 ydz1020/sm_project:latest
```
#### 2.2.2 Generate a new Docker Image
* Generate
```shell
docker build -t [your_image_name] .
```
* Run
```shell
docker run -d -p 5000:5000 [your_image_name]
```
#### 2.2.3 Open
* Open Web APP
```shell
# If your computer is mac you can use this.
open -a "Google Chrome" http://127.0.0.1:5000/
# If your computer is windows you can use this.
You can visit directly in the browser: 127.0.0.1:5000 to view.
```
* Kill Run
```shell
docker ps #View the CONTAINER ID of the running container
```
```shell
docker kill <CONTAINER ID> #Stop run
```
> You can also use Docker Desktop to run the docker image.
## **3. Test**
### 3.1 Personal Account
Here is a personal account for you to test.
| Personal Email Account | Password |
| --------------------------------- | -------- |
| 17601627023@163.com | password |
### 3.2 Organisation Account
#### 3.2.1 Organisation Account Registration
Organisational account registration needs to go through the administrator to review the organisation account application information. If the information is true and reliable, the administrator will click the successful application button to send an email to the applicant to represent the success of the registration.
**Since the project is not actually deployed online, you need to test as administrator on your computer.**
| Administrator Email Account | Password |
| -------------------------------------- | -------- |
| ou_xiao_ou@163.com | password |
> You need to log in to this account and perform the administrator’s action to complete the registration of the user account.
After the registration is done, your registration email will receive an email containing your organisation’s account information.
| Organisation Email Account | Password |
| ------------------------------------- | -------- |
| 2495908019@qq.com | password |
| UCD Student ID | BJUT Student ID | Name | Email | Chinese Name |
| :----: | :----: | :----: | :----: | :----: |
| 19206151 | 19372101 | Yang DeZheng | dezheng.yang@ucdconnect.ie | 杨德正 |
| 19206152 | 19372102 | Meng QingBo | qingbo.meng@ucdconnect.ie | 孟庆博 |
| 19206168 | 19372118 | Li QiYu | qiyu.li@ucdconnect.ie | 李骐宇 |
| 19206163 | 19372113 | Xi Le | le.xi@ucdconnect.ie | 席勒 |
| 18206160 | 19372110 | Xu YunQiao | yunqiao.xu@ucdconnect.ie | 许云乔 |