Skip to content

Commit fa23a8e

Browse files
committed
add example app
1 parent c028dd4 commit fa23a8e

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>They... are BILLIONS!</title>
5+
</head>
6+
<body>
7+
<h1><a href="http://store.steampowered.com/app/644930/They_Are_Billions/">They Are Billions</a></h1>
8+
<img src="https://media.giphy.com/media/2jUHXTGhGo156/giphy.gif">
9+
</body>
10+
</html>

monitor-django-apps/djmonitor/billions/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
from . import views
33

44
urlpatterns = [
5-
url(r'', views.theyare, name="theyare"),
5+
url(r'(?P<slug>[\wa-z-]+)/', views.they, name="they"),
66
]
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
from django.http import HttpResponse
1+
from django.core.exceptions import PermissionDenied
22
from django.shortcuts import render
33

44

5-
def theyare(request):
6-
return HttpResponse("billions")
5+
def they(request, slug):
6+
if slug and slug == "are":
7+
return render(request, 'billions.html', {})
8+
else:
9+
raise PermissionDenied("Hmm, can't find what you're looking for.")

monitor-django-apps/djmonitor/djmonitor/settings.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
'django.contrib.auth.middleware.AuthenticationMiddleware',
4949
'django.contrib.messages.middleware.MessageMiddleware',
5050
'django.middleware.clickjacking.XFrameOptionsMiddleware',
51+
'rollbar.contrib.django.middleware.RollbarNotifierMiddleware',
5152
]
5253

5354
ROOT_URLCONF = 'djmonitor.urls'
@@ -119,3 +120,12 @@
119120
# https://docs.djangoproject.com/en/2.0/howto/static-files/
120121

121122
STATIC_URL = '/static/'
123+
124+
ROLLBAR = {
125+
'access_token': 'ea51d440d83f43d296e6c1dd13a44dc8',
126+
'environment': 'development' if DEBUG else 'production',
127+
'branch': 'master',
128+
'root': '/Users/matt/devel/py/blog-code-examples/monitor-django-apps/djmonitor',
129+
'patch_debugview': False,
130+
}
131+

0 commit comments

Comments
 (0)