NTNU Course Queuing Website Back-End / 師大課程排隊網站後端
In this project, I decided to install on Windows, which is much more friendly to all students.
Accordingly, this tutorial is write for Windows users.
For Linux users, I bet you are familiar to programs.
It should be easy for you to setup this project without detailed procedures.
For Mac users... Sorry. XD
-
Database
I used MySQL in this project, you can download and install it from here.
-
Validation code cracking
Download the weights file val_loss.h5 and put it in directory
validation
. -
Selenium (爬蟲)
Check the version of your Google Chrome, download the relative version of chromedriver.exe and put it in directory
ntnu/chromedriver_win32
-
Environment
Before installing environment, check that your computer has installed Python.
(I prefer using
virtualenv
, you can use your preference.)- Open CMD. (Windows+R --> type "cmd" --> confirm)
- Move to the directory of this project.
- Enter command
virtualenv ENV_NAME_YOU_WANT
.
(If
virtualenv
is not installed, enter commandpip install virtualenv
to install it, then try the third step again.)After succcessfully created an virtual enviroment, we can activate it and install required packages.
-
Enter command
ENV_NAME_YOU_WANT\Script\activate
to activate your virtual enviroment.(Using powershell instead of CMD might face some unexpected problems.)
-
Enter command
pip install -r requirements.txt
to install required packages.
-
Configuration files
There is a directory named
.config_example
. Rename it to.config
.Open files in it, fill all "???" and delete all "(SOME_EXPLAIN)".
For
robot.env
, you will have to register LINE LOGIN and LINE Message API at LINE Developers to get LINE_CLIENT_SECRET and LINE_BEARER.There are plenty tutorials on the Internet, you can follow those to register LINE bot.
- LINE LOGIN offical tutorial: https://developers.line.biz/zh-hant/docs/line-login/getting-started/
- LINE Message API offical tutorial: https://developers.line.biz/zh-hant/docs/messaging-api/getting-started/
Beware! You have to finish your network management first, so that you can verify Webhook URL in Message API.
-
Start the Back-End: Enter command
python app.py
!