With the previous recipe, I covered how to upload and save files. I will show how easy it is to get those onto S3. By the time we are done, we will have our files uploaded to S3 and when needed for testing our app will deal with the local switch for us. I will show this both at the upload level and the view level.
If you did the previous recipe, you will have the basic classes you need to make this happen. Also, you need to make an S3 bucket on AWS. I will cover this a bit but read more on their website, since doing this right is a skill and you should not be using your AWS key and AWS secret in your app. You should use a set made for the app; for a user you make just for this app.