Skip to content

Commit

Permalink
Add chatbot app and configure URLs.
Browse files Browse the repository at this point in the history
  • Loading branch information
HeitorLouzeiro committed Dec 30, 2023
1 parent 6097771 commit fc6256e
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 2 deletions.
Empty file added chatbot/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions chatbot/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions chatbot/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class ChatbotConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'chatbot'
Empty file added chatbot/migrations/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions chatbot/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
3 changes: 3 additions & 0 deletions chatbot/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
7 changes: 7 additions & 0 deletions chatbot/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.urls import path

from . import views

urlpatterns = [
path('', views.index, name='index'),
]
6 changes: 6 additions & 0 deletions chatbot/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.shortcuts import HttpResponse, render


# Create your views here.
def index(request):
return HttpResponse("Hello, world. You're at the chatbot index.")
6 changes: 5 additions & 1 deletion settings/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'chatbot',
]

MIDDLEWARE = [
Expand All @@ -55,7 +56,7 @@
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'DIRS': [BASE_DIR / 'templates'],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
Expand Down Expand Up @@ -117,6 +118,9 @@
# https://docs.djangoproject.com/en/4.1/howto/static-files/

STATIC_URL = 'static/'
STATICFILES_DIRS = [
BASE_DIR / '../chatbot/templates/static',
]

# Default primary key field type
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
Expand Down
3 changes: 2 additions & 1 deletion settings/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.urls import include, path

urlpatterns = [
path('admin/', admin.site.urls),
path('', include('chatbot.urls')),
]

0 comments on commit fc6256e

Please sign in to comment.