2016-10-19 improve the Django templates + unobstrusive Javascript (step1)¶
Modify names¶
- champion_auto_complete -> champion_get_json
Test champion_get_json : http://127.0.0.1:8004/projects/champion_get_json/?term=a¶
Adding django-debug-toolbar¶
See also
pip install django-debug-toolbar
# https://django-extensions.readthedocs.org/en/latest
'django_extensions',
# http://django-ajax-selects.readthedocs.io/en/latest/index.html
'ajax_select',
# http://django-crispy-forms.readthedocs.io/en/latest/install.html#installing-django-crispy-forms
'crispy_forms',
# https://github.com/jazzband/django-debug-toolbar
'debug_toolbar',
# # https://docs.djangoproject.com/en/dev/ref/applications/#django.apps.AppConfig
'singers.apps.SingersConfig',
# http://guiqinqian.blogspot.fr/2012/01/using-jquery-auto-complete-in-django.html
'projects.apps.ProjectsConfig'
]
if settings.DEBUG:
import debug_toolbar
urlpatterns += [
url(r'^__debug__/', include(debug_toolbar.urls)),
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware'
]
Warning
do not forget to set the new INTERNAL_IPS variable
INTERNAL_IPS = ‘127.0.0.1’