In the last section we learned how we can troubleshoot certain issues that I faced while deployment. Today we go ahead and see how you can work with your OS (Debian in my case)
Checking sources for debian installation
You can check sources using below command
sudo nano /etc/apt/sources.list
Removing setup tools installed files manually (setuptools) python package
Note if you are using pillow the new fork of PIL only one can exist. Either PIL or Pillow. We are using reportlab that uses pillow.
sudo python setup.py install –record files.txt
# inspect files.txt to make sure it looks ok. Then:
tr ‘\n’ ‘\0’ < files.txt | xargs -0 sudo rm -f —
To uninstall PIL if installed using dist packages . Delete the PIL directory once above is taken care of from path /usr/local/lib/python2.7/dist-packages/ PIL
using rm -rf <dir-name> command
Installing a python package forcefully using pip
pip install –upgrade –force-reinstall reportlab
Other commands
pip install reportlab
easy_install reportlab
pip install -ihttps://www.reportlab.com/pypi -U reportlab
Uninstall a python package
pip uninstall reportlab
Upgrade pip
Python –m pip install –upgrade pip — This works if pip is already installed
Postgres SQL
In one of the upcoming article we would discuss the basics of handling Postgres DB. This is the DB that I had been using for my development purposes
6] Configure postgres sql
Create all required databases and
Follow section Configuring postgres for web2py for configuration below
sudo -u postgres psql
7] DB access actual line for postgres (after configuration) in modesl/db.py
db = DAL(‘postgres://postgres:onlineserver@localhost:5432/bugbase’, pool_size=500,)
Debugging
- launch web2py from local instance on a public IP and port and try to check the errors
- Killing locally launched web2py use kill -SIGTERM <#>
- ps aux to find processes
OR
- navigate to production machine – go to application/errors folder
- copy the tickets to local web2py / any application /errors folder
- and launch errors for the same app and check the description
Sessions – Cleanup
Sessions and their cleanup using session2trash.py
Superb posts! Have a look at my page where I also put in extra effort to create quality information about Thai-Massage.