Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions trydjango/src/pages/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.shortcuts import render

from django.http import HttpResponse

def home_view(*args, **kwargs):
return HttpResponse("<h1>Hello World</h1>")
26 changes: 26 additions & 0 deletions trydjango/src/trydjango/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""
URL configuration for trydjango project.

The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/6.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
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
from django.urls import path

from pages.views import home_view

urlpatterns = [
path('', home_view, name='home'),
path("admin/", admin.site.urls),
]