# Path: djangoblog/utils.py
# def get_max_articleid_commentid():
# def get_sha256(str):
# def cache_decorator(expiration=3 * 60):
#     def wrapper(func):
#         def news(*args, **kwargs):
# def expire_view_cache(path, servername, serverport, key_prefix=None):
# def get_current_site():
#     def _convert_markdown(value):
#     def get_markdown_with_toc(value):
#     def get_markdown(value):
# def send_email(emailto, title, content):
# def generate_code() -> str:
# def parse_dict_to_url(dict):
# def get_blog_setting():
# def save_user_avatar(url):
# def delete_sidebar_cache():
# def delete_view_cache(prefix, keys):
# class CommonMarkdown:
# 
# Path: djangoblog/utils.py
# @cache_decorator()
# def get_current_site():
#     site = Site.objects.get_current()
#     return site


import logging
from abc import abstractmethod
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db import models
from django.urls import reverse
from django.utils.timezone import now
from django.utils.translation import gettext_lazy as _
from mdeditor.fields import MDTextField
from uuslug import slugify
from djangoblog.utils import cache_decorator, cache
from djangoblog.utils import get_current_site
        from djangoblog.utils import cache

    class Meta:
        ordering = ['-index']
        verbose_name = "分类"
        verbose_name_plural = verbose_name

    def get_absolute_url(self):
        return reverse(
            'blog:category_detail', kwargs={
                'category_name': self.slug})

    def __str__(self):
        return self.name

    @cache_decorator(60 * 60 * 10)
    def get_category_tree(self):
        """
        递归获得分类目录的父级
        :return:
        """
        categorys = []

        def parse(category):
            categorys.append(category)
            if category.parent_category:
                parse(category.parent_category)

        parse(self)
        return categorys


# Path: djangoblog/utils.py
# def get_max_articleid_commentid():
# def get_sha256(str):
# def cache_decorator(expiration=3 * 60):
#     def wrapper(func):
#         def news(*args, **kwargs):
# def expire_view_cache(path, servername, serverport, key_prefix=None):
# def get_current_site():
#     def _convert_markdown(value):
#     def get_markdown_with_toc(value):
#     def get_markdown(value):
# def send_email(emailto, title, content):
# def generate_code() -> str:
# def parse_dict_to_url(dict):
# def get_blog_setting():
# def save_user_avatar(url):
# def delete_sidebar_cache():
# def delete_view_cache(prefix, keys):
# class CommonMarkdown:
# 
# Path: djangoblog/utils.py
# @cache_decorator()
# def get_current_site():
#     site = Site.objects.get_current()
#     return site


# Path: blog/models.py
import logging
from abc import abstractmethod
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db import models
from django.urls import reverse
from django.utils.timezone import now
from django.utils.translation import gettext_lazy as _
from mdeditor.fields import MDTextField
from uuslug import slugify
from djangoblog.utils import cache_decorator, cache
from djangoblog.utils import get_current_site
        from djangoblog.utils import cache


    class Meta:
        ordering = ['-index']
        verbose_name = "分类"
        verbose_name_plural = verbose_name

    def get_absolute_url(self):
        return reverse(
            'blog:category_detail', kwargs={
                'category_name': self.slug})

    def __str__(self):
        return self.name

    @cache_decorator(60 * 60 * 10)
    def get_category_tree(self):
        """
        递归获得分类目录的父级
        :return:
        """
        categorys = []

        def parse(category):
            categorys.append(category)
            if category.parent_category:
                parse(category.parent_category)

        parse(self)
        return categorys


    @cache_decorator(60 * 60 * 10)