File "D:\pythonwork\blog\personBlog\blog\views\index.py", line 25, in get return render(request,'index.html',locals())
According to this line in that error seems to have occurred while rendering. There is at least one "+" operation in "index.html" or "local()" method call. You have to check data types where the "+" operator used. And also according to the error itself, the one of that value is not a string. I think the "ModelBase" model has no '__str__'. Saygılarımla, Sencer HAMARAT On Wed, Jul 1, 2020 at 12:04 PM oba stephen <obasteph...@gmail.com> wrote: > The Error is straight forward, you are using an operand "+" for two two > data types that it can't be used on. This might be from your "volume" > function. > > On Wed, Jul 1, 2020 at 9:30 AM Hella Nick <personh...@gmail.com> wrote: > >> Can someone help me?? >> >> >> My project catalogue: >> >> >> My setttings: >> >> TEMPLATES = [ >> { >> 'BACKEND': 'django.template.backends.django.DjangoTemplates', >> 'DIRS': [os.path.join(BASE_DIR, 'blog/templates/')] >> , >> 'APP_DIRS': True, >> 'OPTIONS': { >> 'context_processors': [ >> 'django.template.context_processors.debug', >> 'django.template.context_processors.request', >> 'django.contrib.auth.context_processors.auth', >> 'django.contrib.messages.context_processors.messages', >> ], >> }, >> }, >> ] >> >> >> My views: >> >> from django.shortcuts import render,HttpResponse >> from django.views.generic import View >> from blog.tool.IPs import volume >> from blog.models import Article >> >> class index(View): >> def get(self,request): >> volume(request) >> >> return render(request,'index.html') >> >> >> Error: >> >> >> Internal Server Error: /blog/index/ >> Traceback (most recent call last): >> File "D:\Python3\lib\site-packages\django\core\handlers\exception.py", >> line 34, in inner >> response = get_response(request) >> File "D:\Python3\lib\site-packages\django\core\handlers\base.py", line >> 126, in _get_response >> response = self.process_exception_by_middleware(e, request) >> File "D:\Python3\lib\site-packages\django\core\handlers\base.py", line >> 124, in _get_response >> response = wrapped_callback(request, *callback_args, >> **callback_kwargs) >> File "D:\Python3\lib\site-packages\django\views\generic\base.py", line >> 68, in view >> return self.dispatch(request, *args, **kwargs) >> File "D:\Python3\lib\site-packages\django\views\generic\base.py", line >> 88, in dispatch >> return handler(request, *args, **kwargs) >> File "D:\pythonwork\blog\personBlog\blog\views\index.py", line 25, in >> get >> return render(request,'index.html',locals()) >> File "D:\Python3\lib\site-packages\django\shortcuts.py", line 36, in >> render >> content = loader.render_to_string(template_name, context, request, >> using=using) >> File "D:\Python3\lib\site-packages\django\template\loader.py", line 62, >> in render_to_string >> return template.render(context, request) >> File "D:\Python3\lib\site-packages\django\template\backends\django.py", >> line 61, in render >> return self.template.render(context) >> File "D:\Python3\lib\site-packages\django\template\base.py", line 171, >> in render >> return self._render(context) >> File "D:\Python3\lib\site-packages\django\template\base.py", line 163, >> in _render >> return self.nodelist.render(context) >> File "D:\Python3\lib\site-packages\django\template\base.py", line 937, >> in render >> bit = node.render_annotated(context) >> File "D:\Python3\lib\site-packages\django\template\base.py", line 904, >> in render_annotated >> return self.render(context) >> File "D:\Python3\lib\site-packages\django\template\defaulttags.py", >> line 442, in render >> url = reverse(view_name, args=args, kwargs=kwargs, >> current_app=current_app) >> File "D:\Python3\lib\site-packages\django\urls\base.py", line 58, in >> reverse >> app_list = resolver.app_dict[ns] >> File "D:\Python3\lib\site-packages\django\urls\resolvers.py", line 477, >> in app_dict >> self._populate() >> File "D:\Python3\lib\site-packages\django\urls\resolvers.py", line 430, >> in _populate >> url_pattern._populate() >> File "D:\Python3\lib\site-packages\django\urls\resolvers.py", line 418, >> in _populate >> self._callback_strs.add(url_pattern.lookup_str) >> File "D:\Python3\lib\site-packages\django\utils\functional.py", line >> 37, in __get__ >> res = instance.__dict__[self.name] = self.func(instance) >> File "D:\Python3\lib\site-packages\django\urls\resolvers.py", line 360, >> in lookup_str >> return callback.__module__ + "." + callback.__qualname__ >> TypeError: unsupported operand type(s) for +: 'ModelBase' and 'str' >> >> >> - >> >> Can someone help me?? >> >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-users+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/840576c0-ef86-46ea-b35c-8a3708f7460bo%40googlegroups.com >> <https://groups.google.com/d/msgid/django-users/840576c0-ef86-46ea-b35c-8a3708f7460bo%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CAAJsLnpG8ZBN_15wTd9eb9S3MxZrA22w0BscZdVQQ6tkzaF4EQ%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CAAJsLnpG8ZBN_15wTd9eb9S3MxZrA22w0BscZdVQQ6tkzaF4EQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACp8TZhouVJF-zzJhhRGYRimrdsPG_7WvEzcTFuOKoXuR3N0%2Bg%40mail.gmail.com.