Skip to content

Commit ac9f483

Browse files
renzonrenzon
authored andcommitted
Implemented Django Tool Bar
close #507
1 parent 7931c7e commit ac9f483

5 files changed

Lines changed: 18 additions & 4 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,5 @@ ENV/
107107

108108
# no including dumps
109109
*.dump
110+
111+
.pytest_cache/

pythonpro/settings.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@
7777
'django.contrib.messages.middleware.MessageMiddleware',
7878
'django.middleware.clickjacking.XFrameOptionsMiddleware',
7979
]
80+
if DEBUG:
81+
INSTALLED_APPS.append('debug_toolbar')
82+
MIDDLEWARE.insert(0, 'debug_toolbar.middleware.DebugToolbarMiddleware')
83+
INTERNAL_IPS = ['127.0.0.1']
8084

8185
# Discourse config
8286
DISCOURSE_BASE_URL = 'https://forum.python.pro.br/'

pythonpro/tests/test_urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33

44
def test_urls_len():
5-
assert 17 == len(urlpatterns)
5+
assert 16 <= len(urlpatterns)

pythonpro/urls.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
from django.conf.urls.static import static
1818
from django.contrib import admin
1919
from django.contrib.auth.views import (
20-
LoginView, LogoutView, PasswordResetCompleteView, PasswordResetConfirmView, PasswordResetDoneView,
20+
LoginView, LogoutView, PasswordResetCompleteView, PasswordResetConfirmView,
21+
PasswordResetDoneView,
2122
PasswordResetView
2223
)
2324
from django.urls import include, path
@@ -28,7 +29,8 @@
2829
path('conta/logout/', LogoutView.as_view(), name='logout'),
2930
path('conta/reiniciar_senha', PasswordResetView.as_view(), name='password_reset'),
3031
path('conta/reiniciar_senha/ok', PasswordResetDoneView.as_view(), name='password_reset_done'),
31-
path('conta/reiniciar/<uidb64>/<token>/', PasswordResetConfirmView.as_view(), name='password_reset_confirm'),
32+
path('conta/reiniciar/<uidb64>/<token>/', PasswordResetConfirmView.as_view(),
33+
name='password_reset_confirm'),
3234
path('conta/reiniciar/ok', PasswordResetCompleteView.as_view(), name='password_reset_complete'),
3335
path('aperitivo/', include('pythonpro.promos.urls')),
3436
path('discourse/', include('pythonpro.discourse.urls')),
@@ -44,3 +46,7 @@
4446

4547
if not settings.AWS_ACCESS_KEY_ID:
4648
urlpatterns.extend(static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT))
49+
if settings.DEBUG:
50+
import debug_toolbar
51+
52+
urlpatterns.append(path('__debug__/', include(debug_toolbar.urls)))

requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
botocore==1.10.50
21
boto3==1.7.49
2+
botocore==1.10.50
33
Collectfast==0.6.2
44
dj_database_url==0.5.0
5+
django-debug-toolbar==1.9.1
56
django-ordered-model==2.0.0
67
django-s3-folder-storage==0.5
78
django-storages==1.6.6
@@ -19,3 +20,4 @@ raven==6.9.0
1920
s3transfer==0.1.13
2021
six==1.11.0
2122
six==1.11.0
23+
sqlparse==0.2.4

0 commit comments

Comments
 (0)