consolidated objects into one benchcoach app

created benchcoachproject app to contain all the settings and stuff
some other changes that got grouped with this commit is the adding the ApiObject to the TeamSnap object model
This commit is contained in:
2021-12-21 17:14:52 -06:00
parent e9f91126e5
commit 95697ef4fe
174 changed files with 5351 additions and 16551 deletions

View File

@@ -0,0 +1,31 @@
from django.http import HttpResponse
from django.shortcuts import render,redirect, reverse, HttpResponseRedirect
from django.contrib.auth import login,authenticate
def welcome(request):
pages = ['event list', 'team list', 'venue list', 'player list', 'teamsnap list events', 'teamsnap home', 'login']
return render(request,'home.html',{'pages':pages})
def user_login(request):
if request.method == 'POST':
username = request.POST.get('username')
password = request.POST.get('password')
try:
user = authenticate(request, username=username, password=password)
if user is not None:
print('Login')
login(request,user)
return redirect(reverse('home'))
else:
print("Someone tried to login and failed.")
print("They used username: {} and password: {}".format(username, password))
return redirect('/')
except Exception as identifier:
return redirect('/')
else:
return render(request, 'login.html')