samedi 6 mars 2021

Trying to deploy django app to heroku and having an issue with collect static storage.py path

I am trying to deploy a django project to heroku and having a hard time with the static files. I have everything set up properly as it has worked for me in the past. I'm not sure what the issue is this time.

Below is my traceback. It seems to be something with the static files path but it shouldnt have a problem if I have my STATIC ROOT and URL correct right?

-----> $ python manage.py collectstatic --noinput

   Traceback (most recent call last):

     File "manage.py", line 22, in <module>

       main()

     File "manage.py", line 18, in main

       execute_from_command_line(sys.argv)

     File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line

       utility.execute()

     File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 395, in execute

       self.fetch_command(subcommand).run_from_argv(self.argv)

     File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/base.py", line 330, in run_from_argv

       self.execute(*args, **cmd_options)

     File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/base.py", line 371, in execute

       output = self.handle(*args, **options)

     File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 194, in handle

       collected = self.collect()

     File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 109, in collect

       for path, storage in finder.list(self.ignore_patterns):

     File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/finders.py", line 130, in list

       for path in utils.get_files(storage, ignore_patterns):

     File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/utils.py", line 23, in get_files

       directories, files = storage.listdir(location)

     File "/app/.heroku/python/lib/python3.6/site-packages/django/core/files/storage.py", line 316, in listdir

       for entry in os.scandir(path):

   FileNotFoundError: [Errno 2] No such file or directory: '/tmp/build_0728dd1c_/static'

Please help. I know the Static File deployment with heroku is a nightmare but I tried all the troubleshooting and still cant solve the problem here.

Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire