Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
from boto3 import resource
from boto3.dynamodb.conditions import Attr, Key
import math
import random
import hashlib
student_table = resource('dynamodb').Table('Students')
def createStudent(studentID, studentPWD, enrolledCourses = [], studentEmail="None"):
studentCreation = student_table.put_item(
Item = {
'StudentId' : studentID,
'StudentPWD' : studentPWD,
'EnrolledCourses' : enrolledCourses,
'AuthToken' : None,
'StudentEmail' : studentEmail
}
)
print(f"Student creation output: {studentCreation}")
if __name__ == "__main__":
hashed_password = hashlib.sha256("myNewPassword".encode()).hexdigest()
createStudent("testUser", hashed_password, [["STAT3025Q", "003L"], ["COMM 3310W", "001"]], "couillard@uconn.edu")