Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python_django_2025
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Patryk Czarnik
python_django_2025
Commits
e7b03705
Commit
e7b03705
authored
May 15, 2025
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
odczyt czasu - wersja początkowa
parent
5cbe5a9f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
views.py
aplikacja/views.py
+10
-0
urls.py
webowy/urls.py
+2
-0
No files found.
aplikacja/views.py
View file @
e7b03705
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
django.shortcuts
import
render
from
django.shortcuts
import
render
from
datetime
import
datetime
# Create your views here.
# Create your views here.
def
hello
(
request
):
def
hello
(
request
):
return
HttpResponse
(
'Hello world'
)
return
HttpResponse
(
'Hello world'
)
# Dopisz funkcję, która zwraca bieżący czas
def
podaj_czas
(
request
):
dt
=
datetime
.
now
()
return
HttpResponse
(
dt
)
# uwzględnij tę funkcję w urls
# i przetestuj w przeglądarce
webowy/urls.py
View file @
e7b03705
...
@@ -19,8 +19,10 @@ from django.contrib import admin
...
@@ -19,8 +19,10 @@ from django.contrib import admin
from
django.urls
import
path
from
django.urls
import
path
from
aplikacja.views
import
hello
from
aplikacja.views
import
hello
from
aplikacja.views
import
podaj_czas
urlpatterns
=
[
urlpatterns
=
[
path
(
"admin/"
,
admin
.
site
.
urls
),
path
(
"admin/"
,
admin
.
site
.
urls
),
path
(
"hello"
,
hello
),
path
(
"hello"
,
hello
),
path
(
"czas"
,
podaj_czas
),
]
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment