-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from yihong1120/feature/Added-backend-console-…
…interface Feature/added backend console interface
- Loading branch information
Showing
14 changed files
with
298 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Use Ubuntu 22.04 as the base image | ||
FROM ubuntu:22.04 | ||
|
||
# Set environment variable to prevent interactive prompts during apt-get commands | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Update apt and install required tools | ||
RUN apt-get update && apt-get install -y \ | ||
curl \ | ||
wget \ | ||
lsb-release \ | ||
apt-transport-https \ | ||
software-properties-common \ | ||
gnupg \ | ||
python3.11 \ | ||
python3-pip | ||
|
||
# Add repository and key for Microsoft SQL | ||
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ | ||
&& curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list > /etc/apt/sources.list.d/mssql-release.list | ||
|
||
# Install Microsoft's MSSQL tools and other necessary packages | ||
RUN apt-get update && \ | ||
ACCEPT_EULA=Y apt-get install -y msodbcsql18 && \ | ||
ACCEPT_EULA=Y apt-get install -y mssql-tools18 && \ | ||
apt-get install -y unixodbc-dev | ||
|
||
# Add mssql-tools18 to the system PATH | ||
ENV PATH="$PATH:/opt/mssql-tools18/bin" | ||
|
||
# Install Python dependencies | ||
COPY requirements.txt /app/ | ||
RUN pip install -r /app/requirements.txt | ||
|
||
# Copy your application into the container | ||
COPY . /app/ | ||
WORKDIR /app/ | ||
|
||
# Execute app.py and web server of Django when the container starts | ||
CMD ["sh", "-c", "python app.py && cd chatbo_web && python manage.py runserver 8080"] | ||
|
||
# To utilise this Dockerfile, first execute the following command in the directory containing the Dockerfile to construct the container image: | ||
# '''bash | ||
# docker build -t chatbot_app . | ||
# ''' | ||
|
||
# Subsequently, run: | ||
# '''bash | ||
# docker run -p 8080:8080 chatbot_app | ||
# ''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file removed
BIN
-1.42 KB
chatbo_web/chatbot_manager/migrations/__pycache__/0001_initial.cpython-311.pyc
Binary file not shown.
Binary file removed
BIN
-194 Bytes
chatbo_web/chatbot_manager/migrations/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
11 changes: 8 additions & 3 deletions
11
chatbo_web/chatbot_manager/templates/registration/login.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
{% extends 'base.html' %} | ||
|
||
{% load static %} {# 加載靜態文件功能 #} | ||
|
||
{% block content %} | ||
<h2>Login</h2> | ||
<form method="post"> | ||
{% csrf_token %} | ||
{{ form.as_p }} | ||
<button type="submit">Login</button> | ||
or <a href="{% url 'register' %}">Register</a> | ||
</form> | ||
{% endblock %} | ||
or | ||
<button id="registerBtn" data-url="{% url 'register' %}" type="button">Register</button> | ||
</form> | ||
|
||
<script src="{% static 'chatbot_manager/javascript/register_redirect.js' %}"></script> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
4 changes: 4 additions & 0 deletions
4
chatbo_web/static/chatbot_manager/javascript/register_redirect.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// Use JavaScript to handle the click event of the Register button | ||
document.getElementById("registerBtn").addEventListener("click", function() { | ||
location.href = this.getAttribute('data-url'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.