$ opal --version
if you create a new project, even if you run runserver, if you run collectstatic it will fail as the static directory referenced by STATICFILES_DIRS in the settings module doesn't exist.
$ python mynewapp/manage.py collectstatic
You have requested to collect static files at the destination
location as specified in your settings:
This will overwrite existing files!
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: yes
Traceback (most recent call last):
File "mynewapp/manage.py", line 10, in <module>
File "/Users/graham/.warpdrive/warpdrive+opal/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
File "/Users/graham/.warpdrive/warpdrive+opal/lib/python2.7/site-packages/django/core/management/__init__.py", line 346, in execute
File "/Users/graham/.warpdrive/warpdrive+opal/lib/python2.7/site-packages/django/core/management/base.py", line 394, in run_from_argv
File "/Users/graham/.warpdrive/warpdrive+opal/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute
output = self.handle(*args, **options)
File "/Users/graham/.warpdrive/warpdrive+opal/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 168, in handle
collected = self.collect()
File "/Users/graham/.warpdrive/warpdrive+opal/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 98, in collect
for path, storage in finder.list(self.ignore_patterns):
File "/Users/graham/.warpdrive/warpdrive+opal/lib/python2.7/site-packages/django/contrib/staticfiles/finders.py", line 112, in list
for path in utils.get_files(storage, ignore_patterns):
File "/Users/graham/.warpdrive/warpdrive+opal/lib/python2.7/site-packages/django/contrib/staticfiles/utils.py", line 28, in get_files
directories, files = storage.listdir(location)
File "/Users/graham/.warpdrive/warpdrive+opal/lib/python2.7/site-packages/django/core/files/storage.py", line 299, in listdir
for entry in os.listdir(path):
OSError: [Errno 2] No such file or directory: '/Users/graham/Testing/opal/mynewapp/mynewapp/static'
The opal startproject command should perhaps create the static directory.
One potential problem with creating the directory is that if people then add the generated project code into a git repository, because it is an empty directory, it will not be added. One would need to create at least one file in the directory for git to add it to the repository.
Thanks @GrahamDumpleton - good shout!
Creating that directory with just for example a README that explains why it's there as part of that command might be a solution.
Ensure that the target of STATIC_ROOT exists for freshly scaffolded
Allow git add . to ensure the directory is created but doesn't add
things we _know_ will exist there after running collectstatic.
Hi @GrahamDumpleton - this issue should now be fixed - either on the v0.7.1 branch of a git checkout or via a direct github download.
Please do let us know if you find any other issues - we're always keen to have feedback & / or know about bugs!