Skip to content

jnadeu/sqlalchemy-tutorial

 
 

Repository files navigation

SQLAlchemy tutorial

Tutorial for SQLAlchemy as part of the PyDayBCN.

Installation

You need PostgreSQL 11 or newer and Python 3.7 or newer (3.6 should work but I have not tested it).

git clone https://github.com/bustawin/sqlalchemy-tutorial
cd sqlalchemy-tutorial
pip3 install -e . -r requirements.txt

Optionally, you can have it inside a virtualenv.

We will use a test dummy database in Postgres. Creating this database differs from OS:

  • Mac: Execute the init-db.sh file that exists in this repo: sh init-db.sh.
  • Linux: As in Mac. However, in some distros like Debian, you will need to switch to the Postgres user, like sudo su postgres, to be able to write these commands, as your regular user doesn't have access to the whole PSQL database.
  • Windows: Add Postgres /bin from Program Files into the system PATH. Copy and paste the commands of the init-db.sh file in your CMD, adding the option -U <postgres-user> to each command, so the command executes with your postgres user. By default the postgres user is postgres and you are asked to create a password for it during Postgres installation.

I will be available in class to help you with any problem regarding the installation, so don't worry :-). As a minimum, have Postgres, Python, and Git downloaded.

Important

Remember to git pull before the class to ensure you have the latest version and re-execute pip3 install -e . -r requirements.txt

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.1%
  • Shell 0.9%