Welcome to our Line ChatBot designed to assist aspiring students interested in the CS conversion programme application process. This ChatBot provides information, answers queries, and guides users through the application procedure for the Computer Science (CS) conversion programme.
To use our Line ChatBot for the CS conversion programme application, follow these steps:
-
Create Line Messaging API Account:
- Go to the Line Developer Console and create a Line Messaging API account for your ChatBot.
- Save the Channel Secret and Channel Access Token provided by Line. You need these to authenticate your bot in the
views.py
file.
-
Set Up Virtual Environment:
- Create a virtual environment based on your operating system in your preferred method. You can use
virtualenv
orvenv
to isolate dependencies.
-
Install
virtualenv
if you haven't already:pip install virtualenv
-
Create a virtual environment:
# For Linux and macOS virtualenv venv # For Windows virtualenv venv
-
Activate the virtual environment:
# For Linux and macOS source venv/bin/activate # For Windows venv\Scripts\activate
-
Create a virtual environment:
# For Linux and macOS python3 -m venv venv # For Windows python -m venv venv
-
Activate the virtual environment:
# For Linux and macOS source venv/bin/activate # For Windows venv\Scripts\activate
Once you activate the virtual environment, you can install the required packages using
pip
without affecting the system-wide Python installation. To deactivate the virtual environment, use the command:deactivate
- Create a virtual environment based on your operating system in your preferred method. You can use
-
Install Dependencies:
- Activate the virtual environment you created in the previous step.
- Use the
pip install
command to install all the packages listed in therequirements.txt
file. This ensures that the necessary libraries are available for your ChatBot.
-
Ngrok Setup:
- Download the
ngrok
executable from the official website. Ngrok is a tool that allows you to create a secure tunnel to your local development server. - In your terminal, navigate to the directory where the
ngrok
executable is located, and run the command:ngrok http 8000
. This assumes that your local development server is running on port 8000. - Ngrok will generate an HTTPS link (e.g.,
https://6a3b-2001-b400-e209-c92c-1d2e-53de-ca91-62b2.ngrok-free.app
) that you will use for the webhook configuration.
- Download the
-
Webhook Configuration:
- In the Line Developer Console, configure the Line Messaging API webhook by appending
/line/webhook/
to the end of your ngrok-generated HTTPS link. For example, if your ngrok HTTPS link ishttps://6a3b-2001-b400-e209-c92c-1d2e-53de-ca91-62b2.ngrok-free.app
, the webhook URL will behttps://6a3b-2001-b400-e209-c92c-1d2e-53de-ca91-62b2.ngrok-free.app/line/webhook/
. - Save the updated webhook URL in the Line Developer Console.
- In the Line Developer Console, configure the Line Messaging API webhook by appending
-
Allow Hosts Configuration:
- In your Django project's
settings.py
file, add the ngrok-generated URL (without thehttps://
) to theALLOWED_HOSTS
list. For example:ALLOWED_HOSTS = ['6a3b-2001-b400-e209-c92c-1d2e-53de-ca91-62b2.ngrok-free.app', '127.0.0.1']
- In your Django project's
-
Update views.py:
- Open the
views.py
file in your Django project. - At the beginning of the file, add the Channel Secret and Channel Access Token you obtained from the Line Developer Console. These credentials will be used for authentication.
- Open the
-
Run the Server:
- In your terminal, navigate to your Django project directory and run the command:
python manage.py runserver
. This starts the Django development server, allowing your Line ChatBot to respond to messages.
- In your terminal, navigate to your Django project directory and run the command:
-
Add Line Account as Friend:
- Add your Line ChatBot as a friend on your Line account by searching for its name.
- Start interacting with the ChatBot to seek guidance on the CS conversion programme application.
Remember to keep your Channel Secret and Channel Access Token secure and avoid sharing them publicly to ensure the security of your Line ChatBot.
- CS Programme Information: The ChatBot provides comprehensive information about the CS conversion programme, helping users to make better decisions.
Please note that while the ChatBot aims to provide helpful and accurate information, it is not a substitute for official guidance. Users should refer to the official CS conversion programme website and consult with the appropriate authorities for official and up-to-date information regarding the application process.
We value your feedback and welcome contributions to enhance the functionality and accuracy of the ChatBot. If you encounter any issues or have suggestions for improvements, please feel free to reach out or submit pull requests.
Happy Chatting, and best of luck with your CS conversion programme application!