diff --git a/Group_14/settings.py b/Group_14/settings.py index 51fc3a8fe2100a0d5d2e37abe99ad02a5d23ef43..88c4a02d65e1cc3c85fbdfe4d2b3892ed42da131 100644 --- a/Group_14/settings.py +++ b/Group_14/settings.py @@ -37,6 +37,7 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'Group_14', # Add the app to the project ] MIDDLEWARE = [ diff --git a/Group_14/templates/home.html b/Group_14/templates/home.html new file mode 100644 index 0000000000000000000000000000000000000000..d88707168adab8c4c304b4bf32f4ea6490758a4c --- /dev/null +++ b/Group_14/templates/home.html @@ -0,0 +1,14 @@ +<!-- myapp/templates/home.html --> +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Recipe web app</title> + +</head> +<body> + <h1>Recipe web app</h1> + <p>This is the index page for the recipe app</p> +</body> +</html> diff --git a/Group_14/urls.py b/Group_14/urls.py index e02934bc737af3c1281c8dcf7c10eceec5277230..2f8c1e4213bf624064f23f5f6480165519af7a15 100644 --- a/Group_14/urls.py +++ b/Group_14/urls.py @@ -14,9 +14,11 @@ Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ -from django.contrib import admin +# myapp/urls.py from django.urls import path +from . import views urlpatterns = [ - path('admin/', admin.site.urls), + path('', views.home, name='home'), # Map the root URL to the home view ] + diff --git a/Group_14/views.py b/Group_14/views.py new file mode 100644 index 0000000000000000000000000000000000000000..e8f395d5f81a625af525da42f65cf657dbd53891 --- /dev/null +++ b/Group_14/views.py @@ -0,0 +1,5 @@ +# myapp/views.py +from django.shortcuts import render + +def home(request): + return render(request, 'home.html') diff --git a/urls.py b/urls.py new file mode 100644 index 0000000000000000000000000000000000000000..18e560dcb72fd639d5ef82043ac058a7046e2631 --- /dev/null +++ b/urls.py @@ -0,0 +1,8 @@ +# myproject/urls.py +from django.contrib import admin +from django.urls import path, include + +urlpatterns = [ + path('admin/', admin.site.urls), + path('', include('myapp.urls')), # Include the URLs of app +]