Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5992861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:35:35+00:00 2026-05-22T23:35:35+00:00

I an using this plugin to generate thumbnails. But somhow I couldn’t make it

  • 0

I an using this plugin to generate thumbnails. But somhow I couldn’t make it work. The models work well, as images can be uploaded from the admin interface, even thumbnails get generated. I uploaded an image named “myphoto.jpg”. The view I have is this.

def mainpage(request,slug):
    page = get_object_or_404(MainPage, slug=slug)
    image = get_object_or_404(Image)
    return direct_to_template(request, 'flatpage.html',
        extra_context={
            'page':page,
            'image':image,
        })

I have defined the class in models as “Image”. I had this in the template:
<img src="{% image.photo.myphoto_125x125 %}"> But the template shows error.

This is my model:

class Image(models.Model):
    title = models.CharField(max_length=100)
    photo = ImageWithThumbsField(upload_to='images/', sizes=((125,125),(200,200)))
    # second_photo = ImageWithThumbsField(upload_to='site_media/images')

    def __unicode__(self):
        return self.title

The second field, “second_photo” I have commented out as it created duplicate copy of the main image. Even I am looking for a way to create entry for actual unsized image in the first field itself.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:35:35+00:00Added an answer on May 22, 2026 at 11:35 pm

    Somehow I got it working. Instead of creating a separate class, I used this line photo = ImageWithThumbsField(blank=True, upload_to='images/', sizes=((125,125),(200,200))) in my blog class. And I used the line {{% post.photo.url_125x124 %} in my index.html template.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this jQuery inline datePicker plugin sample but I don't know how to
I am using Eclipse WTP plugin to generate the stub from this WSDL: https://api.sandbox.ebay.com/wsapi?wsdl
I'm using the friendly_id plugin to generate SEO-friendly URLS for some of my models.
I am using this jquery plugin to generate QR Codes from string: https://github.com/jeromeetienne/jquery-qrcode It
I'm using the maven cobertura plugin to generate coverage reports, but for some reason,
I'm using this plugin: http://www.jeremymartin.name/projects.php?project=kwicks And my code follows this example: http://www.jeremymartin.name/examples/kwicks.php?example=7 I'm using
I am using this plugin for my new site: http://colorpowered.com/colorbox/ The page in concern
First as a note I am using this plugin in a Rails app. Ok
I'm currently using this jQuery validate plugin and having an issue in IE where
I'm trying to automatically compress both CSS and JS using maven and this plugin

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.