How to add tags to your models in Django
Jul 27, 2020 | 663 views
How to add tags to your models in Django | Django Packages Series #1
https://django-taggit.readthedocs.io/en/latest/api.html
Tags: Python
Jul 27, 2020 | 663 views
How to add tags to your models in Django | Django Packages Series #1
https://django-taggit.readthedocs.io/en/latest/api.html
Jul 27, 2020 | 657 views
From: https://www.calazan.com/adding-basic-search-to-your-django-site/
and How to Add Search Functionality to a Website in Django
# blogs/views.py
import operator
from django.db.models import Q
class BlogSearchListView(BlogListView):
"""
Display a Blog List page filtered by the search query.
"""
paginate_by = 10
def get_queryset(self):
result = super(BlogSearchListView, self).get_queryset()
query = self.request.GET.get('q')
if query:
query_list = query.split()
result = result.filter(
reduce(operator.and_,
(Q(title__icontains=q) for q in query_list)) |
reduce(operator.and_,
(Q(content__icontains=q) for q in query_list))
)
return result
Comments: 0
Jul 26, 2020 | 666 views
Django --> Gunicorn (WSGI server) --> Nginx
From here:
How To Deploy Django App with Nginx, Gunicorn, PostgreSQL and Let’s Encrypt SSL on Ubuntu
and here:
How To Set Up Django with Postgres, Nginx, and Gunicorn on Ubuntu 18.04