Skip to content

Instantly share code, notes, and snippets.

@rense
Created June 8, 2016 08:35
Show Gist options
  • Save rense/07d70d11408074ea55d115793c89b019 to your computer and use it in GitHub Desktop.
Save rense/07d70d11408074ea55d115793c89b019 to your computer and use it in GitHub Desktop.
import sys
from django.conf import settings
settings.configure(
DEBUG=True,
SECRET_KEY='thisisthesecretkey',
ROOT_URLCONF=__name__,
MIDDLEWARE_CLASSES=(
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
),
)
from django.conf.urls import url
from django.http import HttpResponse
def index(request):
return HttpResponse('Aloha!')
urlpatterns = (url(r'^$', index),)
if __name__ == "__main__":
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
@fmalina
Copy link

fmalina commented Jun 21, 2016

Nice one, back to basics.
You could also leave out all the MIDDLEWARE_CLASSES and SECRET_KEY to go barebones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment