Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
coursework
Project
Project
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
Борис Ким
coursework
Commits
a91e9715
Commit
a91e9715
authored
Oct 30, 2021
by
Борис Ким
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Создал первое представление и шаблон
parent
a29d0aaf
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
3 deletions
+19
-3
settings.py
source/portal/settings.py
+1
-1
urls.py
source/portal/urls.py
+2
-0
courses.html
source/webapp/templates/courses/courses.html
+14
-0
courses_views.py
source/webapp/views/courses_views.py
+2
-2
No files found.
source/portal/settings.py
View file @
a91e9715
...
...
@@ -45,7 +45,7 @@ ROOT_URLCONF = 'portal.urls'
TEMPLATES
=
[
{
'BACKEND'
:
'django.template.backends.django.DjangoTemplates'
,
'DIRS'
:
[],
'DIRS'
:
[
os
.
path
.
join
(
BASE_DIR
,
'templates'
)
],
'APP_DIRS'
:
True
,
'OPTIONS'
:
{
'context_processors'
:
[
...
...
source/portal/urls.py
View file @
a91e9715
...
...
@@ -15,7 +15,9 @@ Including another URLconf
"""
from
django.contrib
import
admin
from
django.urls
import
path
from
webapp.views
import
courses_views
as
webapp_views
urlpatterns
=
[
path
(
'admin/'
,
admin
.
site
.
urls
),
path
(
''
,
webapp_views
.
my_view
,
name
=
'main'
)
]
source/webapp/templates/courses/courses.html
View file @
a91e9715
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"ie=edge"
>
<link
rel=
"stylesheet"
href=
"https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css"
>
<link
rel=
"stylesheet"
href=
"https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity=
"sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
crossorigin=
"anonymous"
>
<title>
{% block title %}{% endblock %}
</title>
</head>
<body>
</body>
</html>
\ No newline at end of file
source/webapp/views/courses_views.py
View file @
a91e9715
from
django.shortcuts
import
render
def
view
(
request
):
return
render
(
request
,
'courses.html'
)
\ No newline at end of file
def
my_view
(
request
):
return
render
(
request
,
'courses/courses.html'
)
\ No newline at end of file
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