Help with Django Framework Project

Hello guys, please I need help with my Django python project. How can I achieve the result in this python script (ImageConverterwithHTML) on Django? I have tried and so far what I can do is upload and display images on Django as shown in the attached picture.

What I really need is to:

1)Make the user upload a picture

2)Convert the picture to .ico format of various sizes

3) Generate an HTML head <link tags for placement on website head e.g

4) Bundle everything to a zip file for user download.

I can achieve this with my Python script above, but I need to do the same on Django I appreciate any help, I’m a novice and very new to Python and Django. Thanks

This is non-trivial work, but roughly you would:

  1. Upload an image through a form.
  2. Do the image processing (like in your script) and either store the files locally on the server or in the database.
  3. You can then serve the processed images and/or serve a page with the code you generate in your script in a pre block for copy/paste. Look at the templating documentation for more information.
  4. You can use the zipfile module to manipulate/create zip files and then serve them or links to them as required.

You may need multiple Django models to accomplish this. I would suggest an image model that held the original and all generated icon information.

Depending on your experience in Django, you may find a tutorial that discusses uploading and processing information useful for the actual nuts and bolts of this project.

The closest thing I could find to what you’re looking for is this Django package: https://pypi.org/project/django-image-converter/

It looks like it can do everything you need except for bundling everything into a ZIP file. You might be able to write a custom Django management command to do that, or you could use a different package to handle ZIP file creation (e.g. zipfile2 · PyPI).
Also, this additional source might be helpful.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.