When I run python manage.py runserver on my laptop's terminal, it shows the print output - where do I see this in a Django app in opalstack ? I thought it was in logs uwsgi.log but it isn't it.
print logs of a django app
- Edited
anjanesh uwsgi doesn't log print statements.
My recommendation is that you use Django's logging framework for logging but if you must use print statements for debugging then you'll need to stop your uwsgi instance and then start the Django dev server on the app's assigned port, eg:
cd ~/apps/name_of_app
./stop
source env/bin/activate
cd myproject
# replace NNNNN with your port
python manage.py runserver NNNNN
The app will then run in the foreground and will include the output from your print statements.
So basically, implementing this ? https://philstories.medium.com/django-log-to-file-a-comprehensive-guide-43fa30f2b047
It seems I can't just copy-paste print()
statements to add logger.debug
lines everywhere :
print("request in index =", request)
logger.debug("request in index =", str(request))
TypeError: not all arguments converted during string formatting
This is going to take a while.