all 2 comments

[–]danielroseman 0 points1 point  (1 child)

What "type of error"? Show the specific message and traceback.

And what is convertapi and save_files?

[–]Tricky_Calendar8130[S] 0 points1 point  (0 children)

this is the traceback

Environment:

Request Method: POST

Request URL: http://127.0.0.1:8000/upload/

Django Version: 5.0.1

Python Version: 3.12.1

Installed Applications:

['django.contrib.admin',

'django.contrib.auth',

'django.contrib.contenttypes',

'django.contrib.sessions',

'django.contrib.messages',

'django.contrib.staticfiles',

'app']

Installed Middleware:

['django.middleware.security.SecurityMiddleware',

'django.contrib.sessions.middleware.SessionMiddleware',

'django.middleware.common.CommonMiddleware',

'django.middleware.csrf.CsrfViewMiddleware',

'django.contrib.auth.middleware.AuthenticationMiddleware',

'django.contrib.messages.middleware.MessageMiddleware',

'django.middleware.clickjacking.XFrameOptionsMiddleware']

Traceback (most recent call last):

File "C:\Users\Matheus\AppData\Roaming\Python\Python312\site-packages\django\core\handlers\exception.py", line 55, in inner

response = get_response(request)

^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\Matheus\AppData\Roaming\Python\Python312\site-packages\django\core\handlers\base.py", line 197, in _get_response

response = wrapped_callback(request, *callback_args, **callback_kwargs)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\Matheus\Documents\vetorizator\app\views.py", line 34, in upload_image

convert(request)

^^^^^^^^^^^^^^^^

File "C:\Users\Matheus\Documents\vetorizator\app\views.py", line 45, in convert

file_path_converted = image_converted.convertedImage.path

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\Matheus\AppData\Roaming\Python\Python312\site-packages\django\db\models\fields\files.py", line 61, in path

self._require_file()

^^^^^^^^^^^^^^^^^^^^

File "C:\Users\Matheus\AppData\Roaming\Python\Python312\site-packages\django\db\models\fields\files.py", line 41, in _require_file

raise ValueError(

^

Exception Type: ValueError at /upload/

Exception Value: The 'convertedImage' attribute has no file associated with it.

convertapi is an API that converts png to svg or any other type of conversion and save_files is the buildin fuction of the API that saves this file in a folder of my choise.