Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added auth to frontend #76

Merged
merged 11 commits into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion config/api_router.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from django.conf import settings
from django.urls import include
from django.urls import path
from rest_framework.routers import DefaultRouter
from rest_framework.routers import SimpleRouter

from democrasite.users.api.views import GitHubLogin
from democrasite.users.api.views import UserViewSet
from democrasite.webiscite.api.views import BillViewSet

Expand All @@ -13,4 +16,8 @@
# Unfortunately if we want automatical links for models we can't use a namespace
# but I may reconsider anyway
# app_name = "api" # noqa: ERA001
urlpatterns = router.urls
urlpatterns = [
*router.urls,
path("auth/", include("dj_rest_auth.urls")),
path("auth/github/", GitHubLogin.as_view(), name="github_login"),
]
21 changes: 2 additions & 19 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@
"rest_framework.authtoken",
"corsheaders",
"drf_spectacular",
"dj_rest_auth",
"dj_rest_auth.registration",
# Machina (forum) dependencies:
"mptt",
"haystack",
Expand Down Expand Up @@ -301,25 +303,6 @@
"root": {"level": "INFO", "handlers": ["console"]},
}

# django-debug-toolbar
Copy link
Owner Author

@mfosterw mfosterw Mar 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# ------------------------------------------------------------------------------
# https://django-debug-toolbar.readthedocs.io/en/latest/configuration.html#debug-toolbar-panels
DEBUG_TOOLBAR_PANELS = [
"debug_toolbar.panels.history.HistoryPanel",
"debug_toolbar.panels.versions.VersionsPanel",
"debug_toolbar.panels.timer.TimerPanel",
"debug_toolbar.panels.settings.SettingsPanel",
"debug_toolbar.panels.headers.HeadersPanel",
"debug_toolbar.panels.request.RequestPanel",
"debug_toolbar.panels.sql.SQLPanel",
"debug_toolbar.panels.staticfiles.StaticFilesPanel",
"debug_toolbar.panels.templates.TemplatesPanel",
"debug_toolbar.panels.cache.CachePanel",
"debug_toolbar.panels.signals.SignalsPanel",
"debug_toolbar.panels.redirects.RedirectsPanel",
# 'debug_toolbar.panels.profiling.ProfilingPanel', causes errors with frontend
]


# Celery
# ------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion config/settings/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
ALLOWED_HOSTS = ["localhost", "0.0.0.0", "127.0.0.1"] # noqa: S104
# Admin site is only enabled during development
INSTALLED_APPS += ["django.contrib.admin"] # type: ignore[used-before-def]
INSTALLED_APPS += ["django.contrib.admin"]

# CACHES
# ------------------------------------------------------------------------------
Expand Down
3 changes: 0 additions & 3 deletions config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from django.views.generic import TemplateView
from drf_spectacular.views import SpectacularAPIView
from drf_spectacular.views import SpectacularSwaggerView
from rest_framework.authtoken.views import obtain_auth_token

urlpatterns = [
path(
Expand All @@ -36,8 +35,6 @@
urlpatterns += [
# API base url
path("api/", include("config.api_router")),
# DRF auth token
path("auth-token/", obtain_auth_token),
path("api/schema/", SpectacularAPIView.as_view(), name="api-schema"),
path(
"api/docs/",
Expand Down
1 change: 0 additions & 1 deletion democrasite-frontend/.env.local

This file was deleted.

2 changes: 1 addition & 1 deletion democrasite-frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ yarn-debug.log*
yarn-error.log*

# local env files
# .env*.local # uncomment if sensitive environment variables added
.env*.local

# vercel
.vercel
Expand Down
13 changes: 0 additions & 13 deletions democrasite-frontend/api/auto/.openapi-generator/FILES

This file was deleted.

Loading
Loading