AttributeError at /posts/create/
'NoneType' object has no attribute 'id'
Request Method: POST
Request URL: http://127.0.0.1/posts/create/
Django Version: 1.11.3
Exception Type: AttributeError
Exception Value:
'NoneType' object has no attribute 'id'
Exception Location: C:\Users\Ahmed Kakar\Desktop\sublime\django\referenceCodes\src\posts\models.py in upload_location, line 37
Python Executable: C:\Users\AHMEDK1\Desktop\sublime\django\REFERE1\Scripts\python.exe
Python Version: 3.6.1
Python Path:
['C:\Users\Ahmed Kakar\Desktop\sublime\django\referenceCodes\src',
'C:\Users\AHMEDK1\Desktop\sublime\django\REFERE1\Scripts\python36.zip',
'C:\Users\AHMEDK1\Desktop\sublime\django\REFERE1\DLLs',
'C:\Users\AHMEDK1\Desktop\sublime\django\REFERE1\lib',
'C:\Users\AHMEDK1\Desktop\sublime\django\REFERE1\Scripts',
'c:\program files\python36\Lib',
'c:\program files\python36\DLLs',
'C:\Users\AHMEDK1\Desktop\sublime\django\REFERE1',
'C:\Users\AHMEDK1\Desktop\sublime\django\REFERE1\lib\site-packages']
Server time: Tue, 25 Jul 2017 22:33:00 +0000