May 2020
Intermediate to advanced
404 pages
10h 52m
English
We will now further edit the predictView view by following these steps:
def predictView(request): # We will add more code below this line post_data = request.POST.items() pd = [p for p in post_data] imgData = pd[1][0].replace(" ", "+") imgData += "=" * ((4 - len(imgData) % 4) % 4)
The Base64-decoded string does not have proper padding and contains spaces that need to be converted into +. The last two lines in the previous code block perform the same manipulations on the string.
filename = ''.join([random.choice(string.ascii_letters ...
Read now
Unlock full access