Fixed unnecessary imports and local queries.
Moved line to enable use of django functions in standalone script.
Added new views with respective templates.