Commit a91e9715 authored by Борис Ким's avatar Борис Ким

Создал первое представление и шаблон

parent a29d0aaf
......@@ -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': [
......
......@@ -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')
]
<!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
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
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