-
-
Save andersk/56784fc0c4cd22005b4ba2925ebb9895 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import sys | |
from django.core.management import execute_from_command_line | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mctest_settings") | |
execute_from_command_line(sys.argv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from django.core.asgi import get_asgi_application | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mctest_settings") | |
application = get_asgi_application() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEBUG = True | |
SECRET_KEY = "sekrit" | |
ROOT_URLCONF = "mctest_urls" | |
WSGI_APPLICATION = "mctest_wsgi.application" | |
CACHES = { | |
"default": { | |
"BACKEND": "django.core.cache.backends.memcached.PyLibMCCache", | |
"LOCATION": "127.0.0.1:11211", | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.cache import cache | |
from django.http import HttpResponse | |
from django.urls import path | |
def view(request): | |
cache.set("foo", "ok") | |
return HttpResponse(cache.get("foo")) | |
urlpatterns = [path("", view)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from django.core.wsgi import get_wsgi_application | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mctest_settings") | |
application = get_wsgi_application() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment