Commit db181981 authored by Charles Lim's avatar Charles Lim

Created the homepage app and removed the views inside root folder. Changed...

Created the homepage app and removed the views inside root folder. Changed comment regarding page in views.py
parent f2109090
from django.shortcuts import render from django.shortcuts import render
from django.http import HttpResponse from django.http import HttpResponse
# Create your views here. # View for forum page
def index(request): def index(request):
return HttpResponse("Welcome to Widget's Forum!") return HttpResponse("Welcome to Widget's Forum!")
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class HomepageConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'homepage'
from django.db import models
# Create your models here.
from django.test import TestCase
# Create your tests here.
from django.urls import path
from .views import index
urlpatterns = [
path('', index, name='index'),
]
app_name = "homepage"
\ No newline at end of file
from django.shortcuts import render
from django.http import HttpResponse
# View for HomePage
def index(request):
return HttpResponse("Welcome to Widget!")
...@@ -16,10 +16,8 @@ Including another URLconf ...@@ -16,10 +16,8 @@ Including another URLconf
from django.contrib import admin from django.contrib import admin
from django.urls import path, include from django.urls import path, include
from .views import homepage
urlpatterns = [ urlpatterns = [
path('homepage/',homepage, name='homepage'), path('homepage/', include("homepage.urls", namespace='homepage')),
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
path('forum/', include("forum.urls", namespace='forum')), path('forum/', include("forum.urls", namespace='forum')),
] ]
from django.http import HttpResponse
# Shows the webpage for the path /homepage
def homepage(request):
return HttpResponse('Welcome to Widget!')
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment