Traceback (most recent call last): File…
- User
Traceback (most recent call last): File "/home/appuser/.local/lib/python3.8/site-packages/gunicorn/workers/sync.py", line 136, in handle self.handle_request(listener, req, client, addr) File "/home/appuser/.local/lib/python3.8/site-packages/gunicorn/workers/sync.py", line 179, in handle_request respiter = self.wsgi(environ, resp.start_response) File "/home/appuser/.local/lib/python3.8/site-packages/django/core/handlers/wsgi.py", line 131, in call response = self.get_response(request) File "/home/appuser/.local/lib/python3.8/site-packages/django/core/handlers/base.py", line 140, in get_response response = self._middleware_chain(request) File "/home/appuser/.local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 57, in inner response = response_for_exception(request, exc) File "/home/appuser/.local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 140, in response_for_exception response = handle_uncaught_exception( File "/home/appuser/.local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 181, in handle_uncaught_exception return debug.technical_500_response(request, *exc_info) File "/home/appuser/.local/lib/python3.8/site-packages/django/views/debug.py", line 66, in technical_500_response html = reporter.get_traceback_html() File "/home/appuser/.local/lib/python3.8/site-packages/django/views/debug.py", line 396, in get_traceback_html c = Context(self.get_traceback_data(), use_l10n=False) File "/home/appuser/.local/lib/python3.8/site-packages/django/views/debug.py", line 381, in get_traceback_data c["raising_view_name"] = get_caller(self.request) File "/home/appuser/.local/lib/python3.8/site-packages/django/views/debug.py", line 99, in get_caller resolver_match = resolve(request.path) File "/home/appuser/.local/lib/python3.8/site-packages/django/urls/base.py", line 24, in resolve return get_resolver(urlconf).resolve(path) File "/home/appuser/.local/lib/python3.8/site-packages/django/urls/resolvers.py", line 663, in resolve for pattern in self.url_patterns: File "/home/appuser/.local/lib/python3.8/site-packages/django/utils/functional.py", line 57, in get res = instance.dict[self.name] = self.func(instance) File "/home/appuser/.local/lib/python3.8/site-packages/django/urls/resolvers.py", line 715, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/home/appuser/.local/lib/python3.8/site-packages/django/utils/functional.py", line 57, in get res = instance.dict[self.name] = self.func(instance) File "/home/appuser/.local/lib/python3.8/site-packages/django/urls/resolvers.py", line 708, in urlconf_module return import_module(self.urlconf_name) File "/home/appuser/anaconda3/lib/python3.8/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "", line 783, in exec_module File "", line 219, in _call_with_frames_removed File "/home/appuser/maskrestdj/maskrestdj/urls.py", line 18, in from maskapi.views import digitalKYCProcessBaseSF,fileMaskProcessBaseSF,invoiceProcessBaseSF,compressProcess File "/home/appuser/maskrestdj/maskapi/views.py", line 195 print("Inside CompressProcess method",filename) ^ TabError: inconsistent use of tabs and spaces in indentation
- Assistant
The error message you're encountering (
TabError: inconsistent use of tabs and spaces in indentation) indicates that there are mixed tabs and spaces used for indentation in your Python code, specifically in theviews.pyfile at line 195.Python is sensitive to indentation, and mixing tabs and spaces can lead to issues where the interpreter doesn't know how to correctly interpret the structure of your code. To resolve this error, follow these steps:
- User
def pdf_to_images(pdf_path, output_folder): images = convert_from_path(pdf_path) # Save each page as an image for i, image in enumerate(images): image_file_path = os.path.join(output_folder, f'{i + 1}page.png') image.save(image_file_path, 'PNG')
I have this code pdf_to_images(path, folder_name) instead of path i am passing base 64 value
- Assistant
- User
0 00000 n \n0000000742 00000 n \ntrailer\n<<\n/Size 8\n/Root 3 0 R\n/Info 1 0 R\n>>\nstartxref\n2677\n%%EOF\n' name 'io' is not defined Internal Server Error: /compre
- Assistant
The error message indicates that Python does not recognize the name
io, which suggests you are trying to use theiomodule without importing it. - User
name 'FileResponse' is not defined
- Assistant