mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-18 15:33:02 +00:00
DOC change db_url schema from postgres to postgresql
sqlalchemy no longer supports postgres schema
This commit is contained in:
@@ -143,14 +143,14 @@ We recommend using PostgreSQL for production if you are unsure whether to use
|
|||||||
MySQL or PostgreSQL or if you do not have a strong preference.
|
MySQL or PostgreSQL or if you do not have a strong preference.
|
||||||
There is additional configuration required for MySQL that is not needed for PostgreSQL.
|
There is additional configuration required for MySQL that is not needed for PostgreSQL.
|
||||||
|
|
||||||
For example, to connect to a postgres database with psycopg2:
|
For example, to connect to a PostgreSQL database with psycopg2:
|
||||||
|
|
||||||
1. install psycopg2: `pip install psycopg2` (or `psycopg2-binary` to avoid compilation, which is [not recommended for production][psycopg2-binary])
|
1. install psycopg2: `pip install psycopg2` (or `psycopg2-binary` to avoid compilation, which is [not recommended for production][psycopg2-binary])
|
||||||
2. set authentication via environment variables `PGUSER` and `PGPASSWORD`
|
2. set authentication via environment variables `PGUSER` and `PGPASSWORD`
|
||||||
3. configure [](JupyterHub.db_url):
|
3. configure [](JupyterHub.db_url):
|
||||||
|
|
||||||
```python
|
```python
|
||||||
c.JupyterHub.db_url = "postgres+psycopg2://my-postgres-server:5432/my-db-name"
|
c.JupyterHub.db_url = "postgresql+psycopg2://my-postgres-server:5432/my-db-name"
|
||||||
```
|
```
|
||||||
|
|
||||||
[psycopg2-binary]: https://www.psycopg.org/docs/install.html#psycopg-vs-psycopg-binary
|
[psycopg2-binary]: https://www.psycopg.org/docs/install.html#psycopg-vs-psycopg-binary
|
||||||
|
Reference in New Issue
Block a user