A simple app for executing SQL queries in Django admin panel.
! WARNINIG !
Do not install this app if you afraid of consequences of giving access to database from admin panel.
- Python3
- Django 1.9
pip install django-sql
Add to your INSTALLED_APPS in settings.py:
INSTALLED_APPS = [
...
'sqlapp',
]Add to your urls.py:
from sqlapp.sqlapp import execute_sql
urlpatterns = [
url(r'^admin/sqlapp/(?:sql/)?$', execute_sql, name='sql'),
url(r'^admin/', include(admin.site.urls), name='admin'),
]Note: The sqlapp URL pattern must come BEFORE the admin pattern as shown above.