Update views.py

add range support