demo-HTML-over-WebSockets-i.../apps/front/views.py

11 lines
279 B
Python
Raw Normal View History

2021-03-07 18:15:29 +01:00
from django.shortcuts import render
2021-03-12 00:09:19 +01:00
from apps.back.models import Post
2021-03-10 23:36:26 +01:00
import uuid
2021-03-07 18:15:29 +01:00
2021-03-10 23:36:26 +01:00
def all_articles(request):
return render(request, 'layouts/main.html', {
2021-03-12 00:09:19 +01:00
"CHANNEL": uuid.uuid4().hex[:20].upper(),
2021-03-12 21:16:23 +01:00
"posts": Post.objects.all()[:3],
"pag": 1
2021-03-10 23:36:26 +01:00
})