Last active
December 17, 2015 21:49
-
-
Save darklow/5677250 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# urls.py | |
urlpatterns = patterns('', | |
# ... | |
# Example for custom view | |
url(r'^admin/custom/$', views.custom_view), | |
# ... | |
# Admin | |
url(r'^admin/', include(admin.site.urls)), | |
) | |
# views.py | |
from django.contrib.admin.views.decorators import staff_member_required | |
from django.shortcuts import render_to_response | |
from django.template import RequestContext | |
@staff_member_required | |
def custom_view(request): | |
context = { | |
'title': 'Custom view', | |
} | |
template = 'admin/custom_view.html' | |
return render_to_response(template, context, | |
context_instance=RequestContext(request)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment