Where a are you importing "redirect" from?
On Nov 23, 2017 1:21 PM, "Tom Tanner" <[email protected]> wrote:
> I believe it's `redirect()`. When I replace `home_slug()` with `'/'`, I
> get the same error.
>
> Full trace...
>
> Internal Server Error: /register/
> Traceback (most recent call last):
> File "/home/myLinuxUsername/project/local/lib/python2.7/
> site-packages/django/core/handlers/exception.py", line 42, in inner
> response = get_response(request)
> File "/home/myLinuxUsername/project/local/lib/python2.7/
> site-packages/django/core/handlers/base.py", line 249, in
> _legacy_get_response
> response = self._get_response(request)
> File "/home/myLinuxUsername/project/local/lib/python2.7/
> site-packages/django/core/handlers/base.py", line 187, in _get_response
> response = self.process_exception_by_middleware(e, request)
> File "/home/myLinuxUsername/project/local/lib/python2.7/
> site-packages/django/core/handlers/base.py", line 185, in _get_response
> response = wrapped_callback(request, *callback_args, **callback_kwargs
> )
> File "/home/myLinuxUsername/project/product_blog/theme/views.py", line
> 48, in register
> return redirect('/')
> TypeError: 'str' object is not callable
>
>
>
> On Wednesday, November 22, 2017 at 11:50:04 PM UTC-5, Eduardo Rivas wrote:
>>
>> Can you show us what function is raising the exception? Is it home_slug,
>> or redirect? What happens if you use: return redirect("/") ?
>>
>> On 2017-11-22 7:59 PM, Tom Tanner wrote:
>>
>> In one of my views, I have this:
>>
>> from mezzanine.utils.urls import home_slug
>>
>> def myView(request):
>> # Some code...
>> return redirect(home_slug())
>>
>>
>> This gives me the error: `TypeError: 'str' object is not callable`. Am I
>> supposed to use `home_slug()` to redirect to home page in this case? If
>> not, how else do I redirect to the home page? I have not touched/edited the
>> urlpattern for the default home page in `urls.py`.
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.