Expecting to be able to access django admin panel and add social accouunt
opening admin panel by adding standard admin/ extension to local preview port URL. This is expected to lead to classic django admin panel.
going to the admin url instead leads to an error message
the website is otherwise displaying fine.
A simple google oath signin is currently being implemented.
Error message:
DoesNotExist at /admin/login/
Site matching query does not exist.
Request Method: GET
Request URL: http://8000-lmcrean-project4-avaw7dd1zq8.ws-eu106.gitpod.io/admin/login/?next=/admin/
Django Version: 3.2.23
Exception Type: DoesNotExist
Exception Value:
Site matching query does not exist.
Exception Location: /workspace/.pip-modules/lib/python3.9/site-packages/django/db/models/query.py, line 435, in get
Python Executable: /home/gitpod/.pyenv/versions/3.9.17/bin/python3
Python Version: 3.9.17
Python Path:
['/workspace/Project-4',
'/home/gitpod/.pyenv/versions/3.9.17/lib/python39.zip',
'/home/gitpod/.pyenv/versions/3.9.17/lib/python3.9',
'/home/gitpod/.pyenv/versions/3.9.17/lib/python3.9/lib-dynload',
'/workspace/.pip-modules/lib/python3.9/site-packages',
'/home/gitpod/.pyenv/versions/3.9.17/lib/python3.9/site-packages']
Server time: Sat, 11 Nov 2023 15:17:58 +0000
Currently trying to fix with this tutorial
“Set up Google Sign-in for Faster Django Login Experience Feat. Tech with Tim.” Akamai DevRel, YouTube Video, 12 Dec. 2022, https://youtu.be/yO6PP0vEOMc?feature=shared&t=1328. Accessed 11 Nov. 2023.
- have followed correctly with all working up to 22 minutes in
- migration was recently made after setting up urls, views and templates for google oauth as per the tutorial, there were no obvious issues with this
- before that django-admin panel seemed to be working fine
settings.py and url are likely problem areas
installed apps seems ok on settings.py - can be viewed here in full
this was recently implemented but is correct according to tutorial:
AUTHENTICATION_BACKENDS = (
"django.contrib.auth.backends.ModelBackend",
"allauth.account.auth_backends.AuthenticationBackend"
)
urlpatterns in urls.py
urlpatterns = [
path('admin/', admin.site.urls),
path("", include("blog.urls"), name="blog-urls"),
path('summernote/', include('django_summernote.urls')),
path("accounts/", include("allauth.urls")),
path("", include("users.urls"))
]