Reputation: 194
I am setting up a website through IIS and Django. I would like to secure my IIS site so only the desired people can access it, in particular, I would like to rely on their windows credential within our network for authentication. To do that I have added IIS Windows Authentication and enabled it for the website through. I have also followed the django tutorial on adding REMOTE_USER definitions in settings.py. When I try to access the web site as a user on my network I get the following error:
OperationalError at
attempt to write a readonly database
Request Method: GET
Request URL: website address
Django Version: 2.2.3
Exception Type: OperationalError
Exception Value:
attempt to write a readonly database
Exception Location: >c:\users\zolo\appdata\local\programs\python\virtualenv\dashboard\lib\site-packages\django\db\backends\sqlite3\base.py in execute, line 383 Python Executable: >c:\users\zolo\appdata\local\programs\python\virtualenv\dashboard\scripts\python.exe
please help me find the missing piece of the puzzle. I am pretty new to Django and IIS and would appreciate the help
Python Version: 3.7.2 DJANGO version 2.23 IIS version: 10.0 Windows Server 2016
Upvotes: 2
Views: 887
Reputation: 194
Took me a while to find the answer, and I would like to share in case people need it: The root cause is that Django wants to add the remote user to django database but the user doesnt have access. You can give access through IIS to the website folder by selecting the "Users" group and select the Write option in the Permissions for Users box. Click Apply then OK, then again Apply and OK.
Upvotes: 4