- add cache
- add github issue support
This commit is contained in:
parent
cf30559c26
commit
89fa95f931
4 changed files with 11 additions and 2 deletions
|
@ -1,6 +1,8 @@
|
||||||
from django.http import HttpResponse, Http404
|
from django.http import HttpResponse, Http404
|
||||||
from rest_framework.views import APIView
|
from rest_framework.views import APIView
|
||||||
from rest_framework.decorators import api_view
|
from rest_framework.decorators import api_view
|
||||||
|
from django.utils.decorators import method_decorator
|
||||||
|
from django.views.decorators.cache import cache_page
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
from .models import Fact
|
from .models import Fact
|
||||||
from .serializers import FactSerializer
|
from .serializers import FactSerializer
|
||||||
|
|
|
@ -15,7 +15,6 @@ from pathlib import Path
|
||||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
|
|
||||||
|
|
||||||
# Quick-start development settings - unsuitable for production
|
# Quick-start development settings - unsuitable for production
|
||||||
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
|
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
|
||||||
|
|
||||||
|
@ -25,6 +24,13 @@ SECRET_KEY = 'aekeijahsheik8AhghaiDie5awuen3ahvaeHeeyirahsaic4einaePeiyoophahd'
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
|
|
||||||
|
CACHES = {
|
||||||
|
'default': {
|
||||||
|
'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
|
||||||
|
'LOCATION': 'cache',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ALLOWED_HOSTS = ['*']
|
ALLOWED_HOSTS = ['*']
|
||||||
|
|
||||||
REST_FRAMEWORK = {
|
REST_FRAMEWORK = {
|
||||||
|
|
|
@ -4,6 +4,7 @@ from django.shortcuts import redirect
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path("factoids/", include("factoids.urls")),
|
path("factoids/", include("factoids.urls")),
|
||||||
|
path("bugtracker/", include("bugtracker.urls")),
|
||||||
path("admin/", admin.site.urls),
|
path("admin/", admin.site.urls),
|
||||||
path('', lambda request: redirect('factoids/', permanent=False)), # Redirect from root to 'factoids'
|
path('', lambda request: redirect('factoids/', permanent=False)), # Redirect from root to 'factoids'
|
||||||
]
|
]
|
Loading…
Reference in a new issue