piku/examples/python-postgres
dependabot[bot] 77c62719e5
Bump sqlparse from 0.3.0 to 0.4.4 in /examples/python-postgres
Bumps [sqlparse](https://github.com/andialbrecht/sqlparse) from 0.3.0 to 0.4.4.
- [Release notes](https://github.com/andialbrecht/sqlparse/releases)
- [Changelog](https://github.com/andialbrecht/sqlparse/blob/master/CHANGELOG)
- [Commits](https://github.com/andialbrecht/sqlparse/compare/0.3.0...0.4.4)

---
updated-dependencies:
- dependency-name: sqlparse
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-21 20:35:26 +00:00
..
bin reset file permissions 2021-12-07 09:49:50 +00:00
pikudjango reset file permissions 2021-12-07 09:49:50 +00:00
.gitignore reset file permissions 2021-12-07 09:49:50 +00:00
.python-version reset file permissions 2021-12-07 09:49:50 +00:00
ENV reset file permissions 2021-12-07 09:49:50 +00:00
Procfile reset file permissions 2021-12-07 09:49:50 +00:00
README.md reset file permissions 2021-12-07 09:49:50 +00:00
manage.py reset file permissions 2021-12-07 09:49:50 +00:00
requirements.txt Bump sqlparse from 0.3.0 to 0.4.4 in /examples/python-postgres 2023-04-21 20:35:26 +00:00

README.md

Postgres backed Python + Django app

This is a simple Piku app to demonstrate deploying a Postgres backed Django app.

During the release worker phase this app creates a Postgres database, as well as running the Django collectstatic and migrate tasks. The release worker will use the domain name (NGINX_SERVER_NAME) for the database name and the Django app assumes this in settings.py, so make sure you set the config variable to specify a domain name. See below for instructions.

In order for this to work you will first need to install postgresql on your Piku server. You can do this with the bootstrap script:

ssh root@my-piku-server
./piku-bootstrap postgres.yml

To publish this app to piku, make a copy of this folder and run the following commands inside the copy:

git init .
git remote add piku piku@your_server:pypostgres
git add .
git commit -a -m "initial commit"
git push piku master

Then you can connect a domain, set up an SSL cert, and create a database, by setting the NGINX_SERVER_NAME config variable.

piku config:set NGINX_SERVER_NAME=your_domain_name.com NGINX_HTTPS_ONLY=1

You can also create a super user and set a password like this:

piku run -- ./manage.py createsuperuser --email your@email.com --username admin --no-input
piku run -- ./manage.py changepassword admin

You will not see a prompt after the second command but you can type a new password anyway and hit enter.