-
First of all clone this repo $ git clone https://github.com/1986webdeveloper/python-vuejs-postgresql.git
-
Next yoou have to install required module using below command. $ pip install -r requirements.txt
-
Now you have to create a database with username and password in PostgreSQL and need to set required parameter inside "config.py" file. to set it directly from terminal use this command: $ nano config.py or gedit config.py
-
After adding and saving your database details run below commands one by one. $ python migrate.py db init $ python migrate.py db migrate $ python migrate.py db upgrade $ python run.py
- GET
- http://localhost:5000/api/v1/users.json : For returning a list of all users
- http://localhost:5000/api/v1/users/<'PASS ID HERE'>.json : For returning user details for the given user id if it exists
- POST
- http://localhost:5000/api/v1/users.json : For creating a user and returns with user id
- PUT
- http://localhost:5000/api/v1/users/<'PASS ID HERE'>.json : For updating the user details if the user exists and returns with the updated results
- DELETE
- http://localhost:5000/api/v1/users/<'PASS ID HERE'>.json : For deleting the user by passing their particular id.