We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d6ac14 commit 0d8f808Copy full SHA for 0d8f808
home/views.py
@@ -20,11 +20,15 @@ def get_files_from_directory(directory_path):
20
for filename in os.listdir(directory_path):
21
file_path = os.path.join(directory_path, filename)
22
if os.path.isfile(file_path):
23
- files.append({
24
- 'file': file_path.split('/media/')[1],
25
- 'filename': filename,
26
- 'file_path': file_path
27
- })
+ try:
+ print( ' > file_path ' + file_path)
+ files.append({
+ 'file': file_path.split(os.sep + 'media' + os.sep)[1],
+ 'filename': filename,
28
+ 'file_path': file_path
29
+ })
30
+ except Exception as e:
31
+ print( ' > ' + str( e ) )
32
return files
33
34
0 commit comments