So I am running the command
python manage.py collectstatic
and I am getting an error, I am pretty sure it is because I have some setting off inside my settings.py. First I will attach a picture, so everyone can see the tree of my documents and then the error itself.
Any idea of what I did wrong? Thank you.
Picture: Image with the tree of files and settings
My settings.py
# on the top
import os
# on the bottom
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
STATIC_ROOT = os.path.normpath(os.path.join(BASE_DIR, 'staticfiles'))
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)
The error is the following:
(env) PS C:\Users\lenil\Documents\Development\Personal Projects\the-journey\thejourney_project> python manage.py collectstatic
Traceback (most recent call last):
File "C:\Users\lenil\Documents\Development\Personal Projects\the-journey\thejourney_project\manage.py", line 22, in <module>
main()
File "C:\Users\lenil\Documents\Development\Personal Projects\the-journey\thejourney_project\manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "C:\Users\lenil\Documents\Development\Personal Projects\the-journey\thejourney_project\env\lib\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_line
utility.execute()
File "C:\Users\lenil\Documents\Development\Personal Projects\the-journey\thejourney_project\env\lib\site-packages\django\core\management\__init__.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\lenil\Documents\Development\Personal Projects\the-journey\thejourney_project\env\lib\site-packages\django\core\management\base.py", line 330, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\lenil\Documents\Development\Personal Projects\the-journey\thejourney_project\env\lib\site-packages\django\core\management\base.py", line 371, in execute
output = self.handle(*args, **options)
File "C:\Users\lenil\Documents\Development\Personal Projects\the-journey\thejourney_project\env\lib\site-packages\django\contrib\staticfiles\management\commands\collectstatic.py", line 194, in handle
collected = self.collect()
File "C:\Users\lenil\Documents\Development\Personal Projects\the-journey\thejourney_project\env\lib\site-packages\django\contrib\staticfiles\management\commands\collectstatic.py", line 109, in collect
for path, storage in finder.list(self.ignore_patterns):
File "C:\Users\lenil\Documents\Development\Personal Projects\the-journey\thejourney_project\env\lib\site-packages\django\contrib\staticfiles\finders.py", line 130, in list
for path in utils.get_files(storage, ignore_patterns):
File "C:\Users\lenil\Documents\Development\Personal Projects\the-journey\thejourney_project\env\lib\site-packages\django\contrib\staticfiles\utils.py", line 23, in get_files
directories, files = storage.listdir(location)
File "C:\Users\lenil\Documents\Development\Personal Projects\the-journey\thejourney_project\env\lib\site-packages\django\core\files\storage.py", line 316, in listdir
for entry in os.scandir(path):
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\lenil\\Documents\\Development\\Personal Projects\\the-journey\\thejourney_project\\thejourney_project\\static'
(env) PS C:\Users\lenil\Documents\Development\Personal Projects\the-journey\thejourney_project>
Thank you very much for the help!