Go into folder where you want to generate virtual environment.
python3 -m venv ./venv/
Set venv as used python environment to run your code.
source /venv/bin/activate
After setting venv as used environment install all packages from requirements.txt.
python3 -m pip install -r requirements.txt
If you get an error package requirements.txt doesn't exist you only have to add the -r flag, which you forgot before.
Install any new python package with the following command:
(venv) user-pc:franglomat user$ python3 -m pip install flask-restful
Generate a requirements.txt file after installing all needed pyhton packages. Don't forget to generate always a new requirements.txt file after installing new python packages. Otherwise it is not possible for every developer to set up a correct venv!
(venv) user-pc:franglomat user$ python3 -m pip freeze > requirements.txt
basic knowledge about flask_restulf
json web tokens
basic relationships in sqlalchemy
After installing PostgreSQL on Ubuntu you have to follow these steps create postgres user
brew uninstall --force postgresql
rm -rf /usr/local/var/postgres
brew install postgres
Postgis increases Postgres management capabilities by adding geospatial types and functions to enhance spatial data handled within a relational database structure.
brew install postgis
rm -r /usr/local/var/postgres
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres/ -l logfile start
createdb <database>
psql <database>
CREATE EXTENSION postgis;
sudo -u postgres psql
postgres=# create database <database>;
postgres=# create user <user> with encrypted password '<password>';
postgres=# grant all privileges on database <database> to <user>;
psql vocabulary
vocabulary=# create user vocabulary_user with encrypted password 'password';
vocabulary=# grant all privileges on database vocabulary to vocabulary_user;
Checking if new user has the right rights for the database.
psql -h localhost -d vocabulary -U vocabulary_user
If database opens all worked correctly, hardly always you have to enter a password for user vocabulary_user which is password in our case.