Skip to content

fix: issue #14

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
pip install -r requirements.txt
- name: Run Tests
run: |
python manage.py test
python manage.py test
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions college_management_system/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
DEBUG = True

# ALLOWED_HOSTS = ['smswithdjango.herokuapp.com']
ALLOWED_HOSTS = ['sigce-college-portal.up.railway.app','collegeportal.tk','sigce.ml'] # Not recommended but useful in dev mode

# ALLOWED_HOSTS = ['sigce-college-portal.up.railway.app','collegeportal.tk','sigce.ml'] # Not recommended but useful in dev mode
ALLOWED_HOSTS = ['*'] # Not recommended but useful in dev mode

# Application definition

Expand Down
Binary file modified db.sqlite3
Binary file not shown.
Binary file not shown.
Binary file added main_app/__pycache__/EmailBackend.cpython-311.pyc
Binary file not shown.
Binary file added main_app/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file added main_app/__pycache__/admin.cpython-311.pyc
Binary file not shown.
Binary file added main_app/__pycache__/apps.cpython-311.pyc
Binary file not shown.
Binary file added main_app/__pycache__/forms.cpython-311.pyc
Binary file not shown.
Binary file added main_app/__pycache__/hod_views.cpython-311.pyc
Binary file not shown.
Binary file added main_app/__pycache__/middleware.cpython-311.pyc
Binary file not shown.
Binary file added main_app/__pycache__/models.cpython-311.pyc
Binary file not shown.
Binary file added main_app/__pycache__/staff_views.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file added main_app/__pycache__/urls.cpython-311.pyc
Binary file not shown.
Binary file added main_app/__pycache__/views.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
34 changes: 17 additions & 17 deletions main_app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ def doLogin(request, **kwargs):
return HttpResponse("<h4>Denied</h4>")
else:
#Google recaptcha
captcha_token = request.POST.get('g-recaptcha-response')
captcha_url = "https://www.google.com/recaptcha/api/siteverify"
captcha_key = "6LfHPwojAAAAAAtIjbi-7_N4fNf7Wp0LUiYlCDw_"
data = {
'secret': captcha_key,
'response': captcha_token
}
# Make request
try:
captcha_server = requests.post(url=captcha_url, data=data)
response = json.loads(captcha_server.text)
if response['success'] == False:
messages.error(request, 'Invalid Captcha. Try Again')
return redirect('/')
except:
messages.error(request, 'Captcha could not be verified. Try Again')
return redirect('/')
# captcha_token = request.POST.get('g-recaptcha-response')
# captcha_url = "https://www.google.com/recaptcha/api/siteverify"
# captcha_key = "6LfHPwojAAAAAAtIjbi-7_N4fNf7Wp0LUiYlCDw_"
# data = {
# 'secret': captcha_key,
# 'response': captcha_token
# }
# # Make request
# try:
# captcha_server = requests.post(url=captcha_url, data=data)
# response = json.loads(captcha_server.text)
# if response['success'] == False:
# messages.error(request, 'Invalid Captcha. Try Again')
# return redirect('/')
# except:
# messages.error(request, 'Captcha could not be verified. Try Again')
# return redirect('/')

#Authenticate
user = EmailBackend.authenticate(request, username=request.POST.get('email'), password=request.POST.get('password'))
Expand Down