def write_into_db(request): # Create group if already not there create_group('Cores') create_depts () create_users (users_file_name = OUT_FILE) supercoreAssociations (users_file_name = OUT_FILE) return HttpResponseRedirect('/')
def write_into_db(request): details=csv.reader(open(IN_FILE, 'rb')) outfile=open(OUT_FILE, 'wb') writer = csv.writer(outfile) # Create group if already not there create_group('Coords') parse_csv(details,writer) # only closing saves the csv. NOTE: breaking out of the process midway will not save the passes. outfile.close() create_depts () create_users (users_file_name = OUT_FILE) return HttpResponseRedirect('/')