我想知道如何最好地将PHPSpreadsheet整合到Joomla中!应用程序,共享托管。
使用PHPExcel,您刚刚上传了库。
PHPSpreadsheet正在使用Composer,这对我来说很新,但看起来很简单。但是,我看到Joomla!包括它来管理核心中的依赖项,但不发布ModuleNotFoundError at /app/v1/results
No module named 'djcelery'
Request Method: POST
Request URL: http://testdeployserver/app/v1/results
Django Version: 2.0.3
Python Executable:
Python Version: 3.6.4
Python Path: ['/var/www/python/proj', '/var/www/python/proj/proj', '/home/alex/anaconda3/envs/clean_django/lib/python36.zip', '/home/alex/anaconda3/envs/clean_django/lib/python3.6', '/home/alex/anaconda3/envs/clean_django/lib/python3.6/lib-dynload', '/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages']
Server time: Tue, 13 Mar 2018 23:00:10 +0000
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'app',
'rest_framework',
'django_celery_results']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']
Traceback:
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/celery/local.py" in _get_current_object
317. return object.__getattribute__(self, '__thing')
During handling of the above exception ('PromiseProxy' object has no attribute '__thing'), another exception occurred:
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/kombu/utils/objects.py" in __get__
42. return obj.__dict__[self.__name__]
During handling of the above exception ('data'), another exception occurred:
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/kombu/utils/objects.py" in __get__
42. return obj.__dict__[self.__name__]
During handling of the above exception ('loader'), another exception occurred:
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
35. response = get_response(request)
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
128. response = self.process_exception_by_middleware(e, request)
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
126. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/django/views/decorators/csrf.py" in wrapped_view
54. return view_func(*args, **kwargs)
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/django/views/generic/base.py" in view
69. return self.dispatch(request, *args, **kwargs)
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/rest_framework/views.py" in dispatch
494. response = self.handle_exception(exc)
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/rest_framework/views.py" in handle_exception
454. self.raise_uncaught_exception(exc)
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/rest_framework/views.py" in dispatch
491. response = handler(request, *args, **kwargs)
File "/var/www/python/proj/app/views.py" in post
24. process_app_result.delay(json.dumps(request.data))
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/celery/local.py" in __getattr__
146. return getattr(self._get_current_object(), name)
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/celery/local.py" in _get_current_object
319. return self.__evaluate__()
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/celery/local.py" in __evaluate__
349. thing = Proxy._get_current_object(self)
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/celery/local.py" in _get_current_object
109. return loc(*self.__args, **self.__kwargs)
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/celery/app/base.py" in _task_from_fun
462. task.bind(self) # connects task to this app
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/celery/app/task.py" in bind
320. setattr(cls, attr_name, conf[config_name])
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/celery/utils/collections.py" in __getitem__
431. return getitem(k)
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/celery/utils/collections.py" in __getitem__
280. return mapping[_key]
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/collections/__init__.py" in __getitem__
987. if key in self.data:
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/kombu/utils/objects.py" in __get__
44. value = obj.__dict__[self.__name__] = self.__get(obj)
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/celery/app/base.py" in data
148. return self.callback()
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/celery/app/base.py" in _finalize_pending_conf
911. conf = self._conf = self._load_config()
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/celery/app/base.py" in _load_config
921. self.loader.config_from_object(self._config_source)
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/kombu/utils/objects.py" in __get__
44. value = obj.__dict__[self.__name__] = self.__get(obj)
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/celery/app/base.py" in loader
1209. return get_loader_cls(self.loader_cls)(app=self)
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/celery/loaders/__init__.py" in get_loader_cls
21. return symbol_by_name(loader, LOADER_ALIASES, imp=import_from_cwd)
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/kombu/utils/imports.py" in symbol_by_name
56. module = imp(module_name, package=package, **kwargs)
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/site-packages/celery/utils/imports.py" in import_from_cwd
101. return imp(module, package=package)
File "/home/alex/anaconda3/envs/clean_django/lib/python3.6/importlib/__init__.py" in import_module
126. return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>" in _gcd_import
994. <source code not available>
File "<frozen importlib._bootstrap>" in _find_and_load
971. <source code not available>
File "<frozen importlib._bootstrap>" in _find_and_load_unlocked
941. <source code not available>
File "<frozen importlib._bootstrap>" in _call_with_frames_removed
219. <source code not available>
File "<frozen importlib._bootstrap>" in _gcd_import
994. <source code not available>
File "<frozen importlib._bootstrap>" in _find_and_load
971. <source code not available>
File "<frozen importlib._bootstrap>" in _find_and_load_unlocked
953. <source code not available>
Exception Type: ModuleNotFoundError at /app/v1/results
Exception Value: No module named 'djcelery'
文件,并提交composer.json
子文件夹。
有关安全添加PHPSpreadsheet以便Joomla可用的最佳方法的任何建议!扩展,没有弄乱Joomla!芯
答案 0 :(得分:0)
您只需在Joomla的根文件夹中添加一个普通的composer.json
文件即可。然后,Composer将在主级别创建一个vendor
文件夹,并保留Joomla核心的libraries/vendor
文件夹。
任何想要使用根vendor
文件夹中的库的扩展程序都必须自行加载相应的vendor/autoload.php
。
答案 1 :(得分:0)
使用
JLoader::registerNamespace('PhpOffice', $pathToPhpOffice);
答案 2 :(得分:-1)
与上述内容类似......但是如何在托管网站上安装PHPSpreadsheet,我对后端的访问权限有限。
我可以FTP到网站的根目录。