mirror of
https://github.com/KUlishevgeniy/c22712.git
synced 2026-09-24 08:00:22 +00:00
django test
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class PollsConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'polls'
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
@@ -0,0 +1,9 @@
|
||||
h1 {
|
||||
color: blue;
|
||||
}
|
||||
table, tr, th {
|
||||
width: 50%;
|
||||
border: 1px solid;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{% load static %}
|
||||
<link rel="stylesheet" href="{% static 'polls/style.css' %}">
|
||||
<title>TEST</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<table>
|
||||
{% for i in list %}
|
||||
<tr>
|
||||
<th>{{ i }}</th>
|
||||
<th>{{ i }}</th>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
@@ -0,0 +1,7 @@
|
||||
from django.urls import path
|
||||
from . import views
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
path("", views.index, name="index"),
|
||||
]
|
||||
@@ -0,0 +1,10 @@
|
||||
from django.http import HttpResponse
|
||||
from django.shortcuts import render
|
||||
|
||||
def index(request):
|
||||
context = {
|
||||
"text": "test",
|
||||
"list": [0, 1, 2, 3, "frogg"]
|
||||
}
|
||||
|
||||
return HttpResponse(render(request, "polls/index.html", context))
|
||||
Reference in New Issue
Block a user