Hi Folks, Actually I want to load the csv file for first time only afterwards I don't want to load the csv files,but everytime when i'm calling the url the same csv fie is loading for the same operation.How I can restrict it for multiple loadings? *Here is my code:*
*class AutocompleteView(APIView): def __init__(self): self.keys = [] with open("search_terms_converteds.csv",'r') as file: reader = csv.reader(file) for row in reader: self.keys.append(row[1]) print("constructor execution") global t t = Trie() t.formTrie(self.keys) def post(self,request): key = request.data print("key:",key) suggested_word = t.printAutoSuggestions(key) return Response(suggested_word, status = status.HTTP_200_OK)* *Thank you in advance* *Regards,* *Soumen* -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAPUw6WY1HOW6rWTkF0Pr5iKnb91YyLCdc3UtXVvC6%3DNd0dKKEw%40mail.gmail.com.