Okay, to start off I am new to the world of working with servers and RESTful clients. What I am currently doing is working on a RESTful client api and I realized as I was chugging along that there were times when the api would completely fail due to errors in different parts of the code. I am working with Django on Amazon EC2 servers.
The point of my question is: what is good practice in setting up a way to work on the api without constantly causing failures? I've thought about having a variable that directs flow through the client based on whether the request is a test or not, but that still does not solve the issue of larger problems that may occur.
Advice, leads and reading material is appreciated. I've looked around and asked advice of some people, but I am still fairly lost. At this point, the easiest option seems to be to make a complete duplicate environment for testing (so a whole new server) and only push the changes when the development is stable. This just seems really inefficient though.