Ensure app origin is encoded (bug 1065006)

Can you URL encode the origin before you pass it to django or will that cause it to be doubly escaped?