Fixed preview of SQL und Templates if SCRIPT_NAME (prefix) is used

If you use a SCRIPT_NAME (e.g. http://example.com/myprefix/myapp/) the preview of SQL and Templates was broken. I tested the patch with a prefix (mod_wsgi, apache) and without (runserver).