Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ValueError at /post/new/
- Cannot assign "<SimpleLazyObject: <django.contrib.auth.models.AnonymousUser object at 0x03D807F0>>": "Post.author" must be a "User" instance.
- Request Method: POST
- Request URL: http://localhost:8000/post/new/
- Django Version: 1.9.8
- Exception Type: ValueError
- Exception Value:
- Cannot assign "<SimpleLazyObject: <django.contrib.auth.models.AnonymousUser object at 0x03D807F0>>": "Post.author" must be a "User" instance.
- Exception Location: C:\Users\jalal\myvenv\lib\site-packages\django\db\models\fields\related_descriptors.py in __set__, line 207
- Python Executable: C:\Users\jalal\myvenv\Scripts\python.exe
- Python Version: 3.4.2
- Python Path:
- ['C:\\Users\\jalal\\monadjango',
- 'C:\\WINDOWS\\system32\\python34.zip',
- 'C:\\Python34\\DLLs',
- 'C:\\Python34\\lib',
- 'C:\\Python34',
- 'C:\\Users\\jalal\\myvenv',
- 'C:\\Users\\jalal\\myvenv\\lib\\site-packages']
- Server time: Mon, 18 Jul 2016 19:35:15 -0500
- Traceback Switch to copy-and-paste view
- C:\Users\jalal\myvenv\lib\site-packages\django\core\handlers\base.py in get_response
- response = self.process_exception_by_middleware(e, request) ...
- ▶ Local vars
- C:\Users\jalal\myvenv\lib\site-packages\django\core\handlers\base.py in get_response
- response = wrapped_callback(request, *callback_args, **callback_kwargs) ...
- ▶ Local vars
- C:\Users\jalal\monadjango\blog\views.py in post_new
- post.author = request.user ...
- ▶ Local vars
- C:\Users\jalal\myvenv\lib\site-packages\django\db\models\fields\related_descriptors.py in __set__
- self.field.remote_field.model._meta.object_name, ...
- ▶ Local vars
Advertisement
Add Comment
Please, Sign In to add comment