2

I am trying to set up django-silk in my django project and I keep running into this issue when I run python manage.py collectstatic. I have tried creating a new virtual environment and trying again but I get the same error. But if I were to create a new django project with only Dango Rest Framework and Silk everything works fine. I have been stuck on this issue for several days. Can anyone help?

My environment: MacOS Catalina 10.15.4 python 3.7.3 Django 2.2.10 djangorestframework 3.9.1 django-silk 3.0.4 Project location: /Users/cstephenson/Desktop/repos/MyProject

Full stack trace:

  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/cstephenson/Desktop/myenv/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/Users/cstephenson/Desktop/myenv/lib/python3.7/site-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/cstephenson/Desktop/myenv/lib/python3.7/site-packages/django/core/management/base.py", line 323, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/cstephenson/Desktop/myenv/lib/python3.7/site-packages/django/core/management/base.py", line 364, in execute
    output = self.handle(*args, **options)
  File "/Users/cstephenson/Desktop/myenv/lib/python3.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 188, in handle
    collected = self.collect()
  File "/Users/cstephenson/Desktop/myenv/lib/python3.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 114, in collect
    handler(path, prefixed_path, storage)
  File "/Users/cstephenson/Desktop/myenv/lib/python3.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 352, in copy_file
    self.storage.save(prefixed_path, source_file)
  File "/Users/cstephenson/Desktop/myenv/lib/python3.7/site-packages/django/core/files/storage.py", line 52, in save
    return self._save(name, content)
  File "/Users/cstephenson/Desktop/myenv/lib/python3.7/site-packages/django/core/files/storage.py", line 242, in _save
    os.makedirs(directory)
  File "/Users/cstephenson/Desktop/myenv/bin/../lib/python3.7/os.py", line 211, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/Users/cstephenson/Desktop/myenv/bin/../lib/python3.7/os.py", line 211, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/Users/cstephenson/Desktop/myenv/bin/../lib/python3.7/os.py", line 211, in makedirs
    makedirs(head, exist_ok=exist_ok)
  [Previous line repeated 1 more time]
  File "/Users/cstephenson/Desktop/myenv/bin/../lib/python3.7/os.py", line 221, in makedirs
    mkdir(name, mode)
OSError: [Errno 30] Read-only file system: '/[Path to project]'
  • Where is the project (i.e. what is the actual `/[Path to project]`), and which version of macOS are you running? – Gordon Davisson Apr 01 '20 at 16:01
  • Up dated my original question with all the data you requested. – Christopher Stephenson Apr 01 '20 at 16:13
  • Does it actually literally say `'/[Path to project]'` in the error message? If so, I'm pretty sure there's a placeholder somewhere (maybe a config file) that has this, but needs to be replaced with the actual path. (And that error makes sense, because under macOS Catalina the root filesystem is read-only, so creating a new top-level folder named "`[Path to project]`" there *should* get you a read-only file system error.) – Gordon Davisson Apr 01 '20 at 20:35
  • Yea, it literally does say [Path to project] – Christopher Stephenson Apr 01 '20 at 23:10
  • You could search for that string with something like `grep -Fr '[Path to project]' /Users/cstephenson/Desktop/repos` to get an idea where the problem might be. (Note: the `-F` option to `grep` is needed so it doesn't interpret this as a bracket expression, and search for *any of* the letters between `[` and `]`.) – Gordon Davisson Apr 02 '20 at 20:28
  • @ChristopherStephenson, did you manage to solve this? – avriis Feb 16 '21 at 11:31
  • @avriis I did by creating a fresh project and copying over the static files. – Christopher Stephenson Feb 18 '21 at 04:44

0 Answers0