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

13 lines
347 B
Python
Raw Permalink Normal View History

2021-03-21 12:53:47 +01:00
from django.conf import settings
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],
2021-03-21 12:53:47 +01:00
"pag": 1,
"DOMAIN": settings.DOMAIN
2021-03-10 23:36:26 +01:00
})