Archived from the Transloadit support forum. Originally posted on March 6, 2012; details may be outdated, see our docs for current behavior. Original thread
Hello people, i’m in charge of our account right now. We’re using Django for our site. My question is, how can we use transloadit on our development machines, maybe there’s some sort of mock, or something. The problem is that we can’t use “localhost” as redirect URL.
Also, let me know if this flow of the Python SDK is correct:
Render the form to the user. The form has multiple fields, including his “profile picture” that will be stored on transloadit.
The user submits the form TO US. I mean, the form action is to our server.
We fetch the result, make our cleaning and comprobation of fields, and if everithin goes well store the picture on some temporal bucket.
Using the python SDK we issue the request, something like:
client = Client(AUTH_KEY, AUTH_SECRET)
params = {
‘steps’: {
I think so…still figuring out which is best for my workflow (started looking at this stuff yesterday)
Right now, it seems I can submit to the TL url, wait for the upload to finish, then post to my api to create the resource that uses the photo. Once it’s processed, I just need to know it’s done so I can mark the resource as “ready” or whatever…that’s notify_url, right?
So, a kind of related question is, can I get a list of my assemblies via the api. My thought is to write a script that checks the assemblies, and if I see a localhost:3000 notify_url, grab it and post its json to me dev url…make sense?
unfortunately it’s currently not possible via the api. But we’ll certainly support that in the future. Sorry for the inconvenience.
You can pass your notify_url to the template via your form’s params field though. So every developer could have their own custom (as in with a custom port) notify_url.
Not sure I see the advantage of performing steps 2/3 on your server as you’ll be hit twice on bandwidth. Why not submit the form directly to transloadit with a notify_url that updates your database on a successful upload?
Render the form to the user.
The user submits the form to transloadit.
On successful response, create the database objects (say a photo and photoStatus) and display a generic message that it was submitted correctly, with an id to a status page and a url to /upload/status?id=xyz. The user can click on the status page to see when the resource is ready.
Your notify arrives, update database photoStatus object. When user hits /upload/status?id=xyz the resource will be flagged as ready while display the thumbnail.