an4s911 Posted yesterday at 05:04 PM Posted yesterday at 05:04 PM (edited) I have a django api running on heliohost on the domain anasbashir.helioho.st. And I got wsgi access also got postgres enabled. But how can I access the postgres. I want to be able to migrate the django models into database, for that either I need remote access to the postgres or terminal access to the server. The manage.py file is located in /httpdocs/manage.py And the command to migrate is python manage.py migrate. Secondly, where do I access the traceback log if any error occurs, I couldn’t find it. Additionally, if I wanted to log something using python’s logging module, where can I log to, and how can I access it. Edit: I wanted to mention that I did find the logs. Just that I couldn’t find any traceback in it. Edited yesterday at 05:06 PM by an4s911 Quote
wolstech Posted 9 hours ago Posted 9 hours ago Tracebacks usually dump into the Plesk Logs section if there is one. They're a bit hard to read because of how Plesk formats them, but they're usually there. If you can't find what you need, just let us know and Krydos can check the backend for any additional logs. As for Postgres, there is no management tool and it does not support remote access by default. You have to either install something like Adminer, or request remote access to it so you can connect from a desktop tool like pgadmin and configure it that way. What is the name of the database and database user that needs remote access? Quote
an4s911 Posted 9 hours ago Author Posted 9 hours ago (edited) The name of the database is: an4s911_anas and the user is: an4s911_admin Also give me info on how I can connect to it from my Django app. Should I just use localhost? Will that work? Edited 9 hours ago by an4s911 add user info Quote
an4s911 Posted 9 hours ago Author Posted 9 hours ago 3 minutes ago, wolstech said: If you can't find what you need, just let us know and Krydos can check the backend for any additional logs. Yeah, I couldn't find them. In plesk I opened logs. I only get the Requests and Http status codes. I don't see the trackeback of the errors. Quote
wolstech Posted 6 hours ago Posted 6 hours ago To access it from a Django app running on our server, yes just localhost. To access it remotely, you’ll use the server host name (tommy.heliohost.org). Escalating to Krydos. 1 Quote
Krydos Posted 3 hours ago Posted 3 hours ago 6 hours ago, an4s911 said: The name of the database is: an4s911_anas and the user is: an4s911_admin Remote access enabled. host=65.19.154.90 port=5432 user=an4s911_admin dbname=an4s911_anas password=<set in Plesk> 6 hours ago, an4s911 said: I don't see the trackeback of the errors. [Mon Apr 28 23:41:41.088433 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] return _bootstrap._gcd_import(name[level:], package, level) [Mon Apr 28 23:41:41.088443 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [Mon Apr 28 23:41:41.088454 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] File "<frozen importlib._bootstrap>", line 1387, in _gcd_import [Mon Apr 28 23:41:41.088464 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] File "<frozen importlib._bootstrap>", line 1360, in _find_and_load [Mon Apr 28 23:41:41.088473 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked [Mon Apr 28 23:41:41.088482 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] File "<frozen importlib._bootstrap>", line 935, in _load_unlocked [Mon Apr 28 23:41:41.088491 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] File "<frozen importlib._bootstrap_external>", line 995, in exec_module [Mon Apr 28 23:41:41.088509 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed [Mon Apr 28 23:41:41.088519 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] File "/home/anasbashir.helioho.st/httpdocs/library_app/migrations/0001_initial.py", line 7, in <module> [Mon Apr 28 23:41:41.088529 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] class Migration(migrations.Migration): [Mon Apr 28 23:41:41.088538 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] File "/home/anasbashir.helioho.st/httpdocs/library_app/migrations/0001_initial.py", line 59, in Migration [Mon Apr 28 23:41:41.088549 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] 'constraints': [models.CheckConstraint(condition=models.Q(('is_borrowed', False), ('returned_date__isnull', True), _connector='OR'), name='borrow_returned_implies_not_borrowed_check'), models.UniqueConstraint(condition=models.Q(('is_borrowed', True)), fields=('book',), name='borrow_unique_active_borrow_per_book')], [Mon Apr 28 23:41:41.088561 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [Mon Apr 28 23:41:41.088572 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] TypeError: CheckConstraint.__init__() got an unexpected keyword argument 'condition' Quote
an4s911 Posted 2 hours ago Author Posted 2 hours ago Thanks a lot for giving me remote access for the postgres. 47 minutes ago, Krydos said: [Mon Apr 28 23:41:41.088433 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] return _bootstrap._gcd_import(name[level:], package, level) [Mon Apr 28 23:41:41.088443 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [Mon Apr 28 23:41:41.088454 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] File "<frozen importlib._bootstrap>", line 1387, in _gcd_import [Mon Apr 28 23:41:41.088464 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] File "<frozen importlib._bootstrap>", line 1360, in _find_and_load [Mon Apr 28 23:41:41.088473 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked [Mon Apr 28 23:41:41.088482 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] File "<frozen importlib._bootstrap>", line 935, in _load_unlocked [Mon Apr 28 23:41:41.088491 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] File "<frozen importlib._bootstrap_external>", line 995, in exec_module [Mon Apr 28 23:41:41.088509 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed [Mon Apr 28 23:41:41.088519 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] File "/home/anasbashir.helioho.st/httpdocs/library_app/migrations/0001_initial.py", line 7, in <module> [Mon Apr 28 23:41:41.088529 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] class Migration(migrations.Migration): [Mon Apr 28 23:41:41.088538 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] File "/home/anasbashir.helioho.st/httpdocs/library_app/migrations/0001_initial.py", line 59, in Migration [Mon Apr 28 23:41:41.088549 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] 'constraints': [models.CheckConstraint(condition=models.Q(('is_borrowed', False), ('returned_date__isnull', True), _connector='OR'), name='borrow_returned_implies_not_borrowed_check'), models.UniqueConstraint(condition=models.Q(('is_borrowed', True)), fields=('book',), name='borrow_unique_active_borrow_per_book')], [Mon Apr 28 23:41:41.088561 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [Mon Apr 28 23:41:41.088572 2025] [wsgi:error] [pid 1035813:tid 1035826] [remote x.x.x.x:58584] TypeError: CheckConstraint.__init__() got an unexpected keyword argument 'condition' Where can I see this log? I looked for it all over the logs section in Plesk, couldn't find it. Another question is, how can I use environment variables when deploying? Quote
Krydos Posted 2 hours ago Posted 2 hours ago 21 minutes ago, an4s911 said: Where can I see this log? Plesk doesn't do a very good job of filtering Passenger and WSGI logs. It's only accessible to root admins because it has a lot of private info from other accounts in the same file. 22 minutes ago, an4s911 said: Another question is, how can I use environment variables when deploying? Create a file named .env and use the python module dotenv to load it. 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.