Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ django-filter = "*"
django-autoslug = "*"
social-auth-app-django = "*"
django-waffle = "*"
django-debug-toolbar = "*"


[dev-packages]
Expand Down
34 changes: 24 additions & 10 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ services:
environment:
- DJANGO_SECRET_KEY=secret_key
- DEBUG=True
- DOCKER=True
- DATABASE_URL=postgres://postgres@db/postgres
- SOCIAL_AUTH_GITHUB_KEY=${SOCIAL_AUTH_GITHUB_KEY}
- SOCIAL_AUTH_GITHUB_SECRET=${SOCIAL_AUTH_GITHUB_SECRET}
Expand Down
11 changes: 11 additions & 0 deletions volproject/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"""

import os
import socket

import dj_database_url

Expand All @@ -27,6 +28,14 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = os.environ.get('DEBUG', False)

# Used by Django Debug Toolbar (DDT)
INTERNAL_IPS = ["127.0.0.1"]

# Figure out client IP if running in Docker, for DDT
if os.environ.get('DOCKER', False):
ip = socket.gethostbyname(socket.gethostname())
INTERNAL_IPS += [ip[:-1] + '1']

GOOGLE_ANALYTICS_PROPERTY_ID = os.environ.get('GOOGLE_ANALYTICS_PROPERTY_ID')
GOOGLE_ANALYTICS_DOMAIN = os.environ.get('GOOGLE_ANALYTICS_DOMAIN')
GOOGLE_ANALYTICS_SITE_SPEED = True
Expand Down Expand Up @@ -54,6 +63,7 @@
'django_filters',
'social_django',
'waffle',
'debug_toolbar',
]

MIDDLEWARE = [
Expand All @@ -65,6 +75,7 @@
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.gzip.GZipMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware',
# Simplified static file serving.
# https://warehouse.python.org/project/whitenoise/
'whitenoise.middleware.WhiteNoiseMiddleware',
Expand Down
6 changes: 6 additions & 0 deletions volproject/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin

Expand All @@ -21,3 +22,8 @@
url(r'^api', include('api.urls')),
url(r'^', include('vol.urls')),
]

if settings.DEBUG:
import debug_toolbar

urlpatterns = [url(r'^__debug__/', include(debug_toolbar.urls))] + urlpatterns