To show the DjDT (Django-debug-Toolbar), need DEBUG=True and IP of the request must be in the INTERNAL_IPS.
(https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#internal-ips)
Month: January 2022
Cannot connect to PostgreSQL (listening on port 5432) in Bitnami Django (VM VirtualBox)
Edit the postgresql.conf (in the folder /opt/bitnami/postgresql/conf), by adding this line
#-------------------------------------------
# CONNECTONS AND AUTHENTICATION
#-------------------------------------------
listen_addresses = '*'
Restart the service,
bitnami@debian:~$ sudo /opt/bitnami/ctlscript.sh restart postgresql
Check the remote connection again,
bitnami@debian:~$ pg_isready
git error: remote origin already exists
Sometime when we initialize the Local Repo, we get error: remote origin already exists.
The following step is solution.
Initialize the current folder as a Git repo:
bitnami@debian:~$ git init
bitnami@debian:~$ git remote add origin [email protected]:username/repostioryname.git
Then, error occurs:
error: remote origin already exists.
We need to remove the older origin by:
bitnami@debian:~$ git remote rm origin
Then, add the origin again:
bitnami@debian:~$ git remote add origin [email protected]:username/repostioryname.git
Add files:
bitnami@debian:~$ git add .
Commit with the descriptive message:
bitnami@debian:~$ git commit -m "Comment message"
Push the changes:
bitnami@debian:~$ git push -u origin master
Bitnami Django: Start or Stop Services (Apache, MariaDB, PostgreSQL)
Check the status of a service:
bitnami@debian:~$ sudo /opt/bitnami/ctlscript.sh status
Start, Stop, Restart all services:
bitnami@debian:~$ sudo /opt/bitnami/ctlscript.sh start
bitnami@debian:~$ sudo /opt/bitnami/ctlscript.sh stop
bitnami@debian:~$ sudo /opt/bitnami/ctlscript.sh restart
Restart a single service, such as Apache only, by passing the service name as argument:
bitnami@debian:~$ sudo /opt/bitnami/ctlscript.sh restart apache
Generate settings.SECRET_KEY in Django
Run the command below,
bitnami@debian:~$ python -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())'