def upload(self, file, data): """ Directly upload a HTML file. """ file_contents = file.file.read() timestamp = datetime.strptime(data[:data.index('.')], self.date_format) print(timestamp) self.model.import_file( HTMLFile.from_memory(file_contents, timestamp)) return