Skip to main content

Use this pre-built prompt to get started faster.

Open in Cursor

Prerequisites

Guide

1

Install

Add the Python client to the project.
2

Configure the project

The key and the two uuids from the next step live in the environment, so a missing value stops the project at startup rather than on the first render.
settings.py
Build the client once and import it where a view needs it.
mockups/client.py
3

Upload the template once

A PSD is uploaded once and rendered many times, so this belongs in a management command rather than in request handling.
mockups/management/commands/upload_mockup.py
Run it once, and keep the two uuids it prints as SUDOMOCK_MOCKUP_UUID and SUDOMOCK_SMART_OBJECT.
4

Render from a view

The view takes an artwork URL, fills the smart object with it, and answers with the finished image.
mockups/views.py
csrf_exempt suits a route your own backend calls; a route a browser form posts to keeps the token instead. Wire the view into urls.py and post an artwork URL to it.

Next steps

Render a PSD mockup

Every field the render call accepts.

Create a mockup from a PSD

What an upload answers with.

Retrieve a single job

Collect a background render by its job id.

Errors

Each error_code, and which statuses are worth retrying.

Webhooks

Let a finished render call your Django route back.

SDKs

Every resource the Python client exposes, and the Node one.