numerous improvements
This commit is contained in:
@@ -19,12 +19,16 @@ from django.conf import settings
|
||||
from django.conf.urls.static import static
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
|
||||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
path("admin/", admin.site.urls, name="admin"),
|
||||
path("anatomy/", include("anatomy.urls"), name="anatomy"),
|
||||
#path("sbas/", include("sbas.urls"), name="sbas"),
|
||||
#path("rapids/", include("rapids.urls"), name="rapids"),
|
||||
path("accounts/", include("django.contrib.auth.urls")),
|
||||
path("accounts/profile", views.profile, name="profile"),
|
||||
path("", TemplateView.as_view(template_name="index.html"), name="home"),
|
||||
|
||||
]
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
from django.shortcuts import render, get_object_or_404, redirect
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
from django import forms
|
||||
|
||||
# from django.contrib.auth.models import User
|
||||
from django.contrib.auth.decorators import login_required, user_passes_test
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
|
||||
from django.views.generic.edit import CreateView, UpdateView, DeleteView
|
||||
from django.views.generic import ListView
|
||||
|
||||
from django.db.models.functions import Lower
|
||||
|
||||
from django.core.cache import cache
|
||||
|
||||
from django.urls import reverse_lazy, reverse
|
||||
|
||||
from django.http import Http404, JsonResponse
|
||||
|
||||
from django.http import HttpResponseRedirect, HttpResponse
|
||||
|
||||
|
||||
@login_required
|
||||
def profile(request):
|
||||
user = request.user
|
||||
return render(request, "profile.html", {"user": user})
|
||||
|
||||
Reference in New Issue
Block a user