Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

AttributeError in final version of Django Authentication (msg) project when I click on username.

When I try to run the final version (downloaded from teacher's notes) of the msg app in Workspaces, I'm getting an AttributeError (Manager isn't available; 'auth.User' has been swapped for 'accounts.User') when I click on someone's username. There's no error in earlier versions of the project. I've googled the error and read through docs but can't figure out a solution. Anyone have an idea of what's going on?

AttributeError at /posts/by/kennethlove/ Manager isn't available; 'auth.User' has been swapped for 'accounts.User' Request Method: GET Request URL: http://port-8000-7foqfudzp7.treehouse-app.com/posts/by/kennethlove/ Django Version: 1.9.9 Exception Type: AttributeError Exception Value:
Manager isn't available; 'auth.User' has been swapped for 'accounts.User' Exception Location: /usr/local/pyenv/versions/3.5.0/lib/python3.5/site-packages/django/db/models/manager.py in get, line 277 Python Executable: /usr/local/pyenv/versions/3.5.0/bin/python Python Version: 3.5.0 Python Path:
['/home/treehouse/workspace/msg', '/usr/local/pyenv/versions/3.5.0/lib/python35.zip', '/usr/local/pyenv/versions/3.5.0/lib/python3.5', '/usr/local/pyenv/versions/3.5.0/lib/python3.5/plat-linux', '/usr/local/pyenv/versions/3.5.0/lib/python3.5/lib-dynload', '/usr/local/pyenv/versions/3.5.0/lib/python3.5/site-packages'] Server time: Tue, 5 Sep 2017 21:19:43 +0000 Traceback Switch to copy-and-paste view

/usr/local/pyenv/versions/3.5.0/lib/python3.5/site-packages/django/core/handlers/base.py in get_response response = self.process_exception_by_middleware(e, request) ... ▶ Local vars /usr/local/pyenv/versions/3.5.0/lib/python3.5/site-packages/django/core/handlers/base.py in get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) ... ▶ Local vars /usr/local/pyenv/versions/3.5.0/lib/python3.5/site-packages/django/views/generic/base.py in view return self.dispatch(request, *args, **kwargs) ... ▶ Local vars /usr/local/pyenv/versions/3.5.0/lib/python3.5/site-packages/django/views/generic/base.py in dispatch return handler(request, *args, **kwargs) ... ▶ Local vars /usr/local/pyenv/versions/3.5.0/lib/python3.5/site-packages/django/views/generic/list.py in get self.object_list = self.get_queryset() ... ▶ Local vars /home/treehouse/workspace/msg/posts/views.py in get_queryset self.post_user = User.objects.prefetch_related("posts").get( ... ▶ Local vars /usr/local/pyenv/versions/3.5.0/lib/python3.5/site-packages/django/db/models/manager.py in get self.model._meta.swapped, ... ▶ Local vars