인프런 커뮤니티 질문&답변

최성욱님의 프로필 이미지
최성욱

작성한 질문수

파이썬/장고 웹서비스 개발 완벽 가이드 with 리액트

Serializer를 통한 유효성 검사 및 저장

HTTPie post 요청시 질문이 있습니다!

작성

·

153

0

강의와 같이 perform_create 함수를 구성하였을때 웹으로 post 요청을 보냈을때에는 데이터가 생성이 되었는데, httpie를 통한 post 요청시에는 아래와 같은 html 응답이 넘어오면서 에러가 났습니다. 혹시 이 문제의 원인이 무엇인지 알 수 있을까요?? 밑에 설명 문구에 DEBUG=True이기 때문에 해당 에러가 발생했다고 하여 False로 바꾸어 보았지만 해결이 되지 않았습니다. 그리고 post를 제외한 다른 요청들은 모두 정삭적으로 응답이 옵니다.

                   <tr> <td>self</td> <td class="code"><pre>&lt;django.db.models.fields.related_descriptors.ForwardManyToOneDescri ptor object at 0x0000012F717A5670&gt;</pre></td> </tr> <tr> <td>value</td> <td class="code"><pre>&lt;django.contrib.auth.models.AnonymousUser object at 0x0000012F7293A 190&gt;</pre></td> </tr> </tbody> </table> </details> </li> </ul> </div> <form action="https://dpaste.com/" name="pasteform" id="pasteform" method="post"> <div id="pastebinTraceback" class="pastebin"> <input type="hidden" name="language" value="PythonConsole"> <input type="hidden" name="title" value="ValueError at /ukstagram/posts/"> <input type="hidden" name="source" value="Django Dpaste Agent"> <input type="hidden" name="poster" value="Django"> <textarea name="content" id="traceback_area" cols="140" rows="25"> Environment: Request Method: POST Request URL: http://localhost:8000/ukstagram/posts/ Django Version: 4.0.4 Python Version: 3.8.12 Installed Applications: [&#x27;django.contrib.admin&#x27;, &#x27;django.contrib.auth&#x27;, &#x27;django.contrib.contenttypes&#x27;, &#x27;django.contrib.sessions&#x27;, &#x27;django.contrib.messages&#x27;, &#x27;django.contrib.staticfiles&#x27;, &#x27;rest_framework&#x27;, &#x27;ukstagram&#x27;] Installed Middleware: [&#x27;django.middleware.security.SecurityMiddleware&#x27;, &#x27;django.contrib.sessions.middleware.SessionMiddleware&#x27;, &#x27;django.middleware.common.CommonMiddleware&#x27;, &#x27;django.middleware.csrf.CsrfViewMiddleware&#x27;, &#x27;django.contrib.auth.middleware.AuthenticationMiddleware&#x27;, &#x27;django.contrib.messages.middleware.MessageMiddleware&#x27;, &#x27;django.middleware.clickjacking.XFrameOptionsMiddleware&#x27;] Traceback (most recent call last): File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\django\core\handlers\exception.py", line 55, in inner response = get_response(request) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\django\core\handlers\base.py", line 197, in _get_respon se response = wrapped_callback(request, *callback_args, **callback_kwargs) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\django\views\decorators\csrf.py", line 54, in wrapped_v iew return view_func(*args, **kwargs) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\rest_framework\viewsets.py", line 125, in view return self.dispatch(request, *args, **kwargs) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\rest_framework\views.py", line 509, in dispatch response = self.handle_exception(exc) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\rest_framework\views.py", line 469, in handle_exception self.raise_uncaught_exception(exc) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\rest_framework\views.py", line 480, in raise_uncaught_e xception raise exc File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\rest_framework\views.py", line 506, in dispatch response = handler(request, *args, **kwargs) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\rest_framework\mixins.py", line 19, in create self.perform_create(serializer) File "C:\Users\cswoo\OneDrive\Documents\DRF\ukstagram\views.py", line 46, in perform_create serializer.save(author=self.request.user) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\rest_framework\serializers.py", line 212, in save self.instance = self.create(validated_data) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\rest_framework\serializers.py", line 962, in create instance = ModelClass._default_manager.create(**validated_data) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\django\db\models\manager.py", line 85, in manager_metho d return getattr(self.get_queryset(), name)(*args, **kwargs) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\django\db\models\query.py", line 512, in create obj = self.model(**kwargs) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\django\db\models\base.py", line 541, in __init__ _setattr(self, field.name, rel_obj) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\django\db\models\fields\related_descriptors.py", line 2 35, in __set__ raise ValueError( Exception Type: ValueError at /ukstagram/posts/ Exception Value: Cannot assign &quot;&lt;django.contrib.auth.models.AnonymousUser object at 0x0000012F7293A190&g t;&quot;: &quot;Post.author&quot; must be a &quot;User&quot; instance. </textarea> <br><br> <input type="submit" value="Share this traceback on a public website"> </div> </form> </div> <div id="requestinfo"> <h2>Request information</h2> <h3 id="user-info">USER</h3> <p>AnonymousUser</p> <h3 id="get-info">GET</h3> <p>No GET data</p> <h3 id="post-info">POST</h3> <p>No POST data</p> <h3 id="files-info">FILES</h3> <p>No FILES data</p> <h3 id="cookie-info">COOKIES</h3> <p>No cookie data</p> <h3 id="meta-info">META</h3> <table class="req"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>ALLUSERSPROFILE</td> <td class="code"><pre>&#x27;C:\\ProgramData&#x27;</pre></td> </tr> <tr> <td>APPDATA</td> <td class="code"><pre>&#x27;C:\\Users\\cswoo\\AppData\\Roaming&#x27;</pre></td> </tr> <tr> <td>CLSID</td> <td class="code"><pre>&#x27;{290BFAA9-A9FC-AD78-7B4F-4803F0742CCA}&#x27;</pre></td> </tr> <tr> <td>COMMONPROGRAMFILES</td> <td class="code"><pre>&#x27;C:\\Program Files\\Common Files&#x27;</pre></td> </tr> <tr> <td>COMMONPROGRAMFILES(X86)</td> <td class="code"><pre>&#x27;C:\\Program Files (x86)\\Common Files&#x27;</pre></td> </tr> <tr> <td>COMMONPROGRAMW6432</td> <td class="code"><pre>&#x27;C:\\Program Files\\Common Files&#x27;</pre></td> </tr> <tr> <td>COMPUTERNAME</td> <td class="code"><pre>&#x27;DESKTOP-9D39MMH&#x27;</pre></td> </tr> <tr> <td>COMSPEC</td> <td class="code"><pre>&#x27;C:\\WINDOWS\\system32\\cmd.exe&#x27;</pre></td> </tr> <tr> <td>CONDA_DEFAULT_ENV</td> <td class="code"><pre>&#x27;drf&#x27;</pre></td> </tr> <tr> <td>CONDA_PREFIX</td> <td class="code"><pre>&#x27;C:\\Users\\cswoo\\.conda\\envs\\drf&#x27;</pre></td> </tr> <tr> <td>CONDA_PROMPT_MODIFIER</td> <td class="code"><pre>&#x27;(drf) &#x27;</pre></td> </tr> <tr> <td>CONDA_SHLVL</td> <td class="code"><pre>&#x27;1&#x27;</pre></td> </tr> <tr> <td>CONTENT_LENGTH</td> <td class="code"><pre>&#x27;45&#x27;</pre></td> </tr> <tr> <td>CONTENT_TYPE</td> <td class="code"><pre>&#x27;application/json&#x27;</pre></td> </tr> <tr> <td>DJANGO_SETTINGS_MODULE</td> <td class="code"><pre>&#x27;DRF.settings&#x27;</pre></td> </tr> <tr> <td>DRIVERDATA</td> <td class="code"><pre>&#x27;C:\\Windows\\System32\\Drivers\\DriverData&#x27;</pre></td> </tr> <tr> <td>FPS_BROWSER_APP_PROFILE_STRING</td> <td class="code"><pre>&#x27;Internet Explorer&#x27;</pre></td> </tr> <tr> <td>FPS_BROWSER_USER_PROFILE_STRING</td> <td class="code"><pre>&#x27;Default&#x27;</pre></td> </tr> <tr> <td>GATEWAY_INTERFACE</td> <td class="code"><pre>&#x27;CGI/1.1&#x27;</pre></td> </tr> <tr> <td>GOOGLE_API_KEY</td> <td class="code"><pre>&#x27;********************&#x27;</pre></td> </tr> <tr> <td>GOOGLE_DEFAULT_CLIENT_ID</td> <td class="code"><pre>&#x27;no&#x27;</pre></td> </tr> <tr> <td>GOOGLE_DEFAULT_CLIENT_SECRET</td> <td class="code"><pre>&#x27;********************&#x27;</pre></td> </tr> <tr> <td>HOMEDRIVE</td> <td class="code"><pre>&#x27;C:&#x27;</pre></td> </tr> <tr> <td>HOMEPATH</td> <td class="code"><pre>&#x27;\\Users\\cswoo&#x27;</pre></td> </tr> <tr> <td>HTTP_ACCEPT</td> <td class="code"><pre>&#x27;application/json, */*;q=0.5&#x27;</pre></td> </tr> <tr> <td>HTTP_ACCEPT_ENCODING</td> <td class="code"><pre>&#x27;gzip, deflate&#x27;</pre></td> </tr> <tr> <td>HTTP_CONNECTION</td> <td class="code"><pre>&#x27;keep-alive&#x27;</pre></td> </tr> <tr> <td>HTTP_HOST</td> <td class="code"><pre>&#x27;localhost:8000&#x27;</pre></td> </tr> <tr> <td>HTTP_USER_AGENT</td> <td class="code"><pre>&#x27;HTTPie/3.1.0&#x27;</pre></td> </tr> <tr> <td>IDEA_INITIAL_DIRECTORY</td> <td class="code"><pre>&#x27;C:\\Users\\cswoo\\OneDrive\\Documents&#x27;</pre></td> </tr> <tr> <td>LOCALAPPDATA</td> <td class="code"><pre>&#x27;C:\\Users\\cswoo\\AppData\\Local&#x27;</pre></td> </tr> <tr> <td>LOGONSERVER</td> <td class="code"><pre>&#x27;\\\\DESKTOP-9D39MMH&#x27;</pre></td> </tr> <tr> <td>NUMBER_OF_PROCESSORS</td> <td class="code"><pre>&#x27;6&#x27;</pre></td> </tr> <tr> <td>ONEDRIVE</td> <td class="code"><pre>&#x27;C:\\Users\\cswoo\\OneDrive&#x27;</pre></td> </tr> <tr> <td>ONEDRIVECONSUMER</td> <td class="code"><pre>&#x27;C:\\Users\\cswoo\\OneDrive&#x27;</pre></td> </tr> <tr> <td>OS</td> <td class="code"><pre>&#x27;Windows_NT&#x27;</pre></td> </tr> <tr> <td>PATH</td> <td class="code"><pre>(&#x27;C:\\Users\\cswoo\\.conda\\envs\\drf;C:\\Users\\cswoo\\.conda\\envs\\drf\\ Library\\mingw-w64\\bin;C:\\Users\\cswoo\\.conda\\envs\\drf\\Library\\usr\\bin;C:\\Users\\cswoo\\.conda\\envs\\d rf\\Library\\bin;C:\\Users\\cswoo\\.conda\\envs\\drf\\Scripts;C:\\Users\\cswoo\\.conda\\envs\\drf\\bin;C:\\Progr amData\\Anaconda3\\condabin;C:\\ProgramData\\Anaconda3;C:\\ProgramData\\Anaconda3\\Library\\mingw-w64\\bin;C:\\P rogramData\\Anaconda3\\Library\\usr\\bin;C:\\ProgramData\\Anaconda3\\Library\\bin;C:\\ProgramData\\Anaconda3\\Sc ripts;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1 .0;C:\\WINDOWS\\System32\\OpenSSH;C:\\Program &#x27; &#x27;Files\\Git\\cmd;C:\\Users\\cswoo\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\cswoo\\AppData\\Local \\Microsoft\\WindowsApps;C:\\Program &#x27; &#x27;Files\\JetBrains\\PyCharm Community Edition &#x27; &#x27;2021.2.2\\bin;.;C:\\Users\\cswoo\\AppData\\Local\\afreeca;C:\\Users\\cswoo\\AppData\\Local\\Programs\\Mic rosoft &#x27; &#x27;VS Code\\bin;C:\\Program Files\\JetBrains\\PyCharm 2021.3.3\\bin;.&#x27;)</pre></td> </tr> <tr> <td>PATHEXT</td> <td class="code"><pre>&#x27;.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC&#x27;</pre></td> </tr> <tr> <td>PATH_INFO</td> <td class="code"><pre>&#x27;/ukstagram/posts/&#x27;</pre></td> </tr> <tr> <td>PROCESSOR_ARCHITECTURE</td> <td class="code"><pre>&#x27;AMD64&#x27;</pre></td> </tr> <tr> <td>PROCESSOR_IDENTIFIER</td> <td class="code"><pre>&#x27;Intel64 Family 6 Model 158 Stepping 10, GenuineIntel&#x27;</pre></td> </tr> <tr> <td>PROCESSOR_LEVEL</td> <td class="code"><pre>&#x27;6&#x27;</pre></td> </tr> <tr> <td>PROCESSOR_REVISION</td> <td class="code"><pre>&#x27;9e0a&#x27;</pre></td> </tr> <tr> <td>PROGRAMDATA</td> <td class="code"><pre>&#x27;C:\\ProgramData&#x27;</pre></td> </tr> <tr> <td>PROGRAMFILES</td> <td class="code"><pre>&#x27;C:\\Program Files&#x27;</pre></td> </tr> <tr> <td>PROGRAMFILES(X86)</td> <td class="code"><pre>&#x27;C:\\Program Files (x86)&#x27;</pre></td> </tr> <tr> <td>PROGRAMW6432</td> <td class="code"><pre>&#x27;C:\\Program Files&#x27;</pre></td> </tr> <tr> <td>PROMPT</td> <td class="code"><pre>&#x27;(drf) $P$G&#x27;</pre></td> </tr> <tr> <td>PSMODULEPATH</td> <td class="code"><pre>(&#x27;C:\\Program &#x27; &#x27;Files\\WindowsPowerShell\\Modules;C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules&#x27;)</pre></t d> </tr> <tr> <td>PUBLIC</td> <td class="code"><pre>&#x27;C:\\Users\\Public&#x27;</pre></td> </tr> <tr> <td>PYCHARM</td> <td class="code"><pre>&#x27;C:\\Program Files\\JetBrains\\PyCharm 2021.3.3\\bin;&#x27;</pre></td> </tr> <tr> <td>PYCHARM COMMUNITY EDITION</td> <td class="code"><pre>&#x27;C:\\Program Files\\JetBrains\\PyCharm Community Edition 2021.2.2\\bin;&#x2 7;</pre></td> </tr> <tr> <td>PYTHONIOENCODING</td> <td class="code"><pre>&#x27;utf-8&#x27;</pre></td> </tr> <tr> <td>QUERY_STRING</td> <td class="code"><pre>&#x27;&#x27;</pre></td> </tr> <tr> <td>REMOTE_ADDR</td> <td class="code"><pre>&#x27;127.0.0.1&#x27;</pre></td> </tr> <tr> <td>REMOTE_HOST</td> <td class="code"><pre>&#x27;&#x27;</pre></td> </tr> <tr> <td>REQUEST_METHOD</td> <td class="code"><pre>&#x27;POST&#x27;</pre></td> </tr> <tr> <td>RUN_MAIN</td> <td class="code"><pre>&#x27;true&#x27;</pre></td> </tr> <tr> <td>SCRIPT_NAME</td> <td class="code"><pre>&#x27;&#x27;</pre></td> </tr> <tr> <td>SERVER_NAME</td> <td class="code"><pre>&#x27;DESKTOP-9D39MMH&#x27;</pre></td> </tr> <tr> <td>SERVER_PORT</td> <td class="code"><pre>&#x27;8000&#x27;</pre></td> </tr> <tr> <td>SERVER_PROTOCOL</td> <td class="code"><pre>&#x27;HTTP/1.1&#x27;</pre></td> </tr> <tr> <td>SERVER_SOFTWARE</td> <td class="code"><pre>&#x27;WSGIServer/0.2&#x27;</pre></td> </tr> <tr> <td>SESSIONNAME</td> <td class="code"><pre>&#x27;Console&#x27;</pre></td> </tr> <tr> <td>SYSTEMDRIVE</td> <td class="code"><pre>&#x27;C:&#x27;</pre></td> </tr> <tr> <td>SYSTEMROOT</td> <td class="code"><pre>&#x27;C:\\WINDOWS&#x27;</pre></td> </tr> <tr> <td>TEMP</td> <td class="code"><pre>&#x27;C:\\Users\\cswoo\\AppData\\Local\\Temp&#x27;</pre></td> </tr> <tr> <td>TERMINAL_EMULATOR</td> <td class="code"><pre>&#x27;JetBrains-JediTerm&#x27;</pre></td> </tr> <tr> <td>TERM_SESSION_ID</td> <td class="code"><pre>&#x27;8e1c69ed-565b-4df9-abcb-4027930ba073&#x27;</pre></td> </tr> <tr> <td>TMP</td> <td class="code"><pre>&#x27;C:\\Users\\cswoo\\AppData\\Local\\Temp&#x27;</pre></td> </tr> <tr> <td>USERDOMAIN</td> <td class="code"><pre>&#x27;DESKTOP-9D39MMH&#x27;</pre></td> </tr> <tr> <td>USERDOMAIN_ROAMINGPROFILE</td> <td class="code"><pre>&#x27;DESKTOP-9D39MMH&#x27;</pre></td> </tr> <tr> <td>USERNAME</td> <td class="code"><pre>&#x27;cswoo&#x27;</pre></td> </tr> <tr> <td>USERPROFILE</td> <td class="code"><pre>&#x27;C:\\Users\\cswoo&#x27;</pre></td> </tr> <tr> <td>WINDIR</td> <td class="code"><pre>&#x27;C:\\WINDOWS&#x27;</pre></td> </tr> <tr> <td>__INTELLIJ_COMMAND_HISTFILE__</td> <td class="code"><pre>&#x27;C:\\Users\\cswoo\\AppData\\Local\\JetBrains\\PyCharm2021.3\\terminal\\hist ory\\DRF-history&#x27;</pre></td> </tr> <tr> <td>wsgi.errors</td> <td class="code"><pre>&lt;colorama.ansitowin32.StreamWrapper object at 0x0000012F70805610&gt;</pre></t d> </tr> <tr> <td>wsgi.file_wrapper</td> <td class="code"><pre>&lt;class &#x27;wsgiref.util.FileWrapper&#x27;&gt;</pre></td> </tr> <tr> <td>wsgi.input</td> <td class="code"><pre>&lt;django.core.handlers.wsgi.LimitedStream object at 0x0000012F72D67E50&gt;</pr e></td> </tr> <tr> <td>wsgi.multiprocess</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>wsgi.multithread</td> <td class="code"><pre>True</pre></td> </tr> <tr> <td>wsgi.run_once</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>wsgi.url_scheme</td> <td class="code"><pre>&#x27;http&#x27;</pre></td> </tr> <tr> <td>wsgi.version</td> <td class="code"><pre>(1, 0)</pre></td> </tr> </tbody> </table> <h3 id="settings-info">Settings</h3> <h4>Using settings module <code>DRF.settings</code></h4> <table class="req"> <thead> <tr> <th>Setting</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>ABSOLUTE_URL_OVERRIDES</td> <td class="code"><pre>{}</pre></td> </tr> <tr> <td>ADMINS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>ALLOWED_HOSTS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>APPEND_SLASH</td> <td class="code"><pre>True</pre></td> </tr> <tr> <td>AUTHENTICATION_BACKENDS</td> <td class="code"><pre>[&#x27;django.contrib.auth.backends.ModelBackend&#x27;]</pre></td> </tr> <tr> <td>AUTH_PASSWORD_VALIDATORS</td> <td class="code"><pre>&#x27;********************&#x27;</pre></td> </tr> <tr> <td>AUTH_USER_MODEL</td> <td class="code"><pre>&#x27;auth.User&#x27;</pre></td> </tr> <tr> <td>BASE_DIR</td> <td class="code"><pre>WindowsPath(&#x27;C:/Users/cswoo/OneDrive/Documents/DRF&#x27;)</pre></td> </tr> <tr> <td>CACHES</td> <td class="code"><pre>{&#x27;default&#x27;: {&#x27;BACKEND&#x27;: &#x27;django.core.cache.backends.loc mem.LocMemCache&#x27;}}</pre></td> </tr> <tr> <td>CACHE_MIDDLEWARE_ALIAS</td> <td class="code"><pre>&#x27;default&#x27;</pre></td> </tr> <tr> <td>CACHE_MIDDLEWARE_KEY_PREFIX</td> <td class="code"><pre>&#x27;********************&#x27;</pre></td> </tr> <tr> <td>CACHE_MIDDLEWARE_SECONDS</td> <td class="code"><pre>600</pre></td> </tr> <tr> <td>CSRF_COOKIE_AGE</td> <td class="code"><pre>31449600</pre></td> </tr> <tr> <td>CSRF_COOKIE_DOMAIN</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>CSRF_COOKIE_HTTPONLY</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>CSRF_COOKIE_NAME</td> <td class="code"><pre>&#x27;csrftoken&#x27;</pre></td> </tr> <tr> <td>CSRF_COOKIE_PATH</td> <td class="code"><pre>&#x27;/&#x27;</pre></td> </tr> <tr> <td>CSRF_COOKIE_SAMESITE</td> <td class="code"><pre>&#x27;Lax&#x27;</pre></td> </tr> <tr> <td>CSRF_COOKIE_SECURE</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>CSRF_FAILURE_VIEW</td> <td class="code"><pre>&#x27;django.views.csrf.csrf_failure&#x27;</pre></td> </tr> <tr> <td>CSRF_HEADER_NAME</td> <td class="code"><pre>&#x27;HTTP_X_CSRFTOKEN&#x27;</pre></td> </tr> <tr> <td>CSRF_TRUSTED_ORIGINS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>CSRF_USE_SESSIONS</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>DATABASES</td> <td class="code"><pre>{&#x27;default&#x27;: {&#x27;ATOMIC_REQUESTS&#x27;: False, &#x27;AUTOCOMMIT&#x27;: True, &#x27;CONN_MAX_AGE&#x27;: 0, &#x27;ENGINE&#x27;: &#x27;django.db.backends.sqlite3&#x27;, &#x27;HOST&#x27;: &#x27;&#x27;, &#x27;NAME&#x27;: WindowsPath(&#x27;C:/Users/cswoo/OneDrive/Documents/DRF/db.sqlite3&#x27;), &#x27;OPTIONS&#x27;: {}, &#x27;PASSWORD&#x27;: &#x27;********************&#x27;, &#x27;PORT&#x27;: &#x27;&#x27;, &#x27;TEST&#x27;: {&#x27;CHARSET&#x27;: None, &#x27;COLLATION&#x27;: None, &#x27;MIGRATE&#x27;: True, &#x27;MIRROR&#x27;: None, &#x27;NAME&#x27;: None}, &#x27;TIME_ZONE&#x27;: None, &#x27;USER&#x27;: &#x27;&#x27;}}</pre></td> </tr> <tr> <td>DATABASE_ROUTERS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>DATA_UPLOAD_MAX_MEMORY_SIZE</td> <td class="code"><pre>2621440</pre></td> </tr> <tr> <td>DATA_UPLOAD_MAX_NUMBER_FIELDS</td> <td class="code"><pre>1000</pre></td> </tr> <tr> <td>DATETIME_FORMAT</td> <td class="code"><pre>&#x27;N j, Y, P&#x27;</pre></td> </tr> <tr> <td>DATETIME_INPUT_FORMATS</td> <td class="code"><pre>[&#x27;%Y-%m-%d %H:%M:%S&#x27;, &#x27;%Y-%m-%d %H:%M:%S.%f&#x27;, &#x27;%Y-%m-%d %H:%M&#x27;, &#x27;%m/%d/%Y %H:%M:%S&#x27;, &#x27;%m/%d/%Y %H:%M:%S.%f&#x27;, &#x27;%m/%d/%Y %H:%M&#x27;, &#x27;%m/%d/%y %H:%M:%S&#x27;, &#x27;%m/%d/%y %H:%M:%S.%f&#x27;, &#x27;%m/%d/%y %H:%M&#x27;]</pre></td> </tr> <tr> <td>DATE_FORMAT</td> <td class="code"><pre>&#x27;N j, Y&#x27;</pre></td> </tr> <tr> <td>DATE_INPUT_FORMATS</td> <td class="code"><pre>[&#x27;%Y-%m-%d&#x27;, &#x27;%m/%d/%Y&#x27;, &#x27;%m/%d/%y&#x27;, &#x27;%b %d %Y&#x27;, &#x27;%b %d, %Y&#x27;, &#x27;%d %b %Y&#x27;, &#x27;%d %b, %Y&#x27;, &#x27;%B %d %Y&#x27;, &#x27;%B %d, %Y&#x27;, &#x27;%d %B %Y&#x27;, &#x27;%d %B, %Y&#x27;]</pre></td> </tr> <tr> <td>DEBUG</td> <td class="code"><pre>True</pre></td> </tr> <tr> <td>DEBUG_PROPAGATE_EXCEPTIONS</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>DECIMAL_SEPARATOR</td> <td class="code"><pre>&#x27;.&#x27;</pre></td> </tr> <tr> <td>DEFAULT_AUTO_FIELD</td> <td class="code"><pre>&#x27;django.db.models.BigAutoField&#x27;</pre></td> </tr> <tr> <td>DEFAULT_CHARSET</td> <td class="code"><pre>&#x27;utf-8&#x27;</pre></td> </tr> <tr> <td>DEFAULT_EXCEPTION_REPORTER</td> <td class="code"><pre>&#x27;django.views.debug.ExceptionReporter&#x27;</pre></td> </tr> <tr> <td>DEFAULT_EXCEPTION_REPORTER_FILTER</td> <td class="code"><pre>&#x27;django.views.debug.SafeExceptionReporterFilter&#x27;</pre></td> </tr> <tr> <td>DEFAULT_FILE_STORAGE</td> <td class="code"><pre>&#x27;django.core.files.storage.FileSystemStorage&#x27;</pre></td> </tr> <tr> <td>DEFAULT_FROM_EMAIL</td> <td class="code"><pre>&#x27;webmaster@localhost&#x27;</pre></td> </tr> <tr> <td>DEFAULT_INDEX_TABLESPACE</td> <td class="code"><pre>&#x27;&#x27;</pre></td> </tr> <tr> <td>DEFAULT_TABLESPACE</td> <td class="code"><pre>&#x27;&#x27;</pre></td> </tr> <tr> <td>DISALLOWED_USER_AGENTS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>EMAIL_BACKEND</td> <td class="code"><pre>&#x27;django.core.mail.backends.smtp.EmailBackend&#x27;</pre></td> </tr> <tr> <td>EMAIL_HOST</td> <td class="code"><pre>&#x27;localhost&#x27;</pre></td> </tr> <tr> <td>EMAIL_HOST_PASSWORD</td> <td class="code"><pre>&#x27;********************&#x27;</pre></td> </tr> <tr> <td>EMAIL_HOST_USER</td> <td class="code"><pre>&#x27;&#x27;</pre></td> </tr> <tr> <td>EMAIL_PORT</td> <td class="code"><pre>25</pre></td> </tr> <tr> <td>EMAIL_SSL_CERTFILE</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>EMAIL_SSL_KEYFILE</td> <td class="code"><pre>&#x27;********************&#x27;</pre></td> </tr> <tr> <td>EMAIL_SUBJECT_PREFIX</td> <td class="code"><pre>&#x27;[Django] &#x27;</pre></td> </tr> <tr> <td>EMAIL_TIMEOUT</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>EMAIL_USE_LOCALTIME</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>EMAIL_USE_SSL</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>EMAIL_USE_TLS</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>FILE_UPLOAD_DIRECTORY_PERMISSIONS</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>FILE_UPLOAD_HANDLERS</td> <td class="code"><pre>[&#x27;django.core.files.uploadhandler.MemoryFileUploadHandler&#x27;, &#x27;django.core.files.uploadhandler.TemporaryFileUploadHandler&#x27;]</pre></td> </tr> <tr> <td>FILE_UPLOAD_MAX_MEMORY_SIZE</td> <td class="code"><pre>2621440</pre></td> </tr> <tr> <td>FILE_UPLOAD_PERMISSIONS</td> <td class="code"><pre>420</pre></td> </tr> <tr> <td>FILE_UPLOAD_TEMP_DIR</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>FIRST_DAY_OF_WEEK</td> <td class="code"><pre>0</pre></td> </tr> <tr> <td>FIXTURE_DIRS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>FORCE_SCRIPT_NAME</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>FORMAT_MODULE_PATH</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>FORM_RENDERER</td> <td class="code"><pre>&#x27;django.forms.renderers.DjangoTemplates&#x27;</pre></td> </tr> <tr> <td>IGNORABLE_404_URLS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>INSTALLED_APPS</td> <td class="code"><pre>[&#x27;django.contrib.admin&#x27;, &#x27;django.contrib.auth&#x27;, &#x27;django.contrib.contenttypes&#x27;, &#x27;django.contrib.sessions&#x27;, &#x27;django.contrib.messages&#x27;, &#x27;django.contrib.staticfiles&#x27;, &#x27;rest_framework&#x27;, &#x27;ukstagram&#x27;]</pre></td> </tr> <tr> <td>INTERNAL_IPS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>LANGUAGES</td> <td class="code"><pre>[(&#x27;af&#x27;, &#x27;Afrikaans&#x27;), (&#x27;ar&#x27;, &#x27;Arabic&#x27;), (&#x27;ar-dz&#x27;, &#x27;Algerian Arabic&#x27;), (&#x27;ast&#x27;, &#x27;Asturian&#x27;), (&#x27;az&#x27;, &#x27;Azerbaijani&#x27;), (&#x27;bg&#x27;, &#x27;Bulgarian&#x27;), (&#x27;be&#x27;, &#x27;Belarusian&#x27;), (&#x27;bn&#x27;, &#x27;Bengali&#x27;), (&#x27;br&#x27;, &#x27;Breton&#x27;), (&#x27;bs&#x27;, &#x27;Bosnian&#x27;), (&#x27;ca&#x27;, &#x27;Catalan&#x27;), (&#x27;cs&#x27;, &#x27;Czech&#x27;), (&#x27;cy&#x27;, &#x27;Welsh&#x27;), (&#x27;da&#x27;, &#x27;Danish&#x27;), (&#x27;de&#x27;, &#x27;German&#x27;), (&#x27;dsb&#x27;, &#x27;Lower Sorbian&#x27;), (&#x27;el&#x27;, &#x27;Greek&#x27;), (&#x27;en&#x27;, &#x27;English&#x27;), (&#x27;en-au&#x27;, &#x27;Australian English&#x27;), (&#x27;en-gb&#x27;, &#x27;British English&#x27;), (&#x27;eo&#x27;, &#x27;Esperanto&#x27;), (&#x27;es&#x27;, &#x27;Spanish&#x27;), (&#x27;es-ar&#x27;, &#x27;Argentinian Spanish&#x27;), (&#x27;es-co&#x27;, &#x27;Colombian Spanish&#x27;), (&#x27;es-mx&#x27;, &#x27;Mexican Spanish&#x27;), (&#x27;es-ni&#x27;, &#x27;Nicaraguan Spanish&#x27;), (&#x27;es-ve&#x27;, &#x27;Venezuelan Spanish&#x27;), (&#x27;et&#x27;, &#x27;Estonian&#x27;), (&#x27;eu&#x27;, &#x27;Basque&#x27;), (&#x27;fa&#x27;, &#x27;Persian&#x27;), (&#x27;fi&#x27;, &#x27;Finnish&#x27;), (&#x27;fr&#x27;, &#x27;French&#x27;), (&#x27;fy&#x27;, &#x27;Frisian&#x27;), (&#x27;ga&#x27;, &#x27;Irish&#x27;), (&#x27;gd&#x27;, &#x27;Scottish Gaelic&#x27;), (&#x27;gl&#x27;, &#x27;Galician&#x27;), (&#x27;he&#x27;, &#x27;Hebrew&#x27;), (&#x27;hi&#x27;, &#x27;Hindi&#x27;), (&#x27;hr&#x27;, &#x27;Croatian&#x27;), (&#x27;hsb&#x27;, &#x27;Upper Sorbian&#x27;), (&#x27;hu&#x27;, &#x27;Hungarian&#x27;), (&#x27;hy&#x27;, &#x27;Armenian&#x27;), (&#x27;ia&#x27;, &#x27;Interlingua&#x27;), (&#x27;id&#x27;, &#x27;Indonesian&#x27;), (&#x27;ig&#x27;, &#x27;Igbo&#x27;), (&#x27;io&#x27;, &#x27;Ido&#x27;), (&#x27;is&#x27;, &#x27;Icelandic&#x27;), (&#x27;it&#x27;, &#x27;Italian&#x27;), (&#x27;ja&#x27;, &#x27;Japanese&#x27;), (&#x27;ka&#x27;, &#x27;Georgian&#x27;), (&#x27;kab&#x27;, &#x27;Kabyle&#x27;), (&#x27;kk&#x27;, &#x27;Kazakh&#x27;), (&#x27;km&#x27;, &#x27;Khmer&#x27;), (&#x27;kn&#x27;, &#x27;Kannada&#x27;), (&#x27;ko&#x27;, &#x27;Korean&#x27;), (&#x27;ky&#x27;, &#x27;Kyrgyz&#x27;), (&#x27;lb&#x27;, &#x27;Luxembourgish&#x27;), (&#x27;lt&#x27;, &#x27;Lithuanian&#x27;), (&#x27;lv&#x27;, &#x27;Latvian&#x27;), (&#x27;mk&#x27;, &#x27;Macedonian&#x27;), (&#x27;ml&#x27;, &#x27;Malayalam&#x27;), (&#x27;mn&#x27;, &#x27;Mongolian&#x27;), (&#x27;mr&#x27;, &#x27;Marathi&#x27;), (&#x27;ms&#x27;, &#x27;Malay&#x27;), (&#x27;my&#x27;, &#x27;Burmese&#x27;), (&#x27;nb&#x27;, &#x27;Norwegian Bokmål&#x27;), (&#x27;ne&#x27;, &#x27;Nepali&#x27;), (&#x27;nl&#x27;, &#x27;Dutch&#x27;), (&#x27;nn&#x27;, &#x27;Norwegian Nynorsk&#x27;), (&#x27;os&#x27;, &#x27;Ossetic&#x27;), (&#x27;pa&#x27;, &#x27;Punjabi&#x27;), (&#x27;pl&#x27;, &#x27;Polish&#x27;), (&#x27;pt&#x27;, &#x27;Portuguese&#x27;), (&#x27;pt-br&#x27;, &#x27;Brazilian Portuguese&#x27;), (&#x27;ro&#x27;, &#x27;Romanian&#x27;), (&#x27;ru&#x27;, &#x27;Russian&#x27;), (&#x27;sk&#x27;, &#x27;Slovak&#x27;), (&#x27;sl&#x27;, &#x27;Slovenian&#x27;), (&#x27;sq&#x27;, &#x27;Albanian&#x27;), (&#x27;sr&#x27;, &#x27;Serbian&#x27;), (&#x27;sr-latn&#x27;, &#x27;Serbian Latin&#x27;), (&#x27;sv&#x27;, &#x27;Swedish&#x27;), (&#x27;sw&#x27;, &#x27;Swahili&#x27;), (&#x27;ta&#x27;, &#x27;Tamil&#x27;), (&#x27;te&#x27;, &#x27;Telugu&#x27;), (&#x27;tg&#x27;, &#x27;Tajik&#x27;), (&#x27;th&#x27;, &#x27;Thai&#x27;), (&#x27;tk&#x27;, &#x27;Turkmen&#x27;), (&#x27;tr&#x27;, &#x27;Turkish&#x27;), (&#x27;tt&#x27;, &#x27;Tatar&#x27;), (&#x27;udm&#x27;, &#x27;Udmurt&#x27;), (&#x27;uk&#x27;, &#x27;Ukrainian&#x27;), (&#x27;ur&#x27;, &#x27;Urdu&#x27;), (&#x27;uz&#x27;, &#x27;Uzbek&#x27;), (&#x27;vi&#x27;, &#x27;Vietnamese&#x27;), (&#x27;zh-hans&#x27;, &#x27;Simplified Chinese&#x27;), (&#x27;zh-hant&#x27;, &#x27;Traditional Chinese&#x27;)]</pre></td> </tr> <tr> <td>LANGUAGES_BIDI</td> <td class="code"><pre>[&#x27;he&#x27;, &#x27;ar&#x27;, &#x27;ar-dz&#x27;, &#x27;fa&#x27;, &#x27;ur&#x2 7;]</pre></td> </tr> <tr> <td>LANGUAGE_CODE</td> <td class="code"><pre>&#x27;en-us&#x27;</pre></td> </tr> <tr> <td>LANGUAGE_COOKIE_AGE</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>LANGUAGE_COOKIE_DOMAIN</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>LANGUAGE_COOKIE_HTTPONLY</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>LANGUAGE_COOKIE_NAME</td> <td class="code"><pre>&#x27;django_language&#x27;</pre></td> </tr> <tr> <td>LANGUAGE_COOKIE_PATH</td> <td class="code"><pre>&#x27;/&#x27;</pre></td> </tr> <tr> <td>LANGUAGE_COOKIE_SAMESITE</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>LANGUAGE_COOKIE_SECURE</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>LOCALE_PATHS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>LOGGING</td> <td class="code"><pre>{}</pre></td> </tr> <tr> <td>LOGGING_CONFIG</td> <td class="code"><pre>&#x27;logging.config.dictConfig&#x27;</pre></td> </tr> <tr> <td>LOGIN_REDIRECT_URL</td> <td class="code"><pre>&#x27;/accounts/profile/&#x27;</pre></td> </tr> <tr> <td>LOGIN_URL</td> <td class="code"><pre>&#x27;/accounts/login/&#x27;</pre></td> </tr> <tr> <td>LOGOUT_REDIRECT_URL</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>MANAGERS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>MEDIA_ROOT</td> <td class="code"><pre>&#x27;&#x27;</pre></td> </tr> <tr> <td>MEDIA_URL</td> <td class="code"><pre>&#x27;/&#x27;</pre></td> </tr> <tr> <td>MESSAGE_STORAGE</td> <td class="code"><pre>&#x27;django.contrib.messages.storage.fallback.FallbackStorage&#x27;</pre></td> </tr> <tr> <td>MIDDLEWARE</td> <td class="code"><pre>[&#x27;django.middleware.security.SecurityMiddleware&#x27;, &#x27;django.contrib.sessions.middleware.SessionMiddleware&#x27;, &#x27;django.middleware.common.CommonMiddleware&#x27;, &#x27;django.middleware.csrf.CsrfViewMiddleware&#x27;, &#x27;django.contrib.auth.middleware.AuthenticationMiddleware&#x27;, &#x27;django.contrib.messages.middleware.MessageMiddleware&#x27;, &#x27;django.middleware.clickjacking.XFrameOptionsMiddleware&#x27;]</pre></td> </tr> <tr> <td>MIGRATION_MODULES</td> <td class="code"><pre>{}</pre></td> </tr> <tr> <td>MONTH_DAY_FORMAT</td> <td class="code"><pre>&#x27;F j&#x27;</pre></td> </tr> <tr> <td>NUMBER_GROUPING</td> <td class="code"><pre>0</pre></td> </tr> <tr> <td>PASSWORD_HASHERS</td> <td class="code"><pre>&#x27;********************&#x27;</pre></td> </tr> <tr> <td>PASSWORD_RESET_TIMEOUT</td> <td class="code"><pre>&#x27;********************&#x27;</pre></td> </tr> <tr> <td>PREPEND_WWW</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>ROOT_URLCONF</td> <td class="code"><pre>&#x27;DRF.urls&#x27;</pre></td> </tr> <tr> <td>SECRET_KEY</td> <td class="code"><pre>&#x27;********************&#x27;</pre></td> </tr> <tr> <td>SECURE_CONTENT_TYPE_NOSNIFF</td> <td class="code"><pre>True</pre></td> </tr> <tr> <td>SECURE_CROSS_ORIGIN_OPENER_POLICY</td> <td class="code"><pre>&#x27;same-origin&#x27;</pre></td> </tr> <tr> <td>SECURE_HSTS_INCLUDE_SUBDOMAINS</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>SECURE_HSTS_PRELOAD</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>SECURE_HSTS_SECONDS</td> <td class="code"><pre>0</pre></td> </tr> <tr> <td>SECURE_PROXY_SSL_HEADER</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>SECURE_REDIRECT_EXEMPT</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>SECURE_REFERRER_POLICY</td> <td class="code"><pre>&#x27;same-origin&#x27;</pre></td> </tr> <tr> <td>SECURE_SSL_HOST</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>SECURE_SSL_REDIRECT</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>SERVER_EMAIL</td> <td class="code"><pre>&#x27;root@localhost&#x27;</pre></td> </tr> <tr> <td>SESSION_CACHE_ALIAS</td> <td class="code"><pre>&#x27;default&#x27;</pre></td> </tr> <tr> <td>SESSION_COOKIE_AGE</td> <td class="code"><pre>1209600</pre></td> </tr> <tr> <td>SESSION_COOKIE_DOMAIN</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>SESSION_COOKIE_HTTPONLY</td> <td class="code"><pre>True</pre></td> </tr> <tr> <td>SESSION_COOKIE_NAME</td> <td class="code"><pre>&#x27;sessionid&#x27;</pre></td> </tr> <tr> <td>SESSION_COOKIE_PATH</td> <td class="code"><pre>&#x27;/&#x27;</pre></td> </tr> <tr> <td>SESSION_COOKIE_SAMESITE</td> <td class="code"><pre>&#x27;Lax&#x27;</pre></td> </tr> <tr> <td>SESSION_COOKIE_SECURE</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>SESSION_ENGINE</td> <td class="code"><pre>&#x27;django.contrib.sessions.backends.db&#x27;</pre></td> </tr> <tr> <td>SESSION_EXPIRE_AT_BROWSER_CLOSE</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>SESSION_FILE_PATH</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>SESSION_SAVE_EVERY_REQUEST</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>SESSION_SERIALIZER</td> <td class="code"><pre>&#x27;django.contrib.sessions.serializers.JSONSerializer&#x27;</pre></td> </tr> <tr> <td>SETTINGS_MODULE</td> <td class="code"><pre>&#x27;DRF.settings&#x27;</pre></td> </tr> <tr> <td>SHORT_DATETIME_FORMAT</td> <td class="code"><pre>&#x27;m/d/Y P&#x27;</pre></td> </tr> <tr> <td>SHORT_DATE_FORMAT</td> <td class="code"><pre>&#x27;m/d/Y&#x27;</pre></td> </tr> <tr> <td>SIGNING_BACKEND</td> <td class="code"><pre>&#x27;django.core.signing.TimestampSigner&#x27;</pre></td> </tr> <tr> <td>SILENCED_SYSTEM_CHECKS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>STATICFILES_DIRS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>STATICFILES_FINDERS</td> <td class="code"><pre>[&#x27;django.contrib.staticfiles.finders.FileSystemFinder&#x27;, &#x27;django.contrib.staticfiles.finders.AppDirectoriesFinder&#x27;]</pre></td> </tr> <tr> <td>STATICFILES_STORAGE</td> <td class="code"><pre>&#x27;django.contrib.staticfiles.storage.StaticFilesStorage&#x27;</pre></td> </tr> <tr> <td>STATIC_ROOT</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>STATIC_URL</td> <td class="code"><pre>&#x27;/static/&#x27;</pre></td> </tr> <tr> <td>TEMPLATES</td> <td class="code"><pre>[{&#x27;APP_DIRS&#x27;: True, &#x27;BACKEND&#x27;: &#x27;django.template.backends.django.DjangoTemplates&#x27;, &#x27;DIRS&#x27;: [], &#x27;OPTIONS&#x27;: {&#x27;context_processors&#x27;: [&#x27;django.template.context_processors.debug&#x27;, &#x27;django.template.context_processors.request&#x27;, &#x27;django.contrib.auth.context_processors.auth&#x27;, &#x27;django.contrib.messages.context_processors.messages&#x27;]}}]</pre></ td> </tr> <tr> <td>TEST_NON_SERIALIZED_APPS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>TEST_RUNNER</td> <td class="code"><pre>&#x27;django.test.runner.DiscoverRunner&#x27;</pre></td> </tr> <tr> <td>THOUSAND_SEPARATOR</td> <td class="code"><pre>&#x27;,&#x27;</pre></td> </tr> <tr> <td>TIME_FORMAT</td> <td class="code"><pre>&#x27;P&#x27;</pre></td> </tr> <tr> <td>TIME_INPUT_FORMATS</td> <td class="code"><pre>[&#x27;%H:%M:%S&#x27;, &#x27;%H:%M:%S.%f&#x27;, &#x27;%H:%M&#x27;]</pre></td> </tr> <tr> <td>TIME_ZONE</td> <td class="code"><pre>&#x27;Asia/Seoul&#x27;</pre></td> </tr> <tr> <td>USE_DEPRECATED_PYTZ</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>USE_I18N</td> <td class="code"><pre>True</pre></td> </tr> <tr> <td>USE_L10N</td> <td class="code"><pre>True</pre></td> </tr> <tr> <td>USE_THOUSAND_SEPARATOR</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>USE_TZ</td> <td class="code"><pre>True</pre></td> </tr> <tr> <td>USE_X_FORWARDED_HOST</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>USE_X_FORWARDED_PORT</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>WSGI_APPLICATION</td> <td class="code"><pre>&#x27;DRF.wsgi.application&#x27;</pre></td> </tr> <tr> <td>X_FRAME_OPTIONS</td> <td class="code"><pre>&#x27;DENY&#x27;</pre></td> </tr> <tr> <td>YEAR_MONTH_FORMAT</td> <td class="code"><pre>&#x27;F Y&#x27;</pre></td> </tr> </tbody> </table> </div> <div id="explanation"> (drf) C:\Users\cswoo\OneDrive\Documents\DRF>http POST http://localhost:8000/ukstagram/posts/ message="23th post" is_public=true HTTP/1.1 500 Internal Server Error Content-Length: 125684 Content-Type: text/html Cross-Origin-Opener-Policy: same-origin Date: Fri, 22 Apr 2022 10:48:09 GMT Referrer-Policy: same-origin Server: WSGIServer/0.2 CPython/3.8.12 Vary: Cookie X-Content-Type-Options: nosniff X-Frame-Options: DENY <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name="robots" content="NONE,NOARCHIVE"> <title>ValueError at /ukstagram/posts/</title> <style type="text/css"> html * { padding:0; margin:0; } body * { padding:10px 20px; } body * * { padding:0; } body { font:small sans-serif; background-color:#fff; color:#000; } body>div { border-bottom:1px solid #ddd; } h1 { font-weight:normal; } h2 { margin-bottom:.8em; } h3 { margin:1em 0 .5em 0; } h4 { margin:0 0 .5em 0; font-weight: normal; } code, pre { font-size: 100%; white-space: pre-wrap; } summary { cursor: pointer; } table { border:1px solid #ccc; border-collapse: collapse; width:100%; background:white; } tbody td, tbody th { vertical-align:top; padding:2px 3px; } thead th { padding:1px 6px 1px 3px; background:#fefefe; text-align:left; font-weight:normal; font-size:11px; border:1px solid #ddd; } tbody th { width:12em; text-align:right; color:#666; padding-right:.5em; } table.vars { margin:5px 0 2px 40px; } table.vars td, table.req td { font-family:monospace; } table td.code { width:100%; } table td.code pre { overflow:hidden; } table.source th { color:#666; } table.source td { font-family:monospace; white-space:pre; border-bottom:1px solid #eee; } ul.traceback { list-style-type:none; color: #222; } ul.traceback li.frame { padding-bottom:1em; color:#4f4f4f; } ul.traceback li.user { background-color:#e0e0e0; color:#000 } div.context { padding:10px 0; overflow:hidden; } div.context ol { padding-left:30px; margin:0 10px; list-style-position: inside; } div.context ol li { font-family:monospace; white-space:pre; color:#777; cursor:pointer; padding-left: 2px; } div.context ol li pre { display:inline; } div.context ol.context-line li { color:#464646; background-color:#dfdfdf; padding: 3px 2px; } div.context ol.context-line li span { position:absolute; right:32px; } .user div.context ol.context-line li { background-color:#bbb; color:#000; } .user div.context ol li { color:#666; } div.commands, summary.commands { margin-left: 40px; } div.commands a, summary.commands { color:#555; text-decoration:none; } .user div.commands a { color: black; } #summary { background: #ffc; } #summary h2 { font-weight: normal; color: #666; } #explanation { background:#eee; } #template, #template-not-exist { background:#f6f6f6; } #template-not-exist ul { margin: 0 0 10px 20px; } #template-not-exist .postmortem-section { margin-bottom: 3px; } #unicode-hint { background:#eee; } #traceback { background:#eee; } #requestinfo { background:#f6f6f6; padding-left:120px; } #summary table { border:none; background:transparent; } #requestinfo h2, #requestinfo h3 { position:relative; margin-left:-100px; } #requestinfo h3 { margin-bottom:-1em; } .error { background: #ffc; } .specific { color:#cc3300; font-weight:bold; } h2 span.commands { font-size:.7em; font-weight:normal; } span.commands a:link {color:#5E5694;} pre.exception_value { font-family: sans-serif; color: #575757; font-size: 1.5em; margin: 10px 0 10px 0; } .append-bottom { margin-bottom: 10px; } .fname { user-select: all; } </style> <script> function hideAll(elems) { for (var e = 0; e < elems.length; e++) { elems[e].style.display = 'none'; } } window.onload = function() { hideAll(document.querySelectorAll('ol.pre-context')); hideAll(document.querySelectorAll('ol.post-context')); hideAll(document.querySelectorAll('div.pastebin')); } function toggle() { for (var i = 0; i < arguments.length; i++) { var e = document.getElementById(arguments[i]); if (e) { e.style.display = e.style.display == 'none' ? 'block': 'none'; } } return false; } function switchPastebinFriendly(link) { s1 = "Switch to copy-and-paste view"; s2 = "Switch back to interactive view"; link.textContent = link.textContent.trim() == s1 ? s2: s1; toggle('browserTraceback', 'pastebinTraceback'); return false; } </script> </head> <body> <div id="summary"> <h1>ValueError at /ukstagram/posts/</h1> <pre class="exception_value">Cannot assign &quot;&lt;django.contrib.auth.models.AnonymousUser object at 0x0000012F72D73C10&gt;&quot;: &quot;Post.author&quot; must be a &quot;User&quot; instance.</pre> <table class="meta"> <tr> <th>Request Method:</th> <td>POST</td> </tr> <tr> <th>Request URL:</th> <td>http://localhost:8000/ukstagram/posts/</td> </tr> <tr> <th>Django Version:</th> <td>4.0.4</td> </tr> <tr> <th>Exception Type:</th> <td>ValueError</td> </tr> <tr> <th>Exception Value:</th> <td><pre>Cannot assign &quot;&lt;django.contrib.auth.models.AnonymousUser object at 0x0000012F72D73C10&gt;&quot;: &quot;Post.author&quot; must be a &quot;User&quot; instance.</pre></td> </tr> <tr> <th>Exception Location:</th> <td><span class="fname">C:\Users\cswoo\.conda\envs\drf\lib\site-packages\django\db\models\fields\related_descriptors.py</span>, line 235, in __set__</td> </tr> <tr> <th>Python Executable:</th> <td>C:\Users\cswoo\.conda\envs\drf\python.exe</td> </tr> <tr> <th>Python Version:</th> <td>3.8.12</td> </tr> <tr> <th>Python Path:</th> <td><pre>[&#x27;C:\\Users\\cswoo\\OneDrive\\Documents\\DRF&#x27;, &#x27;C:\\Users\\cswoo\\.conda\\envs\\drf\\python38.zip&#x27;, &#x27;C:\\Users\\cswoo\\.conda\\envs\\drf\\DLLs&#x27;, &#x27;C:\\Users\\cswoo\\.conda\\envs\\drf\\lib&#x27;, &#x27;C:\\Users\\cswoo\\.conda\\envs\\drf&#x27;, &#x27;C:\\Users\\cswoo\\AppData\\Roaming\\Python\\Python38\\site-packages&#x27;, &#x27;C:\\Users\\cswoo\\.conda\\envs\\drf\\lib\\site-packages&#x27;]</pre></td> </tr> <tr> <th>Server time:</th> <td>Fri, 22 Apr 2022 19:48:09 +0900</td> </tr> </table> </div> <div id="traceback"> <h2>Traceback <span class="commands"><a href="#" onclick="return switchPastebinFriendly(this);"> Switch to copy-and-paste view</a></span> </h2> <div id="browserTraceback"> <ul class="traceback"> <li class="frame django"> <code class="fname">C:\Users\cswoo\.conda\envs\drf\lib\site-packages\django\core\handlers\exception.py</code>, line 55, in inner <div class="context" id="c1303298475648"> <ol start="48" class="pre-context" id="pre1303298475648"> <li onclick="toggle('pre1303298475648', 'post1303298475648')"><pre></pre></li> <li onclick="toggle('pre1303298475648', 'post1303298475648')"><pre> return inner</pre></li> <li onclick="toggle('pre1303298475648', 'post1303298475648')"><pre> else:</pre></li> <li onclick="toggle('pre1303298475648', 'post1303298475648')"><pre></pre></li> <li onclick="toggle('pre1303298475648', 'post1303298475648')"><pre> @wraps(get_response)</pre></li> <li onclick="toggle('pre1303298475648', 'post1303298475648')"><pre> def inner(request):</pre></li> <li onclick="toggle('pre1303298475648', 'post1303298475648')"><pre> try:</pre></li> </ol> <ol start="55" class="context-line"> <li onclick="toggle('pre1303298475648', 'post1303298475648')"><pre> response = get_response(request)</pre> <span>…</span></li> </ol> <ol start='56' class="post-context" id="post1303298475648"> <li onclick="toggle('pre1303298475648', 'post1303298475648')"><pre> except Exception as exc:</pre></li> <li onclick="toggle('pre1303298475648', 'post1303298475648')"><pre> response = response_for_exception(request, exc)</pre></li> <li onclick="toggle('pre1303298475648', 'post1303298475648')"><pre> return response</pre></li> <li onclick="toggle('pre1303298475648', 'post1303298475648')"><pre></pre></li> <li onclick="toggle('pre1303298475648', 'post1303298475648')"><pre> return inner</pre></li> <li onclick="toggle('pre1303298475648', 'post1303298475648')"><pre></pre></li> </ol> </div> <details> <summary class="commands">Local vars</summary> <table class="vars" id="v1303298475648"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>exc</td> <td class="code"><pre>ValueError(&#x27;Cannot assign &quot;&lt;django.contrib.auth.models.AnonymousUser object at 0x0000012F72D73C10&gt;&quot;: &quot;Post.author&quot; must be a &quot;User&quot; instance.&#x27;)< /pre></td> </tr> <tr> <td>get_response</td> <td class="code"><pre>&lt;bound method BaseHandler._get_response of &lt;django.core.handlers.wsgi.WSGIHandler object at 0x0000012F711EE7C0&gt;&gt;</pre></td> </tr> <tr> <td>request</td> <td class="code"><pre>&lt;WSGIRequest: POST &#x27;/ukstagram/posts/&#x27;&gt;</pre></td> </tr> </tbody> </table> </details> </li> <li class="frame django"> <code class="fname">C:\Users\cswoo\.conda\envs\drf\lib\site-packages\django\core\handlers\base.py</code>, line 197, in _get_response <div class="context" id="c1303298474624"> <ol start="190" class="pre-context" id="pre1303298474624"> <li onclick="toggle('pre1303298474624', 'post1303298474624')"><pre></pre></li> <li onclick="toggle('pre1303298474624', 'post1303298474624')"><pre> if response is None:</pre></li> <li onclick="toggle('pre1303298474624', 'post1303298474624')"><pre> wrapped_callback = self.make_view_atomic(callback)</pre></li> <li onclick="toggle('pre1303298474624', 'post1303298474624')"><pre> # If it is an asynchronous view, run it in a subthread.</pre></li> <li onclick="toggle('pre1303298474624', 'post1303298474624')"><pre> if asyncio.iscoroutinefunction(wrapped_callback):</pre></li> <li onclick="toggle('pre1303298474624', 'post1303298474624')"><pre> wrapped_callback = async_to_sync(wrapped_callback)</pre></li> <li onclick="toggle('pre1303298474624', 'post1303298474624')"><pre> try:</pre></li> </ol> <ol start="197" class="context-line"> <li onclick="toggle('pre1303298474624', 'post1303298474624')"><pre> response = wrapped_callback(request, *callback_args, **callback_kwargs)</pre> <span>…</span></li> </ol> <ol start='198' class="post-context" id="post1303298474624"> <li onclick="toggle('pre1303298474624', 'post1303298474624')"><pre> except Exception as e:</pre></li> <li onclick="toggle('pre1303298474624', 'post1303298474624')"><pre> response = self.process_exception_by_middleware(e, request)</pre></li> <li onclick="toggle('pre1303298474624', 'post1303298474624')"><pre> if response is None:</pre></li> <li onclick="toggle('pre1303298474624', 'post1303298474624')"><pre> raise</pre></li> <li onclick="toggle('pre1303298474624', 'post1303298474624')"><pre></pre></li> <li onclick="toggle('pre1303298474624', 'post1303298474624')"><pre> # Complain if the view returned None (a common error).</pre></li> </ol> </div> <details> <summary class="commands">Local vars</summary> <table class="vars" id="v1303298474624"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>callback</td> <td class="code"><pre>&lt;function PostViewSet at 0x0000012F72648940&gt;</pre></td> </tr> <tr> <td>callback_args</td> <td class="code"><pre>()</pre></td> </tr> <tr> <td>callback_kwargs</td> <td class="code"><pre>{}</pre></td> </tr> <tr> <td>middleware_method</td> <td class="code"><pre>&lt;bound method CsrfViewMiddleware.process_view of &lt;CsrfViewMiddleware get_response=convert_exception_to_response.&lt;locals&gt;.inner&gt;&gt;</pre></td> </tr> <tr> <td>request</td> <td class="code"><pre>&lt;WSGIRequest: POST &#x27;/ukstagram/posts/&#x27;&gt;</pre></td> </tr> <tr> <td>response</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>self</td> <td class="code"><pre>&lt;django.core.handlers.wsgi.WSGIHandler object at 0x0000012F711EE7C0&gt;</pre></td> </tr> <tr> <td>wrapped_callback</td> <td class="code"><pre>&lt;function PostViewSet at 0x0000012F72648940&gt;</pre></td> </tr> </tbody> </table> </details> </li> <li class="frame django"> <code class="fname">C:\Users\cswoo\.conda\envs\drf\lib\site-packages\django\views\decorators\csrf.py</code>, line 54, in wrapped_view <div class="context" id="c1303298477888"> <ol start="47" class="pre-context" id="pre1303298477888"> <li onclick="toggle('pre1303298477888', 'post1303298477888')"><pre></pre></li> <li onclick="toggle('pre1303298477888', 'post1303298477888')"><pre></pre></li> <li onclick="toggle('pre1303298477888', 'post1303298477888')"><pre>def csrf_exempt(view_func):</pre></li> <li onclick="toggle('pre1303298477888', 'post1303298477888')"><pre> &quot;&quot;&quot;Mark a view function as being exempt from the CSRF view protection.&quot;&quot;&quot;</pre></li> <li onclick="toggle('pre1303298477888', 'post1303298477888')"><pre> # view_func.csrf_exempt = True would also work, but decorators are nicer</pre></li> <li onclick="toggle('pre1303298477888', 'post1303298477888')"><pre> # if they don&#x27;t have side effects, so return a new function.</pre></li> <li onclick="toggle('pre1303298477888', 'post1303298477888')"><pre> def wrapped_view(*args, **kwargs):</pre></li> </ol> <ol start="54" class="context-line"> <li onclick="toggle('pre1303298477888', 'post1303298477888')"><pre> return view_func(*args, **kwargs)</pre> <span>…</span></li> </ol> <ol start='55' class="post-context" id="post1303298477888"> <li onclick="toggle('pre1303298477888', 'post1303298477888')"><pre></pre></li> <li onclick="toggle('pre1303298477888', 'post1303298477888')"><pre> wrapped_view.csrf_exempt = True</pre></li> <li onclick="toggle('pre1303298477888', 'post1303298477888')"><pre> return wraps(view_func)(wrapped_view)</pre></li> </ol> </div> <details> <summary class="commands">Local vars</summary> <table class="vars" id="v1303298477888"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>args</td> <td class="code"><pre>(&lt;WSGIRequest: POST &#x27;/ukstagram/posts/&#x27;&gt;,)</pre></td> </tr> <tr> <td>kwargs</td> <td class="code"><pre>{}</pre></td> </tr> <tr> <td>view_func</td> <td class="code"><pre>&lt;function PostViewSet at 0x0000012F718C4700&gt;</pre></td> </tr> </tbody> </table> </details> </li> <li class="frame user"> <code class="fname">C:\Users\cswoo\.conda\envs\drf\lib\site-packages\rest_framework\viewsets.py</code>, line 125, in view <div class="context" id="c1303298475328"> <ol start="118" class="pre-context" id="pre1303298475328"> <li onclick="toggle('pre1303298475328', 'post1303298475328')"><pre> setattr(self, method, handler)</pre></li> <li onclick="toggle('pre1303298475328', 'post1303298475328')"><pre></pre></li> <li onclick="toggle('pre1303298475328', 'post1303298475328')"><pre> self.request = request</pre></li> <li onclick="toggle('pre1303298475328', 'post1303298475328')"><pre> self.args = args</pre></li> <li onclick="toggle('pre1303298475328', 'post1303298475328')"><pre> self.kwargs = kwargs</pre></li> <li onclick="toggle('pre1303298475328', 'post1303298475328')"><pre></pre></li> <li onclick="toggle('pre1303298475328', 'post1303298475328')"><pre> # And continue as usual</pre></li> </ol> <ol start="125" class="context-line"> <li onclick="toggle('pre1303298475328', 'post1303298475328')"><pre> return self.dispatch(request, *args, **kwargs)</pre> <span>…</span></li> </ol> <ol start='126' class="post-context" id="post1303298475328"> <li onclick="toggle('pre1303298475328', 'post1303298475328')"><pre></pre></li> <li onclick="toggle('pre1303298475328', 'post1303298475328')"><pre> # take name and docstring from class</pre></li> <li onclick="toggle('pre1303298475328', 'post1303298475328')"><pre> update_wrapper(view, cls, updated=())</pre></li> <li onclick="toggle('pre1303298475328', 'post1303298475328')"><pre></pre></li> <li onclick="toggle('pre1303298475328', 'post1303298475328')"><pre> # and possible attributes set by decorators</pre></li> <li onclick="toggle('pre1303298475328', 'post1303298475328')"><pre> # like csrf_exempt from dispatch</pre></li> </ol> </div> <details> <summary class="commands">Local vars</summary> <table class="vars" id="v1303298475328"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>action</td> <td class="code"><pre>&#x27;list&#x27;</pre></td> </tr> <tr> <td>actions</td> <td class="code"><pre>{&#x27;get&#x27;: &#x27;list&#x27;, &#x27;head&#x27;: &#x27;list&#x27;, &#x27;post&#x27;: &#x27;create&#x27;}</pre></td> </tr> <tr> <td>args</td> <td class="code"><pre>()</pre></td> </tr> <tr> <td>cls</td> <td class="code"><pre>&lt;class &#x27;ukstagram.views.PostViewSet&#x27;&gt;</pre></td> </tr> <tr> <td>handler</td> <td class="code"><pre>&lt;bound method ListModelMixin.list of &lt;ukstagram.views.PostViewSet object at 0x0000012F72D73520&gt;&gt;</pre></td> </tr> <tr> <td>initkwargs</td> <td class="code"><pre>{&#x27;basename&#x27;: &#x27;posts&#x27;, &#x27;detail&#x27;: False, &#x27;suffix&#x27;: &#x27;List&#x27;}</pre></td> </tr> <tr> <td>kwargs</td> <td class="code"><pre>{}</pre></td> </tr> <tr> <td>method</td> <td class="code"><pre>&#x27;head&#x27;</pre></td> </tr> <tr> <td>request</td> <td class="code"><pre>&lt;WSGIRequest: POST &#x27;/ukstagram/posts/&#x27;&gt;</pre></td> </tr> <tr> <td>self</td> <td class="code"><pre>&lt;ukstagram.views.PostViewSet object at 0x0000012F72D73520&gt;</pre></td> </tr> </tbody> </table> </details> </li> <li class="frame user"> <code class="fname">C:\Users\cswoo\.conda\envs\drf\lib\site-packages\rest_framework\views.py</code>, line 509, in dispatch <div class="context" id="c1303298477120"> <ol start="502" class="pre-context" id="pre1303298477120"> <li onclick="toggle('pre1303298477120', 'post1303298477120')"><pre> self.http_method_not_allowed)</pre></li> <li onclick="toggle('pre1303298477120', 'post1303298477120')"><pre> else:</pre></li> <li onclick="toggle('pre1303298477120', 'post1303298477120')"><pre> handler = self.http_method_not_allowed</pre></li> <li onclick="toggle('pre1303298477120', 'post1303298477120')"><pre></pre></li> <li onclick="toggle('pre1303298477120', 'post1303298477120')"><pre> response = handler(request, *args, **kwargs)</pre></li> <li onclick="toggle('pre1303298477120', 'post1303298477120')"><pre></pre></li> <li onclick="toggle('pre1303298477120', 'post1303298477120')"><pre> except Exception as exc:</pre></li> </ol> <ol start="509" class="context-line"> <li onclick="toggle('pre1303298477120', 'post1303298477120')"><pre> response = self.handle_exception(exc)</pre> <span>…</span></li> </ol> <ol start='510' class="post-context" id="post1303298477120"> <li onclick="toggle('pre1303298477120', 'post1303298477120')"><pre></pre></li> <li onclick="toggle('pre1303298477120', 'post1303298477120')"><pre> self.response = self.finalize_response(request, response, *args, **kwargs)</pre></li> <li onclick="toggle('pre1303298477120', 'post1303298477120')"><pre> return self.response</pre></li> <li onclick="toggle('pre1303298477120', 'post1303298477120')"><pre></pre></li> <li onclick="toggle('pre1303298477120', 'post1303298477120')"><pre> def options(self, request, *args, **kwargs):</pre></li> <li onclick="toggle('pre1303298477120', 'post1303298477120')"><pre> &quot;&quot;&quot;</pre></li> </ol> </div> <details> <summary class="commands">Local vars</summary> <table class="vars" id="v1303298477120"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>args</td> <td class="code"><pre>()</pre></td> </tr> <tr> <td>handler</td> <td class="code"><pre>&lt;bound method CreateModelMixin.create of &lt;ukstagram.views.PostViewSet object at 0x0000012F72D73520&gt;&gt;</pre></td> </tr> <tr> <td>kwargs</td> <td class="code"><pre>{}</pre></td> </tr> <tr> <td>request</td> <td class="code"><pre>&lt;rest_framework.request.Request: POST &#x27;/ukstagram/posts/&#x27;&gt;</pre></td> </tr> <tr> <td>self</td> <td class="code"><pre>&lt;ukstagram.views.PostViewSet object at 0x0000012F72D73520&gt;</pre></td> </tr> </tbody> </table> </details> </li> <li class="frame user"> <code class="fname">C:\Users\cswoo\.conda\envs\drf\lib\site-packages\rest_framework\views.py</code>, line 469, in handle_exception <div class="context" id="c1303297323328"> <ol start="462" class="pre-context" id="pre1303297323328"> <li onclick="toggle('pre1303297323328', 'post1303297323328')"><pre></pre></li> <li onclick="toggle('pre1303297323328', 'post1303297323328')"><pre> exception_handler = self.get_exception_handler()</pre></li> <li onclick="toggle('pre1303297323328', 'post1303297323328')"><pre></pre></li> <li onclick="toggle('pre1303297323328', 'post1303297323328')"><pre> context = self.get_exception_handler_context()</pre></li> <li onclick="toggle('pre1303297323328', 'post1303297323328')"><pre> response = exception_handler(exc, context)</pre></li> <li onclick="toggle('pre1303297323328', 'post1303297323328')"><pre></pre></li> <li onclick="toggle('pre1303297323328', 'post1303297323328')"><pre> if response is None:</pre></li> </ol> <ol start="469" class="context-line"> <li onclick="toggle('pre1303297323328', 'post1303297323328')"><pre> self.raise_uncaught_exception(exc)</pre> <span>…</span></li> </ol> <ol start='470' class="post-context" id="post1303297323328"> <li onclick="toggle('pre1303297323328', 'post1303297323328')"><pre></pre></li> <li onclick="toggle('pre1303297323328', 'post1303297323328')"><pre> response.exception = True</pre></li> <li onclick="toggle('pre1303297323328', 'post1303297323328')"><pre> return response</pre></li> <li onclick="toggle('pre1303297323328', 'post1303297323328')"><pre></pre></li> <li onclick="toggle('pre1303297323328', 'post1303297323328')"><pre> def raise_uncaught_exception(self, exc):</pre></li> <li onclick="toggle('pre1303297323328', 'post1303297323328')"><pre> if settings.DEBUG:</pre></li> </ol> </div> <details> <summary class="commands">Local vars</summary> <table class="vars" id="v1303297323328"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>context</td> <td class="code"><pre>{&#x27;args&#x27;: (), &#x27;kwargs&#x27;: {}, &#x27;request&#x27;: &lt;rest_framework.request.Request: POST &#x27;/ukstagram/posts/&#x27;&gt;, &#x27;view&#x27;: &lt;ukstagram.views.PostViewSet object at 0x0000012F72D73520&gt;}</pre></td> </tr> <tr> <td>exc</td> <td class="code"><pre>ValueError(&#x27;Cannot assign &quot;&lt;django.contrib.auth.models.AnonymousUser object at 0x0000012F72D73C10&gt;&quot;: &quot;Post.author&quot; must be a &quot;User&quot; instance.&#x27;)< /pre></td> </tr> <tr> <td>exception_handler</td> <td class="code"><pre>&lt;function exception_handler at 0x0000012F71E2B9D0&gt;</pre></td> </tr> <tr> <td>response</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>self</td> <td class="code"><pre>&lt;ukstagram.views.PostViewSet object at 0x0000012F72D73520&gt;</pre></td> </tr> </tbody> </table> </details> </li> <li class="frame user"> <code class="fname">C:\Users\cswoo\.conda\envs\drf\lib\site-packages\rest_framework\views.py</code>, line 480, in raise_uncaught_exception <div class="context" id="c1303297323776"> <ol start="473" class="pre-context" id="pre1303297323776"> <li onclick="toggle('pre1303297323776', 'post1303297323776')"><pre></pre></li> <li onclick="toggle('pre1303297323776', 'post1303297323776')"><pre> def raise_uncaught_exception(self, exc):</pre></li> <li onclick="toggle('pre1303297323776', 'post1303297323776')"><pre> if settings.DEBUG:</pre></li> <li onclick="toggle('pre1303297323776', 'post1303297323776')"><pre> request = self.request</pre></li> <li onclick="toggle('pre1303297323776', 'post1303297323776')"><pre> renderer_format = getattr(request.accepted_renderer, &#x27;format&#x27;)</pre></li> <li onclick="toggle('pre1303297323776', 'post1303297323776')"><pre> use_plaintext_traceback = renderer_format not in (&#x27;html&#x27;, &#x27;api&#x27;, &#x27;admin&#x27;)</pre></li> <li onclick="toggle('pre1303297323776', 'post1303297323776')"><pre> request.force_plaintext_errors(use_plaintext_traceback)</pre></li> </ol> <ol start="480" class="context-line"> <li onclick="toggle('pre1303297323776', 'post1303297323776')"><pre> raise exc</pre> <span>…</span></li> </ol> <ol start='481' class="post-context" id="post1303297323776"> <li onclick="toggle('pre1303297323776', 'post1303297323776')"><pre></pre></li> <li onclick="toggle('pre1303297323776', 'post1303297323776')"><pre> # Note: Views are made CSRF exempt from within `as_view` as to prevent</pre></li> <li onclick="toggle('pre1303297323776', 'post1303297323776')"><pre> # accidental removal of this exemption in cases where `dispatch` needs to</pre></li> <li onclick="toggle('pre1303297323776', 'post1303297323776')"><pre> # be overridden.</pre></li> <li onclick="toggle('pre1303297323776', 'post1303297323776')"><pre> def dispatch(self, request, *args, **kwargs):</pre></li> <li onclick="toggle('pre1303297323776', 'post1303297323776')"><pre> &quot;&quot;&quot;</pre></li> </ol> </div> <details> <summary class="commands">Local vars</summary> <table class="vars" id="v1303297323776"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>exc</td> <td class="code"><pre>ValueError(&#x27;Cannot assign &quot;&lt;django.contrib.auth.models.AnonymousUser object at 0x0000012F72D73C10&gt;&quot;: &quot;Post.author&quot; must be a &quot;User&quot; instance.&#x27;)< /pre></td> </tr> <tr> <td>renderer_format</td> <td class="code"><pre>&#x27;json&#x27;</pre></td> </tr> <tr> <td>request</td> <td class="code"><pre>&lt;rest_framework.request.Request: POST &#x27;/ukstagram/posts/&#x27;&gt;</pre></td> </tr> <tr> <td>self</td> <td class="code"><pre>&lt;ukstagram.views.PostViewSet object at 0x0000012F72D73520&gt;</pre></td> </tr> <tr> <td>use_plaintext_traceback</td> <td class="code"><pre>True</pre></td> </tr> </tbody> </table> </details> </li> <li class="frame user"> <code class="fname">C:\Users\cswoo\.conda\envs\drf\lib\site-packages\rest_framework\views.py</code>, line 506, in dispatch <div class="context" id="c1303297323136"> <ol start="499" class="pre-context" id="pre1303297323136"> <li onclick="toggle('pre1303297323136', 'post1303297323136')"><pre> # Get the appropriate handler method</pre></li> <li onclick="toggle('pre1303297323136', 'post1303297323136')"><pre> if request.method.lower() in self.http_method_names:</pre></li> <li onclick="toggle('pre1303297323136', 'post1303297323136')"><pre> handler = getattr(self, request.method.lower(),</pre></li> <li onclick="toggle('pre1303297323136', 'post1303297323136')"><pre> self.http_method_not_allowed)</pre></li> <li onclick="toggle('pre1303297323136', 'post1303297323136')"><pre> else:</pre></li> <li onclick="toggle('pre1303297323136', 'post1303297323136')"><pre> handler = self.http_method_not_allowed</pre></li> <li onclick="toggle('pre1303297323136', 'post1303297323136')"><pre></pre></li> </ol> <ol start="506" class="context-line"> <li onclick="toggle('pre1303297323136', 'post1303297323136')"><pre> response = handler(request, *args, **kwargs)</pre> <span>…</span></li> </ol> <ol start='507' class="post-context" id="post1303297323136"> <li onclick="toggle('pre1303297323136', 'post1303297323136')"><pre></pre></li> <li onclick="toggle('pre1303297323136', 'post1303297323136')"><pre> except Exception as exc:</pre></li> <li onclick="toggle('pre1303297323136', 'post1303297323136')"><pre> response = self.handle_exception(exc)</pre></li> <li onclick="toggle('pre1303297323136', 'post1303297323136')"><pre></pre></li> <li onclick="toggle('pre1303297323136', 'post1303297323136')"><pre> self.response = self.finalize_response(request, response, *args, **kwargs)</pre></li> <li onclick="toggle('pre1303297323136', 'post1303297323136')"><pre> return self.response</pre></li> </ol> </div> <details> <summary class="commands">Local vars</summary> <table class="vars" id="v1303297323136"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>args</td> <td class="code"><pre>()</pre></td> </tr> <tr> <td>handler</td> <td class="code"><pre>&lt;bound method CreateModelMixin.create of &lt;ukstagram.views.PostViewSet object at 0x0000012F72D73520&gt;&gt;</pre></td> </tr> <tr> <td>kwargs</td> <td class="code"><pre>{}</pre></td> </tr> <tr> <td>request</td> <td class="code"><pre>&lt;rest_framework.request.Request: POST &#x27;/ukstagram/posts/&#x27;&gt;</pre></td> </tr> <tr> <td>self</td> <td class="code"><pre>&lt;ukstagram.views.PostViewSet object at 0x0000012F72D73520&gt;</pre></td> </tr> </tbody> </table> </details> </li> <li class="frame user"> <code class="fname">C:\Users\cswoo\.conda\envs\drf\lib\site-packages\rest_framework\mixins.py</code>, line 19, in create <div class="context" id="c1303297323456"> <ol start="12" class="pre-context" id="pre1303297323456"> <li onclick="toggle('pre1303297323456', 'post1303297323456')"><pre>class CreateModelMixin:</pre></li> <li onclick="toggle('pre1303297323456', 'post1303297323456')"><pre> &quot;&quot;&quot;</pre></li> <li onclick="toggle('pre1303297323456', 'post1303297323456')"><pre> Create a model instance.</pre></li> <li onclick="toggle('pre1303297323456', 'post1303297323456')"><pre> &quot;&quot;&quot;</pre></li> <li onclick="toggle('pre1303297323456', 'post1303297323456')"><pre> def create(self, request, *args, **kwargs):</pre></li> <li onclick="toggle('pre1303297323456', 'post1303297323456')"><pre> serializer = self.get_serializer(data=request.data)</pre></li> <li onclick="toggle('pre1303297323456', 'post1303297323456')"><pre> serializer.is_valid(raise_exception=True)</pre></li> </ol> <ol start="19" class="context-line"> <li onclick="toggle('pre1303297323456', 'post1303297323456')"><pre> self.perform_create(serializer)</pre> <span>…</span></li> </ol> <ol start='20' class="post-context" id="post1303297323456"> <li onclick="toggle('pre1303297323456', 'post1303297323456')"><pre> headers = self.get_success_headers(serializer.data)</pre></li> <li onclick="toggle('pre1303297323456', 'post1303297323456')"><pre> return Response(serializer.data, status=status.HTTP_201_CREATED, headers=headers)</pre></li> <li onclick="toggle('pre1303297323456', 'post1303297323456')"><pre></pre></li> <li onclick="toggle('pre1303297323456', 'post1303297323456')"><pre> def perform_create(self, serializer):</pre></li> <li onclick="toggle('pre1303297323456', 'post1303297323456')"><pre> serializer.save()</pre></li> <li onclick="toggle('pre1303297323456', 'post1303297323456')"><pre></pre></li> </ol> </div> <details> <summary class="commands">Local vars</summary> <table class="vars" id="v1303297323456"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>args</td> <td class="code"><pre>()</pre></td> </tr> <tr> <td>kwargs</td> <td class="code"><pre>{}</pre></td> </tr> <tr> <td>request</td> <td class="code"><pre>&lt;rest_framework.request.Request: POST &#x27;/ukstagram/posts/&#x27;&gt;</pre></td> </tr> <tr> <td>self</td> <td class="code"><pre>&lt;ukstagram.views.PostViewSet object at 0x0000012F72D73520&gt;</pre></td> </tr> <tr> <td>serializer</td> <td class="code"><pre>PostSerializer(context={&#x27;request&#x27;: &lt;rest_framework.request.Request: POST &#x27;/ukstagram/posts/&#x27;&gt;, &#x27;format&#x27;: None, &#x27;view&#x27;: &lt;ukstagram.views.PostV iewSet object&gt;}, data={&#x27;message&#x27;: &#x27;23th post&#x27;, &#x27;is_public&#x27;: &#x27;true&#x27;}): pk = IntegerField(label=&#x27;ID&#x27;, read_only=True) username = ReadOnlyField(source=&#x27;author.username&#x27;) message = CharField(style={&#x27;base_template&#x27;: &#x27;textarea.html&#x27;}) created_at = DateTimeField(read_only=True) updated_at = DateTimeField(read_only=True) is_public = BooleanField(required=False)</pre></td> </tr> </tbody> </table> </details> </li> <li class="frame user"> <code class="fname">C:\Users\cswoo\OneDrive\Documents\DRF\ukstagram\views.py</code>, line 46, in perform_create <div class="context" id="c1303297326656"> <ol start="39" class="pre-context" id="pre1303297326656"> <li onclick="toggle('pre1303297326656', 'post1303297326656')"><pre> # serializer = self.get_serializer(data=request.data)</pre></li> <li onclick="toggle('pre1303297326656', 'post1303297326656')"><pre> # if serializer.is_valid():</pre></li> <li onclick="toggle('pre1303297326656', 'post1303297326656')"><pre> # serializer.save(author=request.user)</pre></li> <li onclick="toggle('pre1303297326656', 'post1303297326656')"><pre> # return Response(serializer.data, status=status.HTTP_201_CREATED)</pre></li> <li onclick="toggle('pre1303297326656', 'post1303297326656')"><pre> # return Response(status=status.HTTP_400_BAD_REQUEST)</pre></li> <li onclick="toggle('pre1303297326656', 'post1303297326656')"><pre></pre></li> <li onclick="toggle('pre1303297326656', 'post1303297326656')"><pre> def perform_create(self, serializer):</pre></li> </ol> <ol start="46" class="context-line"> <li onclick="toggle('pre1303297326656', 'post1303297326656')"><pre> serializer.save(author=self.request.user)</pre> <span>…</span></li> </ol> <ol start='47' class="post-context" id="post1303297326656"> <li onclick="toggle('pre1303297326656', 'post1303297326656')"><pre></pre></li> <li onclick="toggle('pre1303297326656', 'post1303297326656')"><pre> @action(detail=False, methods=[&#x27;GET&#x27;])</pre></li> <li onclick="toggle('pre1303297326656', 'post1303297326656')"><pre> def public(self, request):</pre></li> <li onclick="toggle('pre1303297326656', 'post1303297326656')"><pre> qs = self.get_queryset().filter(is_public=True)</pre></li> <li onclick="toggle('pre1303297326656', 'post1303297326656')"><pre> serializer = self.get_serializer(instance=qs, many=True)</pre></li> <li onclick="toggle('pre1303297326656', 'post1303297326656')"><pre> return Response(serializer.data)</pre></li> </ol> </div> <details> <summary class="commands">Local vars</summary> <table class="vars" id="v1303297326656"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>self</td> <td class="code"><pre>&lt;ukstagram.views.PostViewSet object at 0x0000012F72D73520&gt;</pre></td> </tr> <tr> <td>serializer</td> <td class="code"><pre>PostSerializer(context={&#x27;request&#x27;: &lt;rest_framework.request.Request: POST &#x27;/ukstagram/posts/&#x27;&gt;, &#x27;format&#x27;: None, &#x27;view&#x27;: &lt;ukstagram.views.PostV iewSet object&gt;}, data={&#x27;message&#x27;: &#x27;23th post&#x27;, &#x27;is_public&#x27;: &#x27;true&#x27;}): pk = IntegerField(label=&#x27;ID&#x27;, read_only=True) username = ReadOnlyField(source=&#x27;author.username&#x27;) message = CharField(style={&#x27;base_template&#x27;: &#x27;textarea.html&#x27;}) created_at = DateTimeField(read_only=True) updated_at = DateTimeField(read_only=True) is_public = BooleanField(required=False)</pre></td> </tr> </tbody> </table> </details> </li> <li class="frame user"> <code class="fname">C:\Users\cswoo\.conda\envs\drf\lib\site-packages\rest_framework\serializers.py</code>, line 212, in save <div class="context" id="c1303297323584"> <ol start="205" class="pre-context" id="pre1303297323584"> <li onclick="toggle('pre1303297323584', 'post1303297323584')"><pre></pre></li> <li onclick="toggle('pre1303297323584', 'post1303297323584')"><pre> if self.instance is not None:</pre></li> <li onclick="toggle('pre1303297323584', 'post1303297323584')"><pre> self.instance = self.update(self.instance, validated_data)</pre></li> <li onclick="toggle('pre1303297323584', 'post1303297323584')"><pre> assert self.instance is not None, (</pre></li> <li onclick="toggle('pre1303297323584', 'post1303297323584')"><pre> &#x27;`update()` did not return an object instance.&#x27;</pre></li> <li onclick="toggle('pre1303297323584', 'post1303297323584')"><pre> )</pre></li> <li onclick="toggle('pre1303297323584', 'post1303297323584')"><pre> else:</pre></li> </ol> <ol start="212" class="context-line"> <li onclick="toggle('pre1303297323584', 'post1303297323584')"><pre> self.instance = self.create(validated_data)</pre> <span>…</span></li> </ol> <ol start='213' class="post-context" id="post1303297323584"> <li onclick="toggle('pre1303297323584', 'post1303297323584')"><pre> assert self.instance is not None, (</pre></li> <li onclick="toggle('pre1303297323584', 'post1303297323584')"><pre> &#x27;`create()` did not return an object instance.&#x27;</pre></li> <li onclick="toggle('pre1303297323584', 'post1303297323584')"><pre> )</pre></li> <li onclick="toggle('pre1303297323584', 'post1303297323584')"><pre></pre></li> <li onclick="toggle('pre1303297323584', 'post1303297323584')"><pre> return self.instance</pre></li> <li onclick="toggle('pre1303297323584', 'post1303297323584')"><pre></pre></li> </ol> </div> <details> <summary class="commands">Local vars</summary> <table class="vars" id="v1303297323584"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>kwargs</td> <td class="code"><pre>{&#x27;author&#x27;: &lt;django.contrib.auth.models.AnonymousUser object at 0x0000012F72D73C10&gt;}</pre></td> </tr> <tr> <td>self</td> <td class="code"><pre>PostSerializer(context={&#x27;request&#x27;: &lt;rest_framework.request.Request: POST &#x27;/ukstagram/posts/&#x27;&gt;, &#x27;format&#x27;: None, &#x27;view&#x27;: &lt;ukstagram.views.PostV iewSet object&gt;}, data={&#x27;message&#x27;: &#x27;23th post&#x27;, &#x27;is_public&#x27;: &#x27;true&#x27;}): pk = IntegerField(label=&#x27;ID&#x27;, read_only=True) username = ReadOnlyField(source=&#x27;author.username&#x27;) message = CharField(style={&#x27;base_template&#x27;: &#x27;textarea.html&#x27;}) created_at = DateTimeField(read_only=True) updated_at = DateTimeField(read_only=True) is_public = BooleanField(required=False)</pre></td> </tr> <tr> <td>validated_data</td> <td class="code"><pre>{&#x27;author&#x27;: &lt;django.contrib.auth.models.AnonymousUser object at 0x0000012F72D73C10&gt;, &#x27;is_public&#x27;: True, &#x27;message&#x27;: &#x27;23th post&#x27;}</pre></td> </tr> </tbody> </table> </details> </li> <li class="frame user"> <code class="fname">C:\Users\cswoo\.conda\envs\drf\lib\site-packages\rest_framework\serializers.py</code>, line 962, in create <div class="context" id="c1303297326272"> <ol start="955" class="pre-context" id="pre1303297326272"> <li onclick="toggle('pre1303297326272', 'post1303297326272')"><pre> info = model_meta.get_field_info(ModelClass)</pre></li> <li onclick="toggle('pre1303297326272', 'post1303297326272')"><pre> many_to_many = {}</pre></li> <li onclick="toggle('pre1303297326272', 'post1303297326272')"><pre> for field_name, relation_info in info.relations.items():</pre></li> <li onclick="toggle('pre1303297326272', 'post1303297326272')"><pre> if relation_info.to_many and (field_name in validated_data):</pre></li> <li onclick="toggle('pre1303297326272', 'post1303297326272')"><pre> many_to_many[field_name] = validated_data.pop(field_name)</pre></li> <li onclick="toggle('pre1303297326272', 'post1303297326272')"><pre></pre></li> <li onclick="toggle('pre1303297326272', 'post1303297326272')"><pre> try:</pre></li> </ol> <ol start="962" class="context-line"> <li onclick="toggle('pre1303297326272', 'post1303297326272')"><pre> instance = ModelClass._default_manager.create(**validated_data)</pre> <span>…</span></li> </ol> <ol start='963' class="post-context" id="post1303297326272"> <li onclick="toggle('pre1303297326272', 'post1303297326272')"><pre> except TypeError:</pre></li> <li onclick="toggle('pre1303297326272', 'post1303297326272')"><pre> tb = traceback.format_exc()</pre></li> <li onclick="toggle('pre1303297326272', 'post1303297326272')"><pre> msg = (</pre></li> <li onclick="toggle('pre1303297326272', 'post1303297326272')"><pre> &#x27;Got a `TypeError` when calling `%s.%s.create()`. &#x27;</pre></li> <li onclick="toggle('pre1303297326272', 'post1303297326272')"><pre> &#x27;This may be because you have a writable field on the &#x27;</pre></li> <li onclick="toggle('pre1303297326272', 'post1303297326272')"><pre> &#x27;serializer class that is not a valid argument to &#x27;</pre></li> </ol> </div> <details> <summary class="commands">Local vars</summary> <table class="vars" id="v1303297326272"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>ModelClass</td> <td class="code"><pre>&lt;class &#x27;ukstagram.models.Post&#x27;&gt;</pre></td> </tr> <tr> <td>field_name</td> <td class="code"><pre>&#x27;author&#x27;</pre></td> </tr> <tr> <td>info</td> <td class="code"><pre>FieldResult(pk=&lt;django.db.models.fields.BigAutoField: id&gt;, fields=OrderedDict([(&#x27;message&#x27;, &lt;django.db.models.fields.TextField: message&gt;), (&#x27;created_at&#x27;, &lt;d jango.db.models.fields.DateTimeField: created_at&gt;), (&#x27;updated_at&#x27;, &lt;django.db.models.fields.DateTimeField: updated_at&gt;), (&#x27;is_public&#x27;, &lt;django.db.models.fields.BooleanField: is_public&gt;)]), forward_ relations=OrderedDict([(&#x27;author&#x27;, RelationInfo(model_field=&lt;django.db.models.fields.related.ForeignKey: author&gt;, related_model=&lt;class &#x27;django.contrib.auth.models.User&#x27;&gt;, to_many=False, to_field=None, has_through_model=False, reverse=False))]), reverse_relations=OrderedDict(), fields_and_pk=OrderedDict([(&#x27;pk&#x27;, &lt;django.db.models.fields.BigAutoField: id&gt;), (&#x27;id&#x27;, &lt;django.db.models.fields.BigAutoField: i d&gt;), (&#x27;message&#x27;, &lt;django.db.models.fields.TextField: message&gt;), (&#x27;created_at&#x27;, &lt;django.db.models.fields.DateTimeField: created_at&gt;), (&#x27;updated_at&#x27;, &lt;django.db.models.fields.DateTimeFie ld: updated_at&gt;), (&#x27;is_public&#x27;, &lt;django.db.models.fields.BooleanField: is_public&gt;)]), relations=OrderedDict([(&#x27;author&#x27;, RelationInfo(model_field=&lt;django.db.models.fields.related.ForeignKey: author&gt; , related_model=&lt;class &#x27;django.contrib.auth.models.User&#x27;&gt;, to_many=False, to_field=None, has_through_model=False, reverse=False))]))</pre></td> </tr> <tr> <td>many_to_many</td> <td class="code"><pre>{}</pre></td> </tr> <tr> <td>relation_info</td> <td class="code"><pre>RelationInfo(model_field=&lt;django.db.models.fields.related.ForeignKey: author&gt;, related_model=&lt;class &#x27;django.contrib.auth.models.User&#x27;&gt;, to_many=False, to_field=None, ha s_through_model=False, reverse=False)</pre></td> </tr> <tr> <td>self</td> <td class="code"><pre>PostSerializer(context={&#x27;request&#x27;: &lt;rest_framework.request.Request: POST &#x27;/ukstagram/posts/&#x27;&gt;, &#x27;format&#x27;: None, &#x27;view&#x27;: &lt;ukstagram.views.PostV iewSet object&gt;}, data={&#x27;message&#x27;: &#x27;23th post&#x27;, &#x27;is_public&#x27;: &#x27;true&#x27;}): pk = IntegerField(label=&#x27;ID&#x27;, read_only=True) username = ReadOnlyField(source=&#x27;author.username&#x27;) message = CharField(style={&#x27;base_template&#x27;: &#x27;textarea.html&#x27;}) created_at = DateTimeField(read_only=True) updated_at = DateTimeField(read_only=True) is_public = BooleanField(required=False)</pre></td> </tr> <tr> <td>validated_data</td> <td class="code"><pre>{&#x27;author&#x27;: &lt;django.contrib.auth.models.AnonymousUser object at 0x0000012F72D73C10&gt;, &#x27;is_public&#x27;: True, &#x27;message&#x27;: &#x27;23th post&#x27;}</pre></td> </tr> </tbody> </table> </details> </li> <li class="frame django"> <code class="fname">C:\Users\cswoo\.conda\envs\drf\lib\site-packages\django\db\models\manager.py</code>, line 85, in manager_method <div class="context" id="c1303297323072"> <ol start="78" class="pre-context" id="pre1303297323072"> <li onclick="toggle('pre1303297323072', 'post1303297323072')"><pre> def check(self, **kwargs):</pre></li> <li onclick="toggle('pre1303297323072', 'post1303297323072')"><pre> return []</pre></li> <li onclick="toggle('pre1303297323072', 'post1303297323072')"><pre></pre></li> <li onclick="toggle('pre1303297323072', 'post1303297323072')"><pre> @classmethod</pre></li> <li onclick="toggle('pre1303297323072', 'post1303297323072')"><pre> def _get_queryset_methods(cls, queryset_class):</pre></li> <li onclick="toggle('pre1303297323072', 'post1303297323072')"><pre> def create_method(name, method):</pre></li> <li onclick="toggle('pre1303297323072', 'post1303297323072')"><pre> def manager_method(self, *args, **kwargs):</pre></li> </ol> <ol start="85" class="context-line"> <li onclick="toggle('pre1303297323072', 'post1303297323072')"><pre> return getattr(self.get_queryset(), name)(*args, **kwargs)</pre> <span>…</span></li> </ol> <ol start='86' class="post-context" id="post1303297323072"> <li onclick="toggle('pre1303297323072', 'post1303297323072')"><pre></pre></li> <li onclick="toggle('pre1303297323072', 'post1303297323072')"><pre> manager_method.__name__ = method.__name__</pre></li> <li onclick="toggle('pre1303297323072', 'post1303297323072')"><pre> manager_method.__doc__ = method.__doc__</pre></li> <li onclick="toggle('pre1303297323072', 'post1303297323072')"><pre> return manager_method</pre></li> <li onclick="toggle('pre1303297323072', 'post1303297323072')"><pre></pre></li> <li onclick="toggle('pre1303297323072', 'post1303297323072')"><pre> new_methods = {}</pre></li> </ol> </div> <details> <summary class="commands">Local vars</summary> <table class="vars" id="v1303297323072"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>args</td> <td class="code"><pre>()</pre></td> </tr> <tr> <td>kwargs</td> <td class="code"><pre>{&#x27;author&#x27;: &lt;django.contrib.auth.models.AnonymousUser object at 0x0000012F72D73C10&gt;, &#x27;is_public&#x27;: True, &#x27;message&#x27;: &#x27;23th post&#x27;}</pre></td> </tr> <tr> <td>name</td> <td class="code"><pre>&#x27;create&#x27;</pre></td> </tr> <tr> <td>self</td> <td class="code"><pre>&lt;django.db.models.manager.Manager object at 0x0000012F726530D0&gt;</pre></td> </tr> </tbody> </table> </details> </li> <li class="frame django"> <code class="fname">C:\Users\cswoo\.conda\envs\drf\lib\site-packages\django\db\models\query.py</code>, line 512, in create <div class="context" id="c1303301874176"> <ol start="505" class="pre-context" id="pre1303301874176"> <li onclick="toggle('pre1303301874176', 'post1303301874176')"><pre> )</pre></li> <li onclick="toggle('pre1303301874176', 'post1303301874176')"><pre></pre></li> <li onclick="toggle('pre1303301874176', 'post1303301874176')"><pre> def create(self, **kwargs):</pre></li> <li onclick="toggle('pre1303301874176', 'post1303301874176')"><pre> &quot;&quot;&quot;</pre></li> <li onclick="toggle('pre1303301874176', 'post1303301874176')"><pre> Create a new object with the given kwargs, saving it to the database</pre></li> <li onclick="toggle('pre1303301874176', 'post1303301874176')"><pre> and returning the created object.</pre></li> <li onclick="toggle('pre1303301874176', 'post1303301874176')"><pre> &quot;&quot;&quot;</pre></li> </ol> <ol start="512" class="context-line"> <li onclick="toggle('pre1303301874176', 'post1303301874176')"><pre> obj = self.model(**kwargs)</pre> <span>…</span></li> </ol> <ol start='513' class="post-context" id="post1303301874176"> <li onclick="toggle('pre1303301874176', 'post1303301874176')"><pre> self._for_write = True</pre></li> <li onclick="toggle('pre1303301874176', 'post1303301874176')"><pre> obj.save(force_insert=True, using=self.db)</pre></li> <li onclick="toggle('pre1303301874176', 'post1303301874176')"><pre> return obj</pre></li> <li onclick="toggle('pre1303301874176', 'post1303301874176')"><pre></pre></li> <li onclick="toggle('pre1303301874176', 'post1303301874176')"><pre> def _prepare_for_bulk_create(self, objs):</pre></li> <li onclick="toggle('pre1303301874176', 'post1303301874176')"><pre> for obj in objs:</pre></li> </ol> </div> <details> <summary class="commands">Local vars</summary> <table class="vars" id="v1303301874176"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>kwargs</td> <td class="code"><pre>{&#x27;author&#x27;: &lt;django.contrib.auth.models.AnonymousUser object at 0x0000012F72D73C10&gt;, &#x27;is_public&#x27;: True, &#x27;message&#x27;: &#x27;23th post&#x27;}</pre></td> </tr> <tr> <td>self</td> <td class="code"><pre>&lt;QuerySet [&lt;Post: Post object (1)&gt;, &lt;Post: Post object (2)&gt;, &lt;Post: Post object (3)&gt;, &lt;Post: Post object (4)&gt;, &lt;Post: Post object (5)&gt;, &lt;Post: Post object (6)&gt;, &lt;Post: Post object (7)&gt;, &lt;Post: Post object (8)&gt;, &lt;Post: Post object (10)&gt;, &lt;Post: Post object (11)&gt;, &lt;Post: Post object (12)&gt;, &lt;Post: Post object (13)&gt;, &lt;Post: Post object (14)&gt;, &lt;Post: Post object (15)&gt;, &lt;Post: Post object (16)&gt;, &lt;Post: Post object (17)&gt;, &lt;Post: Post object (18)&gt;, &lt;Post: Post object (19)&gt;, &lt;Post: Post object (20)&gt;, &lt;Post: Post object (21)&gt;, &#x27;.. .(remaining elements truncated)...&#x27;]&gt;</pre></td> </tr> </tbody> </table> </details> </li> <li class="frame django"> <code class="fname">C:\Users\cswoo\.conda\envs\drf\lib\site-packages\django\db\models\base.py</code>, line 541, in __init__ <div class="context" id="c1303301877120"> <ol start="534" class="pre-context" id="pre1303301877120"> <li onclick="toggle('pre1303301877120', 'post1303301877120')"><pre></pre></li> <li onclick="toggle('pre1303301877120', 'post1303301877120')"><pre> if is_related_object:</pre></li> <li onclick="toggle('pre1303301877120', 'post1303301877120')"><pre> # If we are passed a related instance, set it using the</pre></li> <li onclick="toggle('pre1303301877120', 'post1303301877120')"><pre> # field.name instead of field.attname (e.g. &quot;user&quot; instead of</pre></li> <li onclick="toggle('pre1303301877120', 'post1303301877120')"><pre> # &quot;user_id&quot;) so that the object gets properly cached (and type</pre></li> <li onclick="toggle('pre1303301877120', 'post1303301877120')"><pre> # checked) by the RelatedObjectDescriptor.</pre></li> <li onclick="toggle('pre1303301877120', 'post1303301877120')"><pre> if rel_obj is not _DEFERRED:</pre></li> </ol> <ol start="541" class="context-line"> <li onclick="toggle('pre1303301877120', 'post1303301877120')"><pre> _setattr(self, field.name, rel_obj)</pre> <span>…</span></li> </ol> <ol start='542' class="post-context" id="post1303301877120"> <li onclick="toggle('pre1303301877120', 'post1303301877120')"><pre> else:</pre></li> <li onclick="toggle('pre1303301877120', 'post1303301877120')"><pre> if val is not _DEFERRED:</pre></li> <li onclick="toggle('pre1303301877120', 'post1303301877120')"><pre> _setattr(self, field.attname, val)</pre></li> <li onclick="toggle('pre1303301877120', 'post1303301877120')"><pre></pre></li> <li onclick="toggle('pre1303301877120', 'post1303301877120')"><pre> if kwargs:</pre></li> <li onclick="toggle('pre1303301877120', 'post1303301877120')"><pre> property_names = opts._property_names</pre></li> </ol> </div> <details> <summary class="commands">Local vars</summary> <table class="vars" id="v1303301877120"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>_DEFERRED</td> <td class="code"><pre>&lt;Deferred field&gt;</pre></td> </tr> <tr> <td>__class__</td> <td class="code"><pre>&lt;class &#x27;django.db.models.base.Model&#x27;&gt;</pre></td> </tr> <tr> <td>_setattr</td> <td class="code"><pre>&lt;built-in function setattr&gt;</pre></td> </tr> <tr> <td>args</td> <td class="code"><pre>()</pre></td> </tr> <tr> <td>cls</td> <td class="code"><pre>&lt;class &#x27;ukstagram.models.Post&#x27;&gt;</pre></td> </tr> <tr> <td>field</td> <td class="code"><pre>&lt;django.db.models.fields.related.ForeignKey: author&gt;</pre></td> </tr> <tr> <td>fields_iter</td> <td class="code"><pre>&lt;tuple_iterator object at 0x0000012F72D73D60&gt;</pre></td> </tr> <tr> <td>is_related_object</td> <td class="code"><pre>True</pre></td> </tr> <tr> <td>kwargs</td> <td class="code"><pre>{&#x27;is_public&#x27;: True, &#x27;message&#x27;: &#x27;23th post&#x27;}</pre></td> </tr> <tr> <td>opts</td> <td class="code"><pre>&lt;Options for Post&gt;</pre></td> </tr> <tr> <td>rel_obj</td> <td class="code"><pre>&lt;django.contrib.auth.models.AnonymousUser object at 0x0000012F72D73C10&gt;</pre></td> </tr> <tr> <td>self</td> <td class="code"><pre>&lt;Post: Post object (None)&gt;</pre></td> </tr> <tr> <td>val</td> <td class="code"><pre>None</pre></td> </tr> </tbody> </table> </details> </li> <li class="frame django"> <code class="fname">C:\Users\cswoo\.conda\envs\drf\lib\site-packages\django\db\models\fields\related_descriptors.py</code>, line 235, in __set__ <div class="context" id="c1303301876544"> <ol start="228" class="pre-context" id="pre1303301876544"> <li onclick="toggle('pre1303301876544', 'post1303301876544')"><pre> - ``instance`` is the ``child`` instance</pre></li> <li onclick="toggle('pre1303301876544', 'post1303301876544')"><pre> - ``value`` is the ``parent`` instance on the right of the equal sign</pre></li> <li onclick="toggle('pre1303301876544', 'post1303301876544')"><pre> &quot;&quot;&quot;</pre></li> <li onclick="toggle('pre1303301876544', 'post1303301876544')"><pre> # An object must be an instance of the related class.</pre></li> <li onclick="toggle('pre1303301876544', 'post1303301876544')"><pre> if value is not None and not isinstance(</pre></li> <li onclick="toggle('pre1303301876544', 'post1303301876544')"><pre> value, self.field.remote_field.model._meta.concrete_model</pre></li> <li onclick="toggle('pre1303301876544', 'post1303301876544')"><pre> ):</pre></li> </ol> <ol start="235" class="context-line"> <li onclick="toggle('pre1303301876544', 'post1303301876544')"><pre> raise ValueError(</pre> <span>…</span></li> </ol> <ol start='236' class="post-context" id="post1303301876544"> <li onclick="toggle('pre1303301876544', 'post1303301876544')"><pre> &#x27;Cannot assign &quot;%r&quot;: &quot;%s.%s&quot; must be a &quot;%s&quot; instance.&#x27;</pre></li> <li onclick="toggle('pre1303301876544', 'post1303301876544')"><pre> % (</pre></li> <li onclick="toggle('pre1303301876544', 'post1303301876544')"><pre> value,</pre></li> <li onclick="toggle('pre1303301876544', 'post1303301876544')"><pre> instance._meta.object_name,</pre></li> <li onclick="toggle('pre1303301876544', 'post1303301876544')"><pre> self.field.name,</pre></li> <li onclick="toggle('pre1303301876544', 'post1303301876544')"><pre> self.field.remote_field.model._meta.object_name,</pre></li> </ol> </div> <details> <summary class="commands">Local vars</summary> <table class="vars" id="v1303301876544"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>instance</td> <td class="code"><pre>&lt;Post: Post object (None)&gt;</pre></td> </tr> <tr> <td>self</td> <td class="code"><pre>&lt;django.db.models.fields.related_descriptors.ForwardManyToOneDescriptor object at 0x0000012F717A5670&gt;</pre></td> </tr> <tr> <td>value</td> <td class="code"><pre>&lt;django.contrib.auth.models.AnonymousUser object at 0x0000012F72D73C10&gt;</pre></td> </tr> </tbody> </table> </details> </li> </ul> </div> <form action="https://dpaste.com/" name="pasteform" id="pasteform" method="post"> <div id="pastebinTraceback" class="pastebin"> <input type="hidden" name="language" value="PythonConsole"> <input type="hidden" name="title" value="ValueError at /ukstagram/posts/"> <input type="hidden" name="source" value="Django Dpaste Agent"> <input type="hidden" name="poster" value="Django"> <textarea name="content" id="traceback_area" cols="140" rows="25"> Environment: Request Method: POST Request URL: http://localhost:8000/ukstagram/posts/ Django Version: 4.0.4 Python Version: 3.8.12 Installed Applications: [&#x27;django.contrib.admin&#x27;, &#x27;django.contrib.auth&#x27;, &#x27;django.contrib.contenttypes&#x27;, &#x27;django.contrib.sessions&#x27;, &#x27;django.contrib.messages&#x27;, &#x27;django.contrib.staticfiles&#x27;, &#x27;rest_framework&#x27;, &#x27;ukstagram&#x27;] Installed Middleware: [&#x27;django.middleware.security.SecurityMiddleware&#x27;, &#x27;django.contrib.sessions.middleware.SessionMiddleware&#x27;, &#x27;django.middleware.common.CommonMiddleware&#x27;, &#x27;django.middleware.csrf.CsrfViewMiddleware&#x27;, &#x27;django.contrib.auth.middleware.AuthenticationMiddleware&#x27;, &#x27;django.contrib.messages.middleware.MessageMiddleware&#x27;, &#x27;django.middleware.clickjacking.XFrameOptionsMiddleware&#x27;] Traceback (most recent call last): File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\django\core\handlers\exception.py", line 55, in inner response = get_response(request) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\django\core\handlers\base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\django\views\decorators\csrf.py", line 54, in wrapped_view return view_func(*args, **kwargs) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\rest_framework\viewsets.py", line 125, in view return self.dispatch(request, *args, **kwargs) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\rest_framework\views.py", line 509, in dispatch response = self.handle_exception(exc) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\rest_framework\views.py", line 469, in handle_exception self.raise_uncaught_exception(exc) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\rest_framework\views.py", line 480, in raise_uncaught_exception raise exc File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\rest_framework\views.py", line 506, in dispatch response = handler(request, *args, **kwargs) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\rest_framework\mixins.py", line 19, in create self.perform_create(serializer) File "C:\Users\cswoo\OneDrive\Documents\DRF\ukstagram\views.py", line 46, in perform_create serializer.save(author=self.request.user) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\rest_framework\serializers.py", line 212, in save self.instance = self.create(validated_data) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\rest_framework\serializers.py", line 962, in create instance = ModelClass._default_manager.create(**validated_data) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\django\db\models\manager.py", line 85, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\django\db\models\query.py", line 512, in create obj = self.model(**kwargs) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\django\db\models\base.py", line 541, in __init__ _setattr(self, field.name, rel_obj) File "C:\Users\cswoo\.conda\envs\drf\lib\site-packages\django\db\models\fields\related_descriptors.py", line 235, in __set__ raise ValueError( Exception Type: ValueError at /ukstagram/posts/ Exception Value: Cannot assign &quot;&lt;django.contrib.auth.models.AnonymousUser object at 0x0000012F72D73C10&gt;&quot;: &quot;Post.author&quot; must be a &quot;User&quot; instance. </textarea> <br><br> <input type="submit" value="Share this traceback on a public website"> </div> </form> </div> <div id="requestinfo"> <h2>Request information</h2> <h3 id="user-info">USER</h3> <p>AnonymousUser</p> <h3 id="get-info">GET</h3> <p>No GET data</p> <h3 id="post-info">POST</h3> <p>No POST data</p> <h3 id="files-info">FILES</h3> <p>No FILES data</p> <h3 id="cookie-info">COOKIES</h3> <p>No cookie data</p> <h3 id="meta-info">META</h3> <table class="req"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>ALLUSERSPROFILE</td> <td class="code"><pre>&#x27;C:\\ProgramData&#x27;</pre></td> </tr> <tr> <td>APPDATA</td> <td class="code"><pre>&#x27;C:\\Users\\cswoo\\AppData\\Roaming&#x27;</pre></td> </tr> <tr> <td>CLSID</td> <td class="code"><pre>&#x27;{290BFAA9-A9FC-AD78-7B4F-4803F0742CCA}&#x27;</pre></td> </tr> <tr> <td>COMMONPROGRAMFILES</td> <td class="code"><pre>&#x27;C:\\Program Files\\Common Files&#x27;</pre></td> </tr> <tr> <td>COMMONPROGRAMFILES(X86)</td> <td class="code"><pre>&#x27;C:\\Program Files (x86)\\Common Files&#x27;</pre></td> </tr> <tr> <td>COMMONPROGRAMW6432</td> <td class="code"><pre>&#x27;C:\\Program Files\\Common Files&#x27;</pre></td> </tr> <tr> <td>COMPUTERNAME</td> <td class="code"><pre>&#x27;DESKTOP-9D39MMH&#x27;</pre></td> </tr> <tr> <td>COMSPEC</td> <td class="code"><pre>&#x27;C:\\WINDOWS\\system32\\cmd.exe&#x27;</pre></td> </tr> <tr> <td>CONDA_DEFAULT_ENV</td> <td class="code"><pre>&#x27;drf&#x27;</pre></td> </tr> <tr> <td>CONDA_PREFIX</td> <td class="code"><pre>&#x27;C:\\Users\\cswoo\\.conda\\envs\\drf&#x27;</pre></td> </tr> <tr> <td>CONDA_PROMPT_MODIFIER</td> <td class="code"><pre>&#x27;(drf) &#x27;</pre></td> </tr> <tr> <td>CONDA_SHLVL</td> <td class="code"><pre>&#x27;1&#x27;</pre></td> </tr> <tr> <td>CONTENT_LENGTH</td> <td class="code"><pre>&#x27;45&#x27;</pre></td> </tr> <tr> <td>CONTENT_TYPE</td> <td class="code"><pre>&#x27;application/json&#x27;</pre></td> </tr> <tr> <td>DJANGO_SETTINGS_MODULE</td> <td class="code"><pre>&#x27;DRF.settings&#x27;</pre></td> </tr> <tr> <td>DRIVERDATA</td> <td class="code"><pre>&#x27;C:\\Windows\\System32\\Drivers\\DriverData&#x27;</pre></td> </tr> <tr> <td>FPS_BROWSER_APP_PROFILE_STRING</td> <td class="code"><pre>&#x27;Internet Explorer&#x27;</pre></td> </tr> <tr> <td>FPS_BROWSER_USER_PROFILE_STRING</td> <td class="code"><pre>&#x27;Default&#x27;</pre></td> </tr> <tr> <td>GATEWAY_INTERFACE</td> <td class="code"><pre>&#x27;CGI/1.1&#x27;</pre></td> </tr> <tr> <td>GOOGLE_API_KEY</td> <td class="code"><pre>&#x27;********************&#x27;</pre></td> </tr> <tr> <td>GOOGLE_DEFAULT_CLIENT_ID</td> <td class="code"><pre>&#x27;no&#x27;</pre></td> </tr> <tr> <td>GOOGLE_DEFAULT_CLIENT_SECRET</td> <td class="code"><pre>&#x27;********************&#x27;</pre></td> </tr> <tr> <td>HOMEDRIVE</td> <td class="code"><pre>&#x27;C:&#x27;</pre></td> </tr> <tr> <td>HOMEPATH</td> <td class="code"><pre>&#x27;\\Users\\cswoo&#x27;</pre></td> </tr> <tr> <td>HTTP_ACCEPT</td> <td class="code"><pre>&#x27;application/json, */*;q=0.5&#x27;</pre></td> </tr> <tr> <td>HTTP_ACCEPT_ENCODING</td> <td class="code"><pre>&#x27;gzip, deflate&#x27;</pre></td> </tr> <tr> <td>HTTP_CONNECTION</td> <td class="code"><pre>&#x27;keep-alive&#x27;</pre></td> </tr> <tr> <td>HTTP_HOST</td> <td class="code"><pre>&#x27;localhost:8000&#x27;</pre></td> </tr> <tr> <td>HTTP_USER_AGENT</td> <td class="code"><pre>&#x27;HTTPie/3.1.0&#x27;</pre></td> </tr> <tr> <td>IDEA_INITIAL_DIRECTORY</td> <td class="code"><pre>&#x27;C:\\Users\\cswoo\\OneDrive\\Documents&#x27;</pre></td> </tr> <tr> <td>LOCALAPPDATA</td> <td class="code"><pre>&#x27;C:\\Users\\cswoo\\AppData\\Local&#x27;</pre></td> </tr> <tr> <td>LOGONSERVER</td> <td class="code"><pre>&#x27;\\\\DESKTOP-9D39MMH&#x27;</pre></td> </tr> <tr> <td>NUMBER_OF_PROCESSORS</td> <td class="code"><pre>&#x27;6&#x27;</pre></td> </tr> <tr> <td>ONEDRIVE</td> <td class="code"><pre>&#x27;C:\\Users\\cswoo\\OneDrive&#x27;</pre></td> </tr> <tr> <td>ONEDRIVECONSUMER</td> <td class="code"><pre>&#x27;C:\\Users\\cswoo\\OneDrive&#x27;</pre></td> </tr> <tr> <td>OS</td> <td class="code"><pre>&#x27;Windows_NT&#x27;</pre></td> </tr> <tr> <td>PATH</td> <td class="code"><pre>(&#x27;C:\\Users\\cswoo\\.conda\\envs\\drf;C:\\Users\\cswoo\\.conda\\envs\\drf\\Library\\mingw-w64\\bin;C:\\Users\\cswoo\\.conda\\envs\\drf\\Library\\usr\\bin;C:\\Users\\cswoo\\.conda\\envs\\drf\\Libr ary\\bin;C:\\Users\\cswoo\\.conda\\envs\\drf\\Scripts;C:\\Users\\cswoo\\.conda\\envs\\drf\\bin;C:\\ProgramData\\Anaconda3\\condabin;C:\\ProgramData\\Anaconda3;C:\\ProgramData\\Anaconda3\\Library\\mingw-w64\\bin;C:\\ProgramData\\Anac onda3\\Library\\usr\\bin;C:\\ProgramData\\Anaconda3\\Library\\bin;C:\\ProgramData\\Anaconda3\\Scripts;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0;C:\\WINDOWS\\System32 \\OpenSSH;C:\\Program &#x27; &#x27;Files\\Git\\cmd;C:\\Users\\cswoo\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\cswoo\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Program &#x27; &#x27;Files\\JetBrains\\PyCharm Community Edition &#x27; &#x27;2021.2.2\\bin;.;C:\\Users\\cswoo\\AppData\\Local\\afreeca;C:\\Users\\cswoo\\AppData\\Local\\Programs\\Microsoft &#x27; &#x27;VS Code\\bin;C:\\Program Files\\JetBrains\\PyCharm 2021.3.3\\bin;.&#x27;)</pre></td> </tr> <tr> <td>PATHEXT</td> <td class="code"><pre>&#x27;.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC&#x27;</pre></td> </tr> <tr> <td>PATH_INFO</td> <td class="code"><pre>&#x27;/ukstagram/posts/&#x27;</pre></td> </tr> <tr> <td>PROCESSOR_ARCHITECTURE</td> <td class="code"><pre>&#x27;AMD64&#x27;</pre></td> </tr> <tr> <td>PROCESSOR_IDENTIFIER</td> <td class="code"><pre>&#x27;Intel64 Family 6 Model 158 Stepping 10, GenuineIntel&#x27;</pre></td> </tr> <tr> <td>PROCESSOR_LEVEL</td> <td class="code"><pre>&#x27;6&#x27;</pre></td> </tr> <tr> <td>PROCESSOR_REVISION</td> <td class="code"><pre>&#x27;9e0a&#x27;</pre></td> </tr> <tr> <td>PROGRAMDATA</td> <td class="code"><pre>&#x27;C:\\ProgramData&#x27;</pre></td> </tr> <tr> <td>PROGRAMFILES</td> <td class="code"><pre>&#x27;C:\\Program Files&#x27;</pre></td> </tr> <tr> <td>PROGRAMFILES(X86)</td> <td class="code"><pre>&#x27;C:\\Program Files (x86)&#x27;</pre></td> </tr> <tr> <td>PROGRAMW6432</td> <td class="code"><pre>&#x27;C:\\Program Files&#x27;</pre></td> </tr> <tr> <td>PROMPT</td> <td class="code"><pre>&#x27;(drf) $P$G&#x27;</pre></td> </tr> <tr> <td>PSMODULEPATH</td> <td class="code"><pre>(&#x27;C:\\Program &#x27; &#x27;Files\\WindowsPowerShell\\Modules;C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules&#x27;)</pre></td> </tr> <tr> <td>PUBLIC</td> <td class="code"><pre>&#x27;C:\\Users\\Public&#x27;</pre></td> </tr> <tr> <td>PYCHARM</td> <td class="code"><pre>&#x27;C:\\Program Files\\JetBrains\\PyCharm 2021.3.3\\bin;&#x27;</pre></td> </tr> <tr> <td>PYCHARM COMMUNITY EDITION</td> <td class="code"><pre>&#x27;C:\\Program Files\\JetBrains\\PyCharm Community Edition 2021.2.2\\bin;&#x27;</pre></td> </tr> <tr> <td>PYTHONIOENCODING</td> <td class="code"><pre>&#x27;utf-8&#x27;</pre></td> </tr> <tr> <td>QUERY_STRING</td> <td class="code"><pre>&#x27;&#x27;</pre></td> </tr> <tr> <td>REMOTE_ADDR</td> <td class="code"><pre>&#x27;127.0.0.1&#x27;</pre></td> </tr> <tr> <td>REMOTE_HOST</td> <td class="code"><pre>&#x27;&#x27;</pre></td> </tr> <tr> <td>REQUEST_METHOD</td> <td class="code"><pre>&#x27;POST&#x27;</pre></td> </tr> <tr> <td>RUN_MAIN</td> <td class="code"><pre>&#x27;true&#x27;</pre></td> </tr> <tr> <td>SCRIPT_NAME</td> <td class="code"><pre>&#x27;&#x27;</pre></td> </tr> <tr> <td>SERVER_NAME</td> <td class="code"><pre>&#x27;DESKTOP-9D39MMH&#x27;</pre></td> </tr> <tr> <td>SERVER_PORT</td> <td class="code"><pre>&#x27;8000&#x27;</pre></td> </tr> <tr> <td>SERVER_PROTOCOL</td> <td class="code"><pre>&#x27;HTTP/1.1&#x27;</pre></td> </tr> <tr> <td>SERVER_SOFTWARE</td> <td class="code"><pre>&#x27;WSGIServer/0.2&#x27;</pre></td> </tr> <tr> <td>SESSIONNAME</td> <td class="code"><pre>&#x27;Console&#x27;</pre></td> </tr> <tr> <td>SYSTEMDRIVE</td> <td class="code"><pre>&#x27;C:&#x27;</pre></td> </tr> <tr> <td>SYSTEMROOT</td> <td class="code"><pre>&#x27;C:\\WINDOWS&#x27;</pre></td> </tr> <tr> <td>TEMP</td> <td class="code"><pre>&#x27;C:\\Users\\cswoo\\AppData\\Local\\Temp&#x27;</pre></td> </tr> <tr> <td>TERMINAL_EMULATOR</td> <td class="code"><pre>&#x27;JetBrains-JediTerm&#x27;</pre></td> </tr> <tr> <td>TERM_SESSION_ID</td> <td class="code"><pre>&#x27;8e1c69ed-565b-4df9-abcb-4027930ba073&#x27;</pre></td> </tr> <tr> <td>TMP</td> <td class="code"><pre>&#x27;C:\\Users\\cswoo\\AppData\\Local\\Temp&#x27;</pre></td> </tr> <tr> <td>USERDOMAIN</td> <td class="code"><pre>&#x27;DESKTOP-9D39MMH&#x27;</pre></td> </tr> <tr> <td>USERDOMAIN_ROAMINGPROFILE</td> <td class="code"><pre>&#x27;DESKTOP-9D39MMH&#x27;</pre></td> </tr> <tr> <td>USERNAME</td> <td class="code"><pre>&#x27;cswoo&#x27;</pre></td> </tr> <tr> <td>USERPROFILE</td> <td class="code"><pre>&#x27;C:\\Users\\cswoo&#x27;</pre></td> </tr> <tr> <td>WINDIR</td> <td class="code"><pre>&#x27;C:\\WINDOWS&#x27;</pre></td> </tr> <tr> <td>__INTELLIJ_COMMAND_HISTFILE__</td> <td class="code"><pre>&#x27;C:\\Users\\cswoo\\AppData\\Local\\JetBrains\\PyCharm2021.3\\terminal\\history\\DRF-history&#x27;</pre></td> </tr> <tr> <td>wsgi.errors</td> <td class="code"><pre>&lt;colorama.ansitowin32.StreamWrapper object at 0x0000012F70805610&gt;</pre></td> </tr> <tr> <td>wsgi.file_wrapper</td> <td class="code"><pre>&lt;class &#x27;wsgiref.util.FileWrapper&#x27;&gt;</pre></td> </tr> <tr> <td>wsgi.input</td> <td class="code"><pre>&lt;django.core.handlers.wsgi.LimitedStream object at 0x0000012F729DC190&gt;</pre></td> </tr> <tr> <td>wsgi.multiprocess</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>wsgi.multithread</td> <td class="code"><pre>True</pre></td> </tr> <tr> <td>wsgi.run_once</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>wsgi.url_scheme</td> <td class="code"><pre>&#x27;http&#x27;</pre></td> </tr> <tr> <td>wsgi.version</td> <td class="code"><pre>(1, 0)</pre></td> </tr> </tbody> </table> <h3 id="settings-info">Settings</h3> <h4>Using settings module <code>DRF.settings</code></h4> <table class="req"> <thead> <tr> <th>Setting</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>ABSOLUTE_URL_OVERRIDES</td> <td class="code"><pre>{}</pre></td> </tr> <tr> <td>ADMINS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>ALLOWED_HOSTS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>APPEND_SLASH</td> <td class="code"><pre>True</pre></td> </tr> <tr> <td>AUTHENTICATION_BACKENDS</td> <td class="code"><pre>[&#x27;django.contrib.auth.backends.ModelBackend&#x27;]</pre></td> </tr> <tr> <td>AUTH_PASSWORD_VALIDATORS</td> <td class="code"><pre>&#x27;********************&#x27;</pre></td> </tr> <tr> <td>AUTH_USER_MODEL</td> <td class="code"><pre>&#x27;auth.User&#x27;</pre></td> </tr> <tr> <td>BASE_DIR</td> <td class="code"><pre>WindowsPath(&#x27;C:/Users/cswoo/OneDrive/Documents/DRF&#x27;)</pre></td> </tr> <tr> <td>CACHES</td> <td class="code"><pre>{&#x27;default&#x27;: {&#x27;BACKEND&#x27;: &#x27;django.core.cache.backends.locmem.LocMemCache&#x27;}}</pre></td> </tr> <tr> <td>CACHE_MIDDLEWARE_ALIAS</td> <td class="code"><pre>&#x27;default&#x27;</pre></td> </tr> <tr> <td>CACHE_MIDDLEWARE_KEY_PREFIX</td> <td class="code"><pre>&#x27;********************&#x27;</pre></td> </tr> <tr> <td>CACHE_MIDDLEWARE_SECONDS</td> <td class="code"><pre>600</pre></td> </tr> <tr> <td>CSRF_COOKIE_AGE</td> <td class="code"><pre>31449600</pre></td> </tr> <tr> <td>CSRF_COOKIE_DOMAIN</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>CSRF_COOKIE_HTTPONLY</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>CSRF_COOKIE_NAME</td> <td class="code"><pre>&#x27;csrftoken&#x27;</pre></td> </tr> <tr> <td>CSRF_COOKIE_PATH</td> <td class="code"><pre>&#x27;/&#x27;</pre></td> </tr> <tr> <td>CSRF_COOKIE_SAMESITE</td> <td class="code"><pre>&#x27;Lax&#x27;</pre></td> </tr> <tr> <td>CSRF_COOKIE_SECURE</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>CSRF_FAILURE_VIEW</td> <td class="code"><pre>&#x27;django.views.csrf.csrf_failure&#x27;</pre></td> </tr> <tr> <td>CSRF_HEADER_NAME</td> <td class="code"><pre>&#x27;HTTP_X_CSRFTOKEN&#x27;</pre></td> </tr> <tr> <td>CSRF_TRUSTED_ORIGINS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>CSRF_USE_SESSIONS</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>DATABASES</td> <td class="code"><pre>{&#x27;default&#x27;: {&#x27;ATOMIC_REQUESTS&#x27;: False, &#x27;AUTOCOMMIT&#x27;: True, &#x27;CONN_MAX_AGE&#x27;: 0, &#x27;ENGINE&#x27;: &#x27;django.db.backends.sqlite3&#x27;, &#x27;HOST&#x27;: &#x27;&#x27;, &#x27;NAME&#x27;: WindowsPath(&#x27;C:/Users/cswoo/OneDrive/Documents/DRF/db.sqlite3&#x27;), &#x27;OPTIONS&#x27;: {}, &#x27;PASSWORD&#x27;: &#x27;********************&#x27;, &#x27;PORT&#x27;: &#x27;&#x27;, &#x27;TEST&#x27;: {&#x27;CHARSET&#x27;: None, &#x27;COLLATION&#x27;: None, &#x27;MIGRATE&#x27;: True, &#x27;MIRROR&#x27;: None, &#x27;NAME&#x27;: None}, &#x27;TIME_ZONE&#x27;: None, &#x27;USER&#x27;: &#x27;&#x27;}}</pre></td> </tr> <tr> <td>DATABASE_ROUTERS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>DATA_UPLOAD_MAX_MEMORY_SIZE</td> <td class="code"><pre>2621440</pre></td> </tr> <tr> <td>DATA_UPLOAD_MAX_NUMBER_FIELDS</td> <td class="code"><pre>1000</pre></td> </tr> <tr> <td>DATETIME_FORMAT</td> <td class="code"><pre>&#x27;N j, Y, P&#x27;</pre></td> </tr> <tr> <td>DATETIME_INPUT_FORMATS</td> <td class="code"><pre>[&#x27;%Y-%m-%d %H:%M:%S&#x27;, &#x27;%Y-%m-%d %H:%M:%S.%f&#x27;, &#x27;%Y-%m-%d %H:%M&#x27;, &#x27;%m/%d/%Y %H:%M:%S&#x27;, &#x27;%m/%d/%Y %H:%M:%S.%f&#x27;, &#x27;%m/%d/%Y %H:%M&#x27;, &#x27;%m/%d/%y %H:%M:%S&#x27;, &#x27;%m/%d/%y %H:%M:%S.%f&#x27;, &#x27;%m/%d/%y %H:%M&#x27;]</pre></td> </tr> <tr> <td>DATE_FORMAT</td> <td class="code"><pre>&#x27;N j, Y&#x27;</pre></td> </tr> <tr> <td>DATE_INPUT_FORMATS</td> <td class="code"><pre>[&#x27;%Y-%m-%d&#x27;, &#x27;%m/%d/%Y&#x27;, &#x27;%m/%d/%y&#x27;, &#x27;%b %d %Y&#x27;, &#x27;%b %d, %Y&#x27;, &#x27;%d %b %Y&#x27;, &#x27;%d %b, %Y&#x27;, &#x27;%B %d %Y&#x27;, &#x27;%B %d, %Y&#x27;, &#x27;%d %B %Y&#x27;, &#x27;%d %B, %Y&#x27;]</pre></td> </tr> <tr> <td>DEBUG</td> <td class="code"><pre>True</pre></td> </tr> <tr> <td>DEBUG_PROPAGATE_EXCEPTIONS</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>DECIMAL_SEPARATOR</td> <td class="code"><pre>&#x27;.&#x27;</pre></td> </tr> <tr> <td>DEFAULT_AUTO_FIELD</td> <td class="code"><pre>&#x27;django.db.models.BigAutoField&#x27;</pre></td> </tr> <tr> <td>DEFAULT_CHARSET</td> <td class="code"><pre>&#x27;utf-8&#x27;</pre></td> </tr> <tr> <td>DEFAULT_EXCEPTION_REPORTER</td> <td class="code"><pre>&#x27;django.views.debug.ExceptionReporter&#x27;</pre></td> </tr> <tr> <td>DEFAULT_EXCEPTION_REPORTER_FILTER</td> <td class="code"><pre>&#x27;django.views.debug.SafeExceptionReporterFilter&#x27;</pre></td> </tr> <tr> <td>DEFAULT_FILE_STORAGE</td> <td class="code"><pre>&#x27;django.core.files.storage.FileSystemStorage&#x27;</pre></td> </tr> <tr> <td>DEFAULT_FROM_EMAIL</td> <td class="code"><pre>&#x27;webmaster@localhost&#x27;</pre></td> </tr> <tr> <td>DEFAULT_INDEX_TABLESPACE</td> <td class="code"><pre>&#x27;&#x27;</pre></td> </tr> <tr> <td>DEFAULT_TABLESPACE</td> <td class="code"><pre>&#x27;&#x27;</pre></td> </tr> <tr> <td>DISALLOWED_USER_AGENTS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>EMAIL_BACKEND</td> <td class="code"><pre>&#x27;django.core.mail.backends.smtp.EmailBackend&#x27;</pre></td> </tr> <tr> <td>EMAIL_HOST</td> <td class="code"><pre>&#x27;localhost&#x27;</pre></td> </tr> <tr> <td>EMAIL_HOST_PASSWORD</td> <td class="code"><pre>&#x27;********************&#x27;</pre></td> </tr> <tr> <td>EMAIL_HOST_USER</td> <td class="code"><pre>&#x27;&#x27;</pre></td> </tr> <tr> <td>EMAIL_PORT</td> <td class="code"><pre>25</pre></td> </tr> <tr> <td>EMAIL_SSL_CERTFILE</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>EMAIL_SSL_KEYFILE</td> <td class="code"><pre>&#x27;********************&#x27;</pre></td> </tr> <tr> <td>EMAIL_SUBJECT_PREFIX</td> <td class="code"><pre>&#x27;[Django] &#x27;</pre></td> </tr> <tr> <td>EMAIL_TIMEOUT</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>EMAIL_USE_LOCALTIME</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>EMAIL_USE_SSL</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>EMAIL_USE_TLS</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>FILE_UPLOAD_DIRECTORY_PERMISSIONS</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>FILE_UPLOAD_HANDLERS</td> <td class="code"><pre>[&#x27;django.core.files.uploadhandler.MemoryFileUploadHandler&#x27;, &#x27;django.core.files.uploadhandler.TemporaryFileUploadHandler&#x27;]</pre></td> </tr> <tr> <td>FILE_UPLOAD_MAX_MEMORY_SIZE</td> <td class="code"><pre>2621440</pre></td> </tr> <tr> <td>FILE_UPLOAD_PERMISSIONS</td> <td class="code"><pre>420</pre></td> </tr> <tr> <td>FILE_UPLOAD_TEMP_DIR</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>FIRST_DAY_OF_WEEK</td> <td class="code"><pre>0</pre></td> </tr> <tr> <td>FIXTURE_DIRS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>FORCE_SCRIPT_NAME</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>FORMAT_MODULE_PATH</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>FORM_RENDERER</td> <td class="code"><pre>&#x27;django.forms.renderers.DjangoTemplates&#x27;</pre></td> </tr> <tr> <td>IGNORABLE_404_URLS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>INSTALLED_APPS</td> <td class="code"><pre>[&#x27;django.contrib.admin&#x27;, &#x27;django.contrib.auth&#x27;, &#x27;django.contrib.contenttypes&#x27;, &#x27;django.contrib.sessions&#x27;, &#x27;django.contrib.messages&#x27;, &#x27;django.contrib.staticfiles&#x27;, &#x27;rest_framework&#x27;, &#x27;ukstagram&#x27;]</pre></td> </tr> <tr> <td>INTERNAL_IPS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>LANGUAGES</td> <td class="code"><pre>[(&#x27;af&#x27;, &#x27;Afrikaans&#x27;), (&#x27;ar&#x27;, &#x27;Arabic&#x27;), (&#x27;ar-dz&#x27;, &#x27;Algerian Arabic&#x27;), (&#x27;ast&#x27;, &#x27;Asturian&#x27;), (&#x27;az&#x27;, &#x27;Azerbaijani&#x27;), (&#x27;bg&#x27;, &#x27;Bulgarian&#x27;), (&#x27;be&#x27;, &#x27;Belarusian&#x27;), (&#x27;bn&#x27;, &#x27;Bengali&#x27;), (&#x27;br&#x27;, &#x27;Breton&#x27;), (&#x27;bs&#x27;, &#x27;Bosnian&#x27;), (&#x27;ca&#x27;, &#x27;Catalan&#x27;), (&#x27;cs&#x27;, &#x27;Czech&#x27;), (&#x27;cy&#x27;, &#x27;Welsh&#x27;), (&#x27;da&#x27;, &#x27;Danish&#x27;), (&#x27;de&#x27;, &#x27;German&#x27;), (&#x27;dsb&#x27;, &#x27;Lower Sorbian&#x27;), (&#x27;el&#x27;, &#x27;Greek&#x27;), (&#x27;en&#x27;, &#x27;English&#x27;), (&#x27;en-au&#x27;, &#x27;Australian English&#x27;), (&#x27;en-gb&#x27;, &#x27;British English&#x27;), (&#x27;eo&#x27;, &#x27;Esperanto&#x27;), (&#x27;es&#x27;, &#x27;Spanish&#x27;), (&#x27;es-ar&#x27;, &#x27;Argentinian Spanish&#x27;), (&#x27;es-co&#x27;, &#x27;Colombian Spanish&#x27;), (&#x27;es-mx&#x27;, &#x27;Mexican Spanish&#x27;), (&#x27;es-ni&#x27;, &#x27;Nicaraguan Spanish&#x27;), (&#x27;es-ve&#x27;, &#x27;Venezuelan Spanish&#x27;), (&#x27;et&#x27;, &#x27;Estonian&#x27;), (&#x27;eu&#x27;, &#x27;Basque&#x27;), (&#x27;fa&#x27;, &#x27;Persian&#x27;), (&#x27;fi&#x27;, &#x27;Finnish&#x27;), (&#x27;fr&#x27;, &#x27;French&#x27;), (&#x27;fy&#x27;, &#x27;Frisian&#x27;), (&#x27;ga&#x27;, &#x27;Irish&#x27;), (&#x27;gd&#x27;, &#x27;Scottish Gaelic&#x27;), (&#x27;gl&#x27;, &#x27;Galician&#x27;), (&#x27;he&#x27;, &#x27;Hebrew&#x27;), (&#x27;hi&#x27;, &#x27;Hindi&#x27;), (&#x27;hr&#x27;, &#x27;Croatian&#x27;), (&#x27;hsb&#x27;, &#x27;Upper Sorbian&#x27;), (&#x27;hu&#x27;, &#x27;Hungarian&#x27;), (&#x27;hy&#x27;, &#x27;Armenian&#x27;), (&#x27;ia&#x27;, &#x27;Interlingua&#x27;), (&#x27;id&#x27;, &#x27;Indonesian&#x27;), (&#x27;ig&#x27;, &#x27;Igbo&#x27;), (&#x27;io&#x27;, &#x27;Ido&#x27;), (&#x27;is&#x27;, &#x27;Icelandic&#x27;), (&#x27;it&#x27;, &#x27;Italian&#x27;), (&#x27;ja&#x27;, &#x27;Japanese&#x27;), (&#x27;ka&#x27;, &#x27;Georgian&#x27;), (&#x27;kab&#x27;, &#x27;Kabyle&#x27;), (&#x27;kk&#x27;, &#x27;Kazakh&#x27;), (&#x27;km&#x27;, &#x27;Khmer&#x27;), (&#x27;kn&#x27;, &#x27;Kannada&#x27;), (&#x27;ko&#x27;, &#x27;Korean&#x27;), (&#x27;ky&#x27;, &#x27;Kyrgyz&#x27;), (&#x27;lb&#x27;, &#x27;Luxembourgish&#x27;), (&#x27;lt&#x27;, &#x27;Lithuanian&#x27;), (&#x27;lv&#x27;, &#x27;Latvian&#x27;), (&#x27;mk&#x27;, &#x27;Macedonian&#x27;), (&#x27;ml&#x27;, &#x27;Malayalam&#x27;), (&#x27;mn&#x27;, &#x27;Mongolian&#x27;), (&#x27;mr&#x27;, &#x27;Marathi&#x27;), (&#x27;ms&#x27;, &#x27;Malay&#x27;), (&#x27;my&#x27;, &#x27;Burmese&#x27;), (&#x27;nb&#x27;, &#x27;Norwegian Bokmål&#x27;), (&#x27;ne&#x27;, &#x27;Nepali&#x27;), (&#x27;nl&#x27;, &#x27;Dutch&#x27;), (&#x27;nn&#x27;, &#x27;Norwegian Nynorsk&#x27;), (&#x27;os&#x27;, &#x27;Ossetic&#x27;), (&#x27;pa&#x27;, &#x27;Punjabi&#x27;), (&#x27;pl&#x27;, &#x27;Polish&#x27;), (&#x27;pt&#x27;, &#x27;Portuguese&#x27;), (&#x27;pt-br&#x27;, &#x27;Brazilian Portuguese&#x27;), (&#x27;ro&#x27;, &#x27;Romanian&#x27;), (&#x27;ru&#x27;, &#x27;Russian&#x27;), (&#x27;sk&#x27;, &#x27;Slovak&#x27;), (&#x27;sl&#x27;, &#x27;Slovenian&#x27;), (&#x27;sq&#x27;, &#x27;Albanian&#x27;), (&#x27;sr&#x27;, &#x27;Serbian&#x27;), (&#x27;sr-latn&#x27;, &#x27;Serbian Latin&#x27;), (&#x27;sv&#x27;, &#x27;Swedish&#x27;), (&#x27;sw&#x27;, &#x27;Swahili&#x27;), (&#x27;ta&#x27;, &#x27;Tamil&#x27;), (&#x27;te&#x27;, &#x27;Telugu&#x27;), (&#x27;tg&#x27;, &#x27;Tajik&#x27;), (&#x27;th&#x27;, &#x27;Thai&#x27;), (&#x27;tk&#x27;, &#x27;Turkmen&#x27;), (&#x27;tr&#x27;, &#x27;Turkish&#x27;), (&#x27;tt&#x27;, &#x27;Tatar&#x27;), (&#x27;udm&#x27;, &#x27;Udmurt&#x27;), (&#x27;uk&#x27;, &#x27;Ukrainian&#x27;), (&#x27;ur&#x27;, &#x27;Urdu&#x27;), (&#x27;uz&#x27;, &#x27;Uzbek&#x27;), (&#x27;vi&#x27;, &#x27;Vietnamese&#x27;), (&#x27;zh-hans&#x27;, &#x27;Simplified Chinese&#x27;), (&#x27;zh-hant&#x27;, &#x27;Traditional Chinese&#x27;)]</pre></td> </tr> <tr> <td>LANGUAGES_BIDI</td> <td class="code"><pre>[&#x27;he&#x27;, &#x27;ar&#x27;, &#x27;ar-dz&#x27;, &#x27;fa&#x27;, &#x27;ur&#x27;]</pre></td> </tr> <tr> <td>LANGUAGE_CODE</td> <td class="code"><pre>&#x27;en-us&#x27;</pre></td> </tr> <tr> <td>LANGUAGE_COOKIE_AGE</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>LANGUAGE_COOKIE_DOMAIN</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>LANGUAGE_COOKIE_HTTPONLY</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>LANGUAGE_COOKIE_NAME</td> <td class="code"><pre>&#x27;django_language&#x27;</pre></td> </tr> <tr> <td>LANGUAGE_COOKIE_PATH</td> <td class="code"><pre>&#x27;/&#x27;</pre></td> </tr> <tr> <td>LANGUAGE_COOKIE_SAMESITE</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>LANGUAGE_COOKIE_SECURE</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>LOCALE_PATHS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>LOGGING</td> <td class="code"><pre>{}</pre></td> </tr> <tr> <td>LOGGING_CONFIG</td> <td class="code"><pre>&#x27;logging.config.dictConfig&#x27;</pre></td> </tr> <tr> <td>LOGIN_REDIRECT_URL</td> <td class="code"><pre>&#x27;/accounts/profile/&#x27;</pre></td> </tr> <tr> <td>LOGIN_URL</td> <td class="code"><pre>&#x27;/accounts/login/&#x27;</pre></td> </tr> <tr> <td>LOGOUT_REDIRECT_URL</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>MANAGERS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>MEDIA_ROOT</td> <td class="code"><pre>&#x27;&#x27;</pre></td> </tr> <tr> <td>MEDIA_URL</td> <td class="code"><pre>&#x27;/&#x27;</pre></td> </tr> <tr> <td>MESSAGE_STORAGE</td> <td class="code"><pre>&#x27;django.contrib.messages.storage.fallback.FallbackStorage&#x27;</pre></td> </tr> <tr> <td>MIDDLEWARE</td> <td class="code"><pre>[&#x27;django.middleware.security.SecurityMiddleware&#x27;, &#x27;django.contrib.sessions.middleware.SessionMiddleware&#x27;, &#x27;django.middleware.common.CommonMiddleware&#x27;, &#x27;django.middleware.csrf.CsrfViewMiddleware&#x27;, &#x27;django.contrib.auth.middleware.AuthenticationMiddleware&#x27;, &#x27;django.contrib.messages.middleware.MessageMiddleware&#x27;, &#x27;django.middleware.clickjacking.XFrameOptionsMiddleware&#x27;]</pre></td> </tr> <tr> <td>MIGRATION_MODULES</td> <td class="code"><pre>{}</pre></td> </tr> <tr> <td>MONTH_DAY_FORMAT</td> <td class="code"><pre>&#x27;F j&#x27;</pre></td> </tr> <tr> <td>NUMBER_GROUPING</td> <td class="code"><pre>0</pre></td> </tr> <tr> <td>PASSWORD_HASHERS</td> <td class="code"><pre>&#x27;********************&#x27;</pre></td> </tr> <tr> <td>PASSWORD_RESET_TIMEOUT</td> <td class="code"><pre>&#x27;********************&#x27;</pre></td> </tr> <tr> <td>PREPEND_WWW</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>ROOT_URLCONF</td> <td class="code"><pre>&#x27;DRF.urls&#x27;</pre></td> </tr> <tr> <td>SECRET_KEY</td> <td class="code"><pre>&#x27;********************&#x27;</pre></td> </tr> <tr> <td>SECURE_CONTENT_TYPE_NOSNIFF</td> <td class="code"><pre>True</pre></td> </tr> <tr> <td>SECURE_CROSS_ORIGIN_OPENER_POLICY</td> <td class="code"><pre>&#x27;same-origin&#x27;</pre></td> </tr> <tr> <td>SECURE_HSTS_INCLUDE_SUBDOMAINS</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>SECURE_HSTS_PRELOAD</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>SECURE_HSTS_SECONDS</td> <td class="code"><pre>0</pre></td> </tr> <tr> <td>SECURE_PROXY_SSL_HEADER</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>SECURE_REDIRECT_EXEMPT</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>SECURE_REFERRER_POLICY</td> <td class="code"><pre>&#x27;same-origin&#x27;</pre></td> </tr> <tr> <td>SECURE_SSL_HOST</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>SECURE_SSL_REDIRECT</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>SERVER_EMAIL</td> <td class="code"><pre>&#x27;root@localhost&#x27;</pre></td> </tr> <tr> <td>SESSION_CACHE_ALIAS</td> <td class="code"><pre>&#x27;default&#x27;</pre></td> </tr> <tr> <td>SESSION_COOKIE_AGE</td> <td class="code"><pre>1209600</pre></td> </tr> <tr> <td>SESSION_COOKIE_DOMAIN</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>SESSION_COOKIE_HTTPONLY</td> <td class="code"><pre>True</pre></td> </tr> <tr> <td>SESSION_COOKIE_NAME</td> <td class="code"><pre>&#x27;sessionid&#x27;</pre></td> </tr> <tr> <td>SESSION_COOKIE_PATH</td> <td class="code"><pre>&#x27;/&#x27;</pre></td> </tr> <tr> <td>SESSION_COOKIE_SAMESITE</td> <td class="code"><pre>&#x27;Lax&#x27;</pre></td> </tr> <tr> <td>SESSION_COOKIE_SECURE</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>SESSION_ENGINE</td> <td class="code"><pre>&#x27;django.contrib.sessions.backends.db&#x27;</pre></td> </tr> <tr> <td>SESSION_EXPIRE_AT_BROWSER_CLOSE</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>SESSION_FILE_PATH</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>SESSION_SAVE_EVERY_REQUEST</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>SESSION_SERIALIZER</td> <td class="code"><pre>&#x27;django.contrib.sessions.serializers.JSONSerializer&#x27;</pre></td> </tr> <tr> <td>SETTINGS_MODULE</td> <td class="code"><pre>&#x27;DRF.settings&#x27;</pre></td> </tr> <tr> <td>SHORT_DATETIME_FORMAT</td> <td class="code"><pre>&#x27;m/d/Y P&#x27;</pre></td> </tr> <tr> <td>SHORT_DATE_FORMAT</td> <td class="code"><pre>&#x27;m/d/Y&#x27;</pre></td> </tr> <tr> <td>SIGNING_BACKEND</td> <td class="code"><pre>&#x27;django.core.signing.TimestampSigner&#x27;</pre></td> </tr> <tr> <td>SILENCED_SYSTEM_CHECKS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>STATICFILES_DIRS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>STATICFILES_FINDERS</td> <td class="code"><pre>[&#x27;django.contrib.staticfiles.finders.FileSystemFinder&#x27;, &#x27;django.contrib.staticfiles.finders.AppDirectoriesFinder&#x27;]</pre></td> </tr> <tr> <td>STATICFILES_STORAGE</td> <td class="code"><pre>&#x27;django.contrib.staticfiles.storage.StaticFilesStorage&#x27;</pre></td> </tr> <tr> <td>STATIC_ROOT</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>STATIC_URL</td> <td class="code"><pre>&#x27;/static/&#x27;</pre></td> </tr> <tr> <td>TEMPLATES</td> <td class="code"><pre>[{&#x27;APP_DIRS&#x27;: True, &#x27;BACKEND&#x27;: &#x27;django.template.backends.django.DjangoTemplates&#x27;, &#x27;DIRS&#x27;: [], &#x27;OPTIONS&#x27;: {&#x27;context_processors&#x27;: [&#x27;django.template.context_processors.debug&#x27;, &#x27;django.template.context_processors.request&#x27;, &#x27;django.contrib.auth.context_processors.auth&#x27;, &#x27;django.contrib.messages.context_processors.messages&#x27;]}}]</pre></td> </tr> <tr> <td>TEST_NON_SERIALIZED_APPS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>TEST_RUNNER</td> <td class="code"><pre>&#x27;django.test.runner.DiscoverRunner&#x27;</pre></td> </tr> <tr> <td>THOUSAND_SEPARATOR</td> <td class="code"><pre>&#x27;,&#x27;</pre></td> </tr> <tr> <td>TIME_FORMAT</td> <td class="code"><pre>&#x27;P&#x27;</pre></td> </tr> <tr> <td>TIME_INPUT_FORMATS</td> <td class="code"><pre>[&#x27;%H:%M:%S&#x27;, &#x27;%H:%M:%S.%f&#x27;, &#x27;%H:%M&#x27;]</pre></td> </tr> <tr> <td>TIME_ZONE</td> <td class="code"><pre>&#x27;Asia/Seoul&#x27;</pre></td> </tr> <tr> <td>USE_DEPRECATED_PYTZ</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>USE_I18N</td> <td class="code"><pre>True</pre></td> </tr> <tr> <td>USE_L10N</td> <td class="code"><pre>True</pre></td> </tr> <tr> <td>USE_THOUSAND_SEPARATOR</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>USE_TZ</td> <td class="code"><pre>True</pre></td> </tr> <tr> <td>USE_X_FORWARDED_HOST</td> <td class="code"><pre>False</pre></td> </tr> <div id="explanation"> <p> You’re seeing this error because you have <code>DEBUG = True</code> in your Django settings file. Change that to <code>False</code>, and Django will display a standard page generated by the handler for this status code. </p> </div> </body> </html>

 

 

 

답변 2

0

최성욱님의 프로필 이미지
최성욱
질문자

그렇군요. 한번 해보겠습니다!

0

이진석님의 프로필 이미지
이진석
지식공유자

안녕하세요.

서버에서 요청 처리 중에 예기치못한 오류가 발생하면 오류 응답을 받게 됩니다. settings.DEBUG 를 끈다고 해서 오류가 사라지는 것은 아닙니다. 단지 오류응답이 자세하지않을 뿐입니다.

오류 메세지에 답이 있습니다. 절대 상상하지 마세요. 원인을 파악하는 연습이 필요합니다.

DEBUG 옵션을 켜주시구요. 오류가 발생하는 httpie 명령의 출력은, 서버에서 받은 그대로 html 포맷일 것입니다. 이를 파일로 저장하여 웹브라우저로 보시면 에러내용을 파악하시기 용이하실 것입니다.

http 수행하신 명령 > error.html

위와 같이 명령을 수행하시면 에러 내용이 지정 파일에 저장이 됩니다. 생성된 파일을 윈도우 탐색기에서 더블클릭하여 열어서 오류 내용을 확인해보세요.

화이팅입니다. :-)

최성욱님의 프로필 이미지
최성욱

작성한 질문수

질문하기