Search This Blog

Showing posts with label images. Show all posts
Showing posts with label images. Show all posts

Thursday, June 8, 2023

Why python django uploaded images not showing in angular UI profile or any screen ?

Option 1: 

    Note:  keep your images under media/ <folder> for upload and view 


Option 2: 

if you want to change the default media folder under your project root, 

then please go to settings.py 

MEDIA=<custom path> 

MEDIA_URL=<path after above media settings>


Now

http://<url:port>/media/customfolder/image.jpg



Wednesday, February 26, 2020

Python - Download Captcha Images

import requests
import os
from random import randint

for x in range(100, 1000):
    url = ""
    payload = {}
    headers= {}
    response = requests.request("GET", url, headers=headers, data = payload)
    #print(response.text.encode('utf8'))
   
    url = ""
    payload = {}
    response = requests.request("GET", url, cookies=response.cookies)
   
    f_ext = x
    f_name = 'D:/Temp/Captcha/{}.png'.format(f_ext)
    with open(f_name, 'wb') as f:
        f.write(response.content)
   
    print("Iteration : " + str(x) )

print( "Done !")

Hit Counter


View My Stats