Yeah we could make the edit_card page completely AJAX-driven like it kind of was before (I disabled that functionality when I moved the form to its own view). I think that would make sense. So let's go ahead and split the edit_card view into two parts:

1. views/deck.py - edit_card() renders the form initially, either with an empty template for a new card or with the existing data for a card to edit.
2. api/deck.py - edit_card() handles the validation and saving functionality and returns the appropriate JSON response. If there's an error, display the error on the page, otherwise redirect back to the deck. The JSON response could include the URL location to redirect to, that way the javascript doesn't need to muck with query parameters and the like, just set the window.location.