django / python get image from url and display on site

Given a url to an image is there a way in Django/Python to pull this image in and then display it on my site (resized if possible)

Thanks

-------------Problems Reply------------

If you just want to hotlink it print out the html snippet(<img src="http://example.com/img.png" width="100" height="100" />).

If you want to store in at your server and resize it on the server-side you might want to look into ImageMagick or PIL for processing and urllib or pycurl for downloading.

Category:python Views:0 Time:2010-03-22

Related post

  • Writing unit tests in Django / Python 2009-01-21

    I've not used Unit Tests before other than a quick introduction in a Uni course. I'm currently writing an application though and would like to teach myself TDD in the process. The problem is, I've no idea what to test or really how. I'm writing a Dja

  • Implementing OData JSON interface on Django (Python) 2010-11-08

    We would like to have a OData JSON interface on our Django (Python 2.5.4) website. At the moment of writing there seems to be no library available. I'm thinking of writing "some" logic to handle this ourselves. Would it be a good idea to extend the D

  • search form with django+python 2010-11-29

    I have just started to do a website with django + python and I want to implement a search form to be able to search on all my database objects. What I want is; when I write for an example S I want the search field to display all my objects that start

  • Capturing/Logging image related data using Django/Python 2011-04-21

    I come from a ASP.Net background and taking baby steps in open source world. I have an image based application and for every image click I want to log data on server. I'm using Django/Python to host this application. My understanding is that I need t

  • a few questions regarding simultaneous mysql access from PHP and Django/Python 2011-05-06

    What I want to do(and have done) is to access the same MySQL db. and table from both a PHP script and a Django app. However i would like to know if the way I am doing this could cause errors or issues. I hope you can help :) The setup as of now: The

  • Using Django/Python to CONSUME existing web services 2011-10-15

    I have an existing REST application serving either JSON or XML. I can use the framework (Play) to render templates directly, but I'm not allowed to (arbitrary homework requirement they just invented), and forced to use a second layer to consume, proc

  • Most effective way to create Attending Event option button [Django/Python]? 2012-03-07

    Trying to implement an "Attending" button. It's simple (or so I thought). A user with a profile clicks "Attending", and a checkmark appears. Can't quite get this to work on the Django/Python side of things. ie: Put that user who clicked 'Attending' i

  • Sharing common session/cache between django/python and java/play 2014-07-28

    My application has setup of nginx - uwsgi - django - python stack on one ec2 machine A. What I want to do is to have parallel development for some pages using java/play framework on a different ec2 machine B. nginx on machine A will redirect some url

  • Getting author of a post django python 2014-12-01

    I'm trying to get the author of each post, so I've written this function in the views.py folder that allows you to add a post, except when I introduce post_form = poster I get errors NOT NULL constraint failed: blog_post.author_id Here is the addPost

  • How does one put a link / url to the web-site's home page in Django? 2008-10-22

    In Django templates, is there a variable in the context (e.g. {{ BASE\_URL }}, {{ ROOT\_URL }}, or {{ MEDIA\_URL }} that one can use to link to the home url of a project? I.e. if Django is running in the root of a project, the variable (let's call it

  • Writing Digg like system in django/python 2009-05-15

    I am tying to write a digg , hackernews , http://collectivesys.com/ like application where users submit something and other users can vote up or down , mark items as favorite ect . I was just wondering if there are some open source implementations dj

  • Django/Python EnvironmentError? 2009-05-26

    I am getting an error when I try to use syncdb: python manage.py syncdb Error message: File "/usr/local/lib/python2.6/dist-packages/django/conf/__init__.py", line 83, in __init__ raise EnvironmentError, "Could not import settings '%s' (Is it on sys.p

  • Unicode problem Django-Python-URLLIB-MySQL 2009-07-09

    I am fetching a webpage (http://autoweek.com) and trying to process it but getting encoding error. Autoweek declares "iso-8859-1" encoding and has the word "Nürburgring" (u with umlaut) I do: # -*- encoding: utf-8 -*- import urllib webpage = urllib.u

  • Django/Python Beginner: Error when executing python manage.py syncdb - psycopg2 not found 2009-09-05

    I have Pythong2.6, psycopg2 and pgAdmin3 installed using Macports. My settings.py is: DATABASE_ENGINE = 'postgresql_psycopg2' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = 'mysite' # Or path to database file i

  • Atlassian Bamboo with Django & Python - Possible? 2009-09-14

    At my company, we currently use Atlassian Bamboo for our continuous integration tool. We currently use Java for all of our projects, so it works great. However, we are considering using a Django + Python for one of our new applications. I was wonderi

  • Can I do Django & Python web development using Xcode 3.2? 2009-12-20

    I'm not sure but I believe that Python is -next to Objective-C- somewhat natural to Mac OSX and the Xcode IDE. I might be wrong. So is it a good idea to use Xcode for Django / Python web development when I'm already a bit familiar with Xcode? Actuall

  • How do I get the "Interests" of a facebook user uing Facebook Connect? (I'm using Django/python and pyFacebook middleware) 2010-01-26

    def index(request): fbdata = [] if request.facebook.check_session(request): fbdata = request.facebook.users.getInfo(request.facebook.uid, ['name', 'pic']) print fbdata This works! I am able to get the user's picture and name. However...I'd like to ge

  • Why Django automatically adds slash after url that ends with ".htm" and doesn't when url ends with ".html"? 2010-05-01

    I have a problem that Django automatically adds slash to urls that ends with ".htm" Url like: http://127.0.0.1:8080/js/tiny_mce/themes/advanced/link.htm becomes: http://127.0.0.1:8080/js/tiny_mce/themes/advanced/link.htm/ But if I rename "link.htm" t

  • Django, subdomains and mod_rewrite. URLs messing up on deployment setups 2010-08-11

    I have a Django application being served of (say) example.com. It contains a number of sub-applications (say) strength, speed and skill. The URL scheme is something like http://example.com/strength, http://example.com/speed and http://example.com/ski

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.102 (s). 11 q(s)