1

「sudo python manage.py collectstatic」の実行時に、django-pipeline を使用しています。

このエラーの取得:

Traceback (most recent call last): 
File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) 
File "/Users/office/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line utility.execute() 
File "/Users/office/lib/python2.7/site-packages/django/core/management/__init__.py", line 330, in execute self.fetch_command(subcommand).run_from_argv(self.argv) 
File "/Users/office/lib/python2.7/site-packages/django/core/management/base.py", line 390, in run_from_argv self.execute(*args, **cmd_options) 
File "/Users/office/lib/python2.7/site-packages/django/core/management/base.py", line 441, in execute output = self.handle(*args, **options) 
File "/Users/office/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 168, in handle collected = self.collect() 
File "/Users/office/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 120, in collect raise processed ValueError: The file 'bower_components/eonasdan-bootstrap-datetimepicker/build/fonts/glyphicons-halflings-regular.eot' could not be found with <pipeline.storage.PipelineCachedStorage object at 0x10d274e10>.

これを修正する方法はありますか?


実際、標準 API を使用しても、select インタラクションをカスタム インタラクションにラップして、関数をデバウンスできます。handleEvent

var app = {};
app.DebounceSelect = function() {
  this.selectInteraction = new ol.interaction.Select({
    condition: ol.events.condition.pointerMove
  });

  var handleEventDebounce = debounce(function(evt) {
    return ol.interaction.Select.handleEvent.call(this.selectInteraction, evt);
  }.bind(this), 100);

  ol.interaction.Interaction.call(this, {
    handleEvent: function(evt) {
        handleEventDebounce(evt);
      // always return true so that other interactions can
      // also process the event
      return true;
    }
  });
};
ol.inherits(app.DebounceSelect, ol.interaction.Interaction);

app.DebounceSelect.prototype.setMap = function(map) {
  this.selectInteraction.setMap(map);
};

var select = new app.DebounceSelect();
map.addInteraction(select);

http://jsfiddle.net/n9nbrye8/3/

カスタムインタラクションの書き方の参考例: http://openlayers.org/en/master/examples/custom-interactions.html

ol.interaction.Select.handleEventのドキュメント

4

1 に答える 1

1

django-pipeline-forgiving( https://pypi.python.org/pypi/django-pipeline-forgiving ) を使用すると問題が解決しました。

  • pip install django-pipeline-forgiving
  • settings.py で設定します: STATICFILES_STORAGE = 'django_pipeline_forgiving.storages.PipelineForgivingStorage'
于 2016-02-19T05:46:38.277 に答える