由于我对 Linux 知之甚少,我所能做的几乎就是从一个好的教程中复制和粘贴内容,并且在大多数情况下只是希望不会出错。我真的尝试过自己寻找解决方案并搜索互联网,但无济于事(我发现了许多非常相似的东西,但没有解决方案我理解到能够自行调整以解决我的问题)。
我已经使用这个惊人的教程安装了一个 osm tile 服务器,它就像一个魅力。现在我想使用本教程安装 umap 。
一切正常,直到我到达“umap collectstatic”这一行。我得到的错误是这样的:
(venv) $ sudo umap collectstatic
[sudo] Passwort für umap2:
You have requested to collect static files at the destination
location as specified in your settings:
/home/ybon/.virtualenvs/umap/var/static
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 "/usr/local/bin/umap", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/umap/bin/__init__.py", line 12, in main
management.execute_from_command_line()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 359, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 294, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 345, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 193, in handle
collected = self.collect()
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 115, in collect
for path, storage in finder.list(self.ignore_patterns):
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/finders.py", line 112, in list
for path in utils.get_files(storage, ignore_patterns):
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/utils.py", line 28, in get_files
directories, files = storage.listdir(location)
File "/usr/local/lib/python2.7/dist-packages/django/core/files/storage.py", line 399, in listdir
for entry in os.listdir(path):
OSError: [Errno 2] No such file or directory: '/home/ybon/Code/js/Leaflet.Storage'
现在,我发现某处的配置文件中的设置可能有问题,但是更改 local.py 中的目录似乎没有任何作用(就像我已将其设置为 STATIC_ROOT = '/home/xxx_myusername_xxx/umap/ var/static') - 我不知道这个“/home/ybon/Code/...”路径是从哪里来的!什么设置?
我确定没有在任何地方指定此路径!在我的机器上确实找不到该文件夹。也许使用 virtualenv 会以某种方式生成它,但我无法在我的机器上找到它,因为它是虚拟的(如“实际上并不存在”),但这只是一个非常疯狂的猜测,我真的不知道我是什么我在谈论。
(我尝试在有和没有 sudo 的情况下运行该命令,但它不会改变任何东西)。