Skip to main content

Local — Media Uploads

Pycora Pro stores all media — images, logos, photos — in a single folder:

static/img/

When you upload through Decap CMS, the file lands in static/img/ and is referenced in your content as /img/filename.ext.


Before You Begin​

Make sure:

  • Terminal 1 is running: npx decap-server
  • Terminal 2 is running: python dev.py
  • You are logged into http://localhost:8000/admin/

How Media Upload Works​

Pycora Pro uses Decap CMS's image widget. Any field marked widget: image in config.yml opens a media picker.

The media folder is defined in static/admin/config.yml:

media_folder: "static/img"
public_folder: "/img"
  • media_folder — where files are saved on disk
  • public_folder — the URL path used in your content

So when you upload hero.avif, it is saved to static/img/hero.avif and referenced as /img/hero.avif.


python ssg pro jamstack static site generator

Step 1 — Upload an Image​

  1. Open any page in the CMS that has an image field (e.g., Pages → Home Page → Hero → Image)
  2. Click the image field
  3. Click Upload
  4. Select an image from your computer
  5. Wait for the upload to finish
  6. Click Save

The image is now in static/img/, and the field is filled with /img/your-image.ext.


Step 2 — Use an Existing Image​

If the image already exists in static/img/:

  1. Click the image field
  2. Click Choose an existing image
  3. Browse the media library
  4. Select the image
  5. Click Save

Step 3 — Verify the Upload​

Open your file explorer (Windows) or Finder (Mac), and navigate to:

pycora-pro/static/img/

You should see your uploaded file.

Open your browser at http://localhost:8000 — the image appears in its section.


Supported Formats​

Pycora Pro works with any image format your browser supports. Recommended formats:

FormatBest ForNotes
AVIFHero images, featured imagesSmallest file size
WebPGeneral useWide browser support
JPGPhotosUniversal
PNGLogos, icons with transparencyLarger files
SVGIcons, logosScalable, tiny

Tip: Convert large JPGs and PNGs to WebP or AVIF before uploading. This keeps your site fast and your Lighthouse score high.


Where to Use Images​

Every image field in Pycora Pro maps to a specific section:

PageFieldPurpose
Home Page → Herohero.image.urlHero image on the homepage
Home Page → Intro Grid 1intro_grid1.imageFirst grid image
Home Page → Intro Grid 3intro_grid3.imageThird grid image
Home Page → Testimonialtestimonial.imageTestimonial background
Home Page → Testimonial → Clienttestimonial.client.imageClient photo
About PageimageAbout page image
Contact PageimageContact page image
Blog PostsimageFeatured image per post
ProjectsimageFeatured image per project
Site Settingsimage, favicon, logoGlobal brand assets

Image Naming Best Practices​

Use clean, descriptive filenames:

GoodBad
hero-homepage.avifIMG_2024_final_v2.jpg
client-alvio.avifUntitled-1.png
logo-dark.svglogo (1).svg

Rules:

  • All lowercase
  • Use hyphens, not spaces
  • No special characters
  • Keep it short

Replacing an Image​

To replace an existing image:

  1. Open the image field
  2. Click Upload
  3. Select the new image
  4. Save

The old file stays in static/img/ — you can delete it manually if you want. Or keep it for future use.


Deleting an Image​

To delete an image:

  1. Open the media library (click any image field → Choose an existing image)
  2. Hover over the image you want to delete
  3. Click the trash icon
  4. Confirm

Warning: Deleting an image used elsewhere on your site will break those pages. Check first.


Troubleshooting​

Image does not appear after upload​

  1. Check that static/img/ contains the file
  2. Check that the field value starts with /img/
  3. Refresh with Ctrl + Shift + R
  4. Check the terminal for build errors

Upload fails with an error​

  1. Check that Terminal 1 (Decap server) is running
  2. Check that the file is under 10 MB
  3. Check that static/img/ exists and is writable

Image appears broken on the live site​

The image path in your content must match a file inside static/img/. Check for typos in the filename.

Image is too large / slow to load​

Convert to WebP or AVIF using a free tool like Squoosh. Aim for under 200 KB per image.


What's Next?​

You know how to upload and use media. Let's build your site for the first time.

👉 Next: Build →