Upload image for profile user on django framwork - python-3.x

this is my repository github:https://github.com/Andrygaby/mySite_projecte/tree/master/fullProject/user

I'm beginner with django and I want to upload an image for my user profile,and then there are nothing displayed on the page where I pretend to put the image of the user.I pretend to put on profile_user.html and edit_profile.html,

Related

where to save images uploaded via POST and how to send that image via GET

My problem seems common but with a variety of use cases, I couldn't find the exact answer
the idea:
user will upload an image from front-end, every upload should create a json entry in database like:
{
id: number,
description: string,
image_url: string //important, this should be the image url
}
where do I save these images such that I can have an image_url so whenever someone puts the url in browser that image is seen
You can save your images in a folder and then serve its files using something like this:
app.use('/images', express.static('images'))
and image links would be like your-domain.com/images/IMAGE_NAME.
you can read more here

Display image in Background Url from MongoDB using NodeJS and Angular6

I have created an image uploader on my site and store the URL in my MongoDB. I used this guide to create my image uploader: https://appdividend.com/2018/05/25/angular-6-file-upload-tutorial/
However, when the file is stored in my MongoDB table it is a C:\\fakepath\\ url. When I try to display the url in a background-image url field via ngStyle I get the response:
Cannot read property 'image' of undefined
Here is my code for the .html page:
<div class="jumbotron" [ngStyle]="{ 'background-image': 'url(' + post.image + ')'}"></div>
The rest of the code follows suit to the guide for storing the image.
If there is a way to either modify the url before it is in the MongoDB or to eliminate the C:\\fakepath\\ and just append the end to the ./upload/ folder where the image is stored should work as well. I have tried also just using the {{post.image}} syntax and recieve the same result.
Please check the network call if you're really receiving the data
(post and url) from backend.
If you are then check the logic where you assign the backend response to variable post.
From the error, it seems that post has no value. Or you accessing it
the wrong way. Check if post is yourCtrl.post or something.

How can I send an error image if the image can't be found in cloudinary (default image?)

I want to send an image that might say something like "Image coming soon".
In gridFS I can find out if an image exists and if it exist send the image if not I could tell it to send an error image.
Is there a place in cloudinary that has a sort of default image to send if it can't find the image requested like via the img src tag.
I would like something better than a broken image.
I use nodejs
When generating the image src URL with Cloudinary Node.js SDK, you can specify the default_image parameter:
cloudinary.image("non_existing_id.png", {default_image: "avatar.png"})
Or directly in the URL:
http://res.cloudinary.com/demo/image/upload/d_avatar.png/non_existing_id.png
You can read more about this here.

Flickr api - call photo sets

I have API key and API secret and i have downloaded the recent library 3.1.
When i use the example mentioned, i get public photos. And the library i am using included this file phpFlickr.php which has all methods.
I am now trying to access the photo sets api, which is not returning anything. And the document says there is no other authentication that is required. please check the code below
require_once("phpFlickr.php");
$f = new phpFlickr("56cc01317fdce40c31c8f66498746c4d");
$sets = $f->photosets_getList();
#sandy : If you want to show flickr slider gallery in your website then you can use pictobrowser its best way to display flickr and Piccasa albums on website.
Using PictoBrowser one can easily embed Flickr and Picasa photostreams in anywebsite. All you need is follow few simple steps given here.
- visit http://pictobrowser.com/
- Click PictoBuilder at the top left corner of the page.
- Enter your Flickr/Picasa username.
- Choose images/ albums.
- Set Tag or Groups.
- It outputs some HTML code
- Copy that HTML code and paste it in your website or blog.

Load an image from a url

How can I load an image to a UIImage object from the url of the image? Currently, I am loading the image using UIImage.FromFile, and including the image as content, but I need to be able to grab it from another website.
image.Image = UIImage.FromFile("images/imageName.jpg");
Take a look at the blog post Displaying web images with MonoTouch - UIWebImageView.

Resources