-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhello.py
More file actions
46 lines (38 loc) · 765 Bytes
/
Copy pathhello.py
File metadata and controls
46 lines (38 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import sys
"""
Settings
========
Would normally go in project_app/settings.py
"""
from django.conf import settings
settings.configure(
DEBUG = True,
SECRET_KEY = 'yourrandomsecretkey',
ROOT_URLCONF = __name__,
MIDDLEWARE_CLASSES = (),
)
"""
Views
=====
Would normally go in app/views.py
"""
from django.http import HttpResponse
def index(request):
return HttpResponse('Hello World')
"""
URLs
====
The root URL config normally goes in project_app/urls.py
"""
from django.conf.urls import url
urlpatterns = (
url(r'^$', index),
)
"""
Manage.py
=========
Some setup code typically found in manage.py
"""
if __name__ == '__main__':
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)