Hi I have this error.. i searched before write and try
/usr/bin/python3 with out env
and i get this error:
Traceback (most recent call last):
File "/home/pepew/algostock/dashboard/loadcloseprice.py", line 11, in <module>
application = get_wsgi_application()
File "/usr/lib/python3.5/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
django.setup(set_prefix=False)
File "/usr/lib/python3.5/site-packages/django/__init__.py", line 19, in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
File "/usr/lib/python3.5/site-packages/django/conf/__init__.py", line 79, in __getattr__
self._setup(name)
File "/usr/lib/python3.5/site-packages/django/conf/__init__.py", line 66, in _setup
self._wrapped = Settings(settings_module)
File "/usr/lib/python3.5/site-packages/django/conf/__init__.py", line 157, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 985, in _gcd_import
File "<frozen importlib._bootstrap>", line 968, in _find_and_load
File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 697, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/home/pepew/algostock/algostock/settings.py", line 146, in <module>
os.path.join(BASE_DIR, 'templates'),
File "/usr/lib/python3.5/posixpath.py", line 89, in join
genericpath._check_arg_types('join', a, *p)
File "/usr/lib/python3.5/genericpath.py", line 143, in _check_arg_types
(funcname, s.__class__.__name__)) from None
TypeError: join() argument must be str or bytes, not 'PosixPath'
2021-02-04 14:52:05 -- Completed task, took 2.65 seconds, return code was 1.
In my console works perfectly, but when i send to Tasks i have the problem..
My program begins like that:
#!/usr/bin/env python3
import os, sys
sys.path.append('/home/pepew/.virtualenvs/myproject/lib/python3.8/site-packages')
proj_path = "/home/pepew/algostock/"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "algostock.settings")
sys.path.append(proj_path)
os.chdir(proj_path)
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
from pandas_datareader import data as pdr
from dashboard.models import trade
Thank you in advance
pepew
[edited by admin- formatting]