Skip to content

Instantly share code, notes, and snippets.

@reorx
Created April 18, 2014 07:48
Show Gist options
  • Save reorx/11030100 to your computer and use it in GitHub Desktop.
Save reorx/11030100 to your computer and use it in GitHub Desktop.
import os
import sys
BASE_PATH = os.path.dirname(__file__)
from django.conf import settings
from django.conf.urls import patterns, url
from django.core.management import execute_from_command_line
from django.shortcuts import render
settings.configure(
DEBUG=True,
SECRET_KEY='placerandomsecretkeyhere',
ROOT_URLCONF=sys.modules[__name__],
TEMPLATE_DIRS=(
os.path.join(BASE_PATH, 'templates'),
),
)
def index(request):
return render(request, 'index.html', {'request': request})
urlpatterns = patterns('',
url(r'^$', index, name='index'),
)
if __name__ == "__main__":
execute_from_command_line(sys.argv)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment