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 8595453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:26:13+00:00 2026-06-12T00:26:13+00:00

Hello am new with mongoengine. I just want to retrieving an image from mongoengine

  • 0

Hello am new with mongoengine. I just want to retrieving an image from mongoengine and display it on a page as http reponse in python. I have added images to database and i printed it in the console and i got the following result:

 <GridFSProxy: 506038485e160077b3efc592>
 genus:m
 family:n
 <GridFSProxy: 5060384a5e160077b3efc595>
 genus:m
 family:n

this is my output when i printed the contents in database.from this i understood that the image got saved into database as objects with ids and now what i want is to display these images into a web page. I use for exampleopen(os.path.join(MEDIA_DIR, u"users/clients.html")) to open a client page. how can i show the image in the client page?

  • 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-06-12T00:26:14+00:00Added an answer on June 12, 2026 at 12:26 am

    Taking the documentation example you can retrieve a file like so:

    marmot = Animal.objects(genus='Marmota').first()
    photo = marmot.photo.read()
    content_type = marmot.photo.content_type
    

    So you can get the content_type and set the headers correctly and yield the photo as the content

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

Sidebar

Related Questions

hello im new to python and have been reading over the documentation and am
class Hello @hello = hello def display puts @hello end end h = Hello.new
Hello.Am new to ios development.What have to do for NSOpenPanel to work in the
Hello I'm new to Joomla and I want to change the way an account
hello I'm new to PHP programming and I migrated from ASP .net to PHP..
Hello am new to array can someone help? i have array in array. how
In Asp.net mvc3 razor I have: Ajax.ActionLink(Hello world, Hello, Say, new RouteValueDictionary(new { word
Hello iam new to GWT framework. I want to persist my domain objects/entities to
Hello I am new to WPF and i do have some experience in ASP.NET
I make a alternate entry point that display a dialog Hello new week on

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.