{"id":19522658,"url":"https://github.com/lintangwisesa/crud_flask_postgresql","last_synced_at":"2025-10-07T09:50:44.529Z","repository":{"id":53849767,"uuid":"164056757","full_name":"LintangWisesa/CRUD_Flask_PostgreSQL","owner":"LintangWisesa","description":"Basic CRUD with Python Flask \u0026 PostgreSQL Database","archived":false,"fork":false,"pushed_at":"2024-02-26T19:58:50.000Z","size":7,"stargazers_count":17,"open_issues_count":2,"forks_count":16,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-20T23:07:09.092Z","etag":null,"topics":["flask","postgresql","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LintangWisesa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-01-04T04:11:28.000Z","updated_at":"2025-03-08T05:01:15.000Z","dependencies_parsed_at":"2025-04-26T09:42:25.109Z","dependency_job_id":null,"html_url":"https://github.com/LintangWisesa/CRUD_Flask_PostgreSQL","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LintangWisesa/CRUD_Flask_PostgreSQL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LintangWisesa%2FCRUD_Flask_PostgreSQL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LintangWisesa%2FCRUD_Flask_PostgreSQL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LintangWisesa%2FCRUD_Flask_PostgreSQL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LintangWisesa%2FCRUD_Flask_PostgreSQL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LintangWisesa","download_url":"https://codeload.github.com/LintangWisesa/CRUD_Flask_PostgreSQL/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LintangWisesa%2FCRUD_Flask_PostgreSQL/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278755144,"owners_count":26040032,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","postgresql","python"],"created_at":"2024-11-11T00:40:12.248Z","updated_at":"2025-10-07T09:50:44.495Z","avatar_url":"https://github.com/LintangWisesa.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![simplinnovation](https://4.bp.blogspot.com/-f7YxPyqHAzY/WJ6VnkvE0SI/AAAAAAAADTQ/0tDQPTrVrtMAFT-q-1-3ktUQT5Il9FGdQCLcB/s350/simpLINnovation1a.png)\n\n# Basic CRUD: Flask \u0026 PostgreSQL\n\n1. Activate __PostgreSQL__ server:\n    \n    ```bash\n    $ cd C:\\Program Files\\PostgreSQL\\10\\bin\n    $ psql -U postgres\n      Password for user postgres: \u003cinsert password here\u003e\n    ```\n\n#\n\n2. Create a database on PostgreSQL, my database name is __\"lin_flask\"__:\n    \n    ```bash\n    postgres=#  CREATE DATABASE lin_flask;\n    postgres=#  \\l \n    postgres=#  \\c lin_flask\n    ``` \n\n#\n\n3. Create a __\"users\"__ table on __\"lin_flask\"__ database:\n    \n    ```bash\n    lin_flask=#  CREATE TABLE users(\n                 id SERIAL PRIMARY KEY,\n                 name VARCHAR(255),\n                 age VARCAR(255)\n                 );\n    lin_flask=#  \\d\n    ``` \n\n#\n\n4. Clone this repo. Insert your database URI to __database.yaml__ file, then install all the packages needed. In this project I'm using __flask__, __flask_cors__, __flask_mysqldb__, __Flask-SQLAlchemy__ \u0026 __psycopg2__:\n    ```bash\n    $ git clone https://github.com/LintangWisesa/CRUD_Flask_PostgreSQL.git\n    $ cd CRUD_Flask_PostgreSQL\n    $ pip install flask flask_cors Flask-SQLAlchemy psycopg2\n    ```\n\n#\n\n5. Run the server file. Make sure your PostgreSQL server is still running. Your application server will run locally at __*http://localhost:5000/*__ :\n    ```bash\n    $ python app.py\n    ```\n\n#\n\n6. Give a request to the server. You can use __Postman__ app:\n    \n    __See the opening screen (*home.html*)__\n    ```bash\n    GET /\n    ```\n\n    __Post a data to database:__ \n    ```bash\n    POST /data\n    body request: {name:\"x\", age:\"y\"}\n    ```\n    __Get all data \u0026 specific data by id:__\n    ```bash\n    GET /data\n    GET /data/{:id}\n    ```\n    __Update a data by id__:\n    ```bash\n    PUT /data/{:id}\n    body request: {name:\"x\", age:\"y\"}\n    ```\n    __Delete a data by id:__\n    ```bash\n    DELETE /data/{:id}\n    ```\n\n#\n\n7. Enjoy your code! 😎👌\n\n## See also:\n\n- [Basic CRUD: Flask \u0026 MySQL](https://github.com/LintangWisesa/CRUD_Flask_MySQL)\n- [Basic CRUD: Flask \u0026 PostgreSQL](https://github.com/LintangWisesa/CRUD_Flask_PostgreSQL)\n- [Basic CRUD: Flask \u0026 MongoDB](https://github.com/LintangWisesa/CRUD_Flask_MongoDB)\n\n#\n\n#### Lintang Wisesa :love_letter: _lintangwisesa@ymail.com_\n\n[Facebook](https://www.facebook.com/lintangbagus) | \n[Twitter](https://twitter.com/Lintang_Wisesa) |\n[Google+](https://plus.google.com/u/0/+LintangWisesa1) |\n[Youtube](https://www.youtube.com/user/lintangbagus) | \n:octocat: [GitHub](https://github.com/LintangWisesa) |\n[Hackster](https://www.hackster.io/lintangwisesa)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flintangwisesa%2Fcrud_flask_postgresql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flintangwisesa%2Fcrud_flask_postgresql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flintangwisesa%2Fcrud_flask_postgresql/lists"}