mirror of
https://github.com/KUlishevgeniy/c22712.git
synced 2026-09-24 08:00:22 +00:00
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
from django.http import HttpResponse
|
||||
from django.shortcuts import render
|
||||
# from db_get_data import exec_query
|
||||
|
||||
from db_get_data import exec_query
|
||||
|
||||
def index(request):
|
||||
context = {
|
||||
"text": "test",
|
||||
"list": range(101)
|
||||
"data": exec_query("select name, file, description from images")
|
||||
}
|
||||
|
||||
for i in range(len(context["data"])):
|
||||
context["data"][i] = list(context["data"][i])
|
||||
context["data"][i][1] = "polls/images/" + context["data"][i][1].split("/")[-1]
|
||||
|
||||
print(context["data"])
|
||||
return HttpResponse(render(request, "polls/index.html", context))
|
||||
|
||||
|
||||
def test(req):
|
||||
return HttpResponse("test")
|
||||
|
||||
Reference in New Issue
Block a user