{"id":1031,"date":"2026-07-02T06:44:49","date_gmt":"2026-07-01T23:44:49","guid":{"rendered":"https:\/\/sumberlaba.com\/index.php\/2026\/07\/02\/a-comprehensive-guide-to-using-sqlalchemy-with-flask-from-setup-to-advanced-queries\/"},"modified":"2026-07-02T06:44:49","modified_gmt":"2026-07-01T23:44:49","slug":"a-comprehensive-guide-to-using-sqlalchemy-with-flask-from-setup-to-advanced-queries","status":"publish","type":"post","link":"https:\/\/sumberlaba.com\/index.php\/2026\/07\/02\/a-comprehensive-guide-to-using-sqlalchemy-with-flask-from-setup-to-advanced-queries\/","title":{"rendered":"A Comprehensive Guide to Using SQLAlchemy with Flask: From Setup to Advanced Queries"},"content":{"rendered":"<h1>A Comprehensive Guide to Using SQLAlchemy with Flask: From Setup to Advanced Queries<\/h1>\n<h2>Introduction<\/h2>\n<p>Flask, the lightweight and flexible Python web framework, has gained immense popularity for building web applications ranging from simple APIs to complex data-driven platforms. When it comes to handling databases in Flask, one of the most powerful and widely adopted tools is SQLAlchemy. SQLAlchemy is a full-featured Object Relational Mapper (ORM) that provides a high-level abstraction over raw SQL, allowing developers to work with databases using Python objects and methods rather than writing tedious SQL queries by hand. Combined with Flask\u2019s modular design and the official extension Flask-SQLAlchemy, you get a robust, production-ready solution for data persistence. In this tutorial, we will walk you through everything you need to know to integrate SQLAlchemy into your Flask projects, from basic setup and model definition to complex querying, migrations, and performance optimization.<\/p>\n<p>Whether you are a beginner just starting with Flask or an experienced developer looking to refine your database interactions, this guide will provide you with a step-by-step, practical approach. You will learn how to define database models that map directly to tables, how to establish relationships between those models (one-to-many, many-to-many), and how to perform Create, Read, Update, and Delete (CRUD) operations seamlessly. We will also cover advanced topics such as using Flask-Migrate for schema evolution, avoiding common pitfalls like the N+1 query problem, and writing efficient queries using joins and eager loading. By the end, you will have a solid foundation to build data-driven Flask applications with confidence and maintainability.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/via.placeholder.com\/800x600\/4a90d9\/ffffff?text=how%20to%20use%20SQLAlchemy%20with%20Flask\" alt=\"Article illustration\" style=\"display:block;margin:20px auto;max-width:100%;height:auto;border-radius:8px;\" \/><\/p>\n<h2>Step-by-Step Guide to Using SQLAlchemy with Flask<\/h2>\n<h3>Step 1: Setting Up the Environment and Installing Dependencies<\/h3>\n<p>Before we dive into coding, it is essential to create a clean and isolated environment for our project. Start by creating a new directory for your Flask application and setting up a virtual environment. Using a virtual environment ensures that the packages you install do not conflict with other projects on your system. Open your terminal and run the following commands:<\/p>\n<pre><code>mkdir flask_sqlalchemy_tutorial\ncd flask_sqlalchemy_tutorial\npython -m venv venv\nsource venv\/bin\/activate  # On Windows use: venv\\Scripts\\activate\n<\/code><\/pre>\n<p>Once your virtual environment is active, install Flask, Flask-SQLAlchemy, and a database driver. The most common database choices are SQLite (for development and testing) and PostgreSQL\/MySQL (for production). For this tutorial, we will use SQLite because it does not require a separate server, making it perfect for learning. However, the concepts are database-agnostic, so you can easily switch later. Run the following pip command:<\/p>\n<pre><code>pip install flask flask-sqlalchemy\n<\/code><\/pre>\n<p>If you plan to use MySQL in production, you would also install <code>pymysql<\/code> or <code>mysqlclient<\/code>; for PostgreSQL, <code>psycopg2-binary<\/code>. For SQLite, no additional driver is needed because it is built into Python. With the packages installed, you are ready to create your application structure.<\/p>\n<h3>Step 2: Configuring the Flask App with SQLAlchemy<\/h3>\n<p>Now create a file named <code>app.py<\/code> at the root of your project. This file will contain the core application logic. We start by importing Flask and SQLAlchemy, then initializing the SQLAlchemy object. It is important to understand that Flask-SQLAlchemy binds the database engine to your application instance, which simplifies session management and configuration. Here is the basic setup:<\/p>\n<pre><code>from flask import Flask\nfrom flask_sqlalchemy import SQLAlchemy\n\napp = Flask(__name__)\napp.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:\/\/\/site.db'  # relative path to SQLite database file\napp.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False  # suppresses a warning\ndb = SQLAlchemy(app)\n<\/code><\/pre>\n<p>The key configuration parameter is <code>SQLALCHEMY_DATABASE_URI<\/code>, which tells SQLAlchemy which database to connect to. For SQLite, the format is <code>sqlite:\/\/\/database_name.db<\/code>. The triple slash indicates a relative path to the application root. Setting <code>SQLALCHEMY_TRACK_MODIFICATIONS<\/code> to <code>False<\/code> disables an event system that uses memory unnecessarily. After this, we have a <code>db<\/code> instance that we will use to define models, create tables, and interact with the database.<\/p>\n<h3>Step 3: Defining Your First Database Models<\/h3>\n<p>A model in SQLAlchemy is a Python class that inherits from <code>db.Model<\/code> and represents a table in the database. Each attribute of the class corresponds to a column. Let\u2019s create two models for a simple blog application: <code>User<\/code> and <code>Post<\/code>. A user can have many posts (one-to-many relationship). Place the model definitions after the <code>db<\/code> initialization in <code>app.py<\/code>:<\/p>\n<pre><code>class User(db.Model):\n    id = db.Column(db.Integer, primary_key=True)\n    username = db.Column(db.String(20), unique=True, nullable=False)\n    email = db.Column(db.String(120), unique=True, nullable=False)\n    password = db.Column(db.String(60), nullable=False)\n    posts = db.relationship('Post', backref='author', lazy=True)\n\n    def __repr__(self):\n        return f\"User('{self.username}', '{self.email}')\"\n\nclass Post(db.Model):\n    id = db.Column(db.Integer, primary_key=True)\n    title = db.Column(db.String(100), nullable=False)\n    content = db.Column(db.Text, nullable=False)\n    date_posted = db.Column(db.DateTime, nullable=False, default=datetime.utcnow)\n    user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)\n\n    def __repr__(self):\n        return f\"Post('{self.title}', '{self.date_posted}')\"\n<\/code><\/pre>\n<p>Notice the use of <code>db.relationship<\/code> on the <code>User<\/code> model to define the one-to-many relationship. The <code>backref='author'<\/code> creates a virtual column on the <code>Post<\/code> model called <code>author<\/code> that gives direct access to the related User object. The <code>lazy=True<\/code> argument means that when you query a User, its posts are loaded on demand (lazily) \u2013 we will discuss other loading strategies later. Also note the <code>db.ForeignKey<\/code> in the <code>Post<\/code> model ties each post to a user via the <code>user_id<\/code> column referencing <code>user.id<\/code>. Don\u2019t forget to import <code>datetime<\/code> at the top: <code>from datetime import datetime<\/code>.<\/p>\n<h3>Step 4: Creating the Database and Tables<\/h3>\n<p>With models defined, we need to create the actual database tables. Flask-SQLAlchemy provides a convenient method <code>db.create_all()<\/code> that inspects all defined models and creates the corresponding tables. However, it will not update existing tables if you later modify models; for that we use migrations (covered later). Add the following code at the bottom of <code>app.py<\/code> to create the tables when the script runs directly:<\/p>\n<pre><code>if __name__ == '__main__':\n    db.create_all()\n    app.run(debug=True)\n<\/code><\/pre>\n<p>Now run <code>python app.py<\/code> from your terminal. You should see output indicating the Flask development server is running. If you check your project directory, a file named <code>site.db<\/code> will appear. That is your SQLite database. You can verify the tables were created using a tool like DB Browser for SQLite or by opening a Python shell and querying the database. For a quick test, stop the server and run <code>python<\/code> interactively:<\/p>\n<pre><code>&gt;&gt;&gt; from app import app, db, User, Post\n&gt;&gt;&gt; with app.app_context():\n...     db.create_all()  # no error means tables exist\n...     print(User.query.all())\n[]\n<\/code><\/pre>\n<p>You should get an empty list \u2013 the tables are ready.<\/p>\n<h3>Step 5: Performing CRUD Operations via Flask Routes<\/h3>\n<p>Now we will build Flask routes that allow us to create, read, update, and delete records. It is crucial to understand the concept of a database session: SQLAlchemy uses sessions to group operations into a transaction. Flask-SQLAlchemy automatically creates and manages a session for each request, accessible via <code>db.session<\/code>. Let\u2019s implement a simple route to add a new user and a post. Add these routes to <code>app.py<\/code> before the <code>if __name__<\/code> block:<\/p>\n<pre><code>@app.route('\/add_user')\ndef add_user():\n    user = User(username='john_doe', email='john@example.com', password='secret123')\n    db.session.add(user)\n    db.session.commit()\n    return f'User {user.username} added with id {user.id}'\n\n@app.route('\/add_post')\ndef add_post():\n    # Fetch the user first\n    user = User.query.first()\n    if user:\n        post = Post(title='First Post', content='This is the content', author=user)\n        db.session.add(post)\n        db.session.commit()\n        return f'Post \"{post.title}\" created by {post.author.username}'\n    return 'No user found. Create a user first.'\n<\/code><\/pre>\n<p>Run the server and visit <code>http:\/\/127.0.0.1:5000\/add_user<\/code> in your browser. You should see a success message. Then visit <code>\/add_post<\/code> to create a post associated with that user. To read data, you can use the query interface. Add a route that displays all users and their posts as JSON:<\/p>\n<pre><code>from flask import jsonify\n\n@app.route('\/users')\ndef get_users():\n    users = User.query.all()\n    users_data = []\n    for user in users:\n        posts_data = [{'title': p.title, 'content': p.content} for p in user.posts]\n        users_data.append({\n            'id': user.id,\n            'username': user.username,\n            'email': user.email,\n            'posts': posts_data\n        })\n    return jsonify(users_data)\n<\/code><\/pre>\n<p>Update and delete operations follow the same session pattern: fetch the object, modify it or delete it with <code>db.session.delete()<\/code>, then commit. For example, a route to change a user\u2019s email could look like:<\/p>\n<pre><code>@app.route('\/update_email\/&lt;int:user_id&gt;\/&lt;new_email&gt;')\ndef update_email(user_id, new_email):\n    user = User.query.get_or_404(user_id)\n    user.email = new_email\n    db.session.commit()\n    return f'Email updated to {user.email}'\n<\/code><\/pre>\n<p>And to delete a post by id:<\/p>\n<pre><code>@app.route('\/delete_post\/&lt;int:post_id&gt;')\ndef delete_post(post_id):\n    post = Post.query.get_or_404(post_id)\n    db.session.delete(post)\n    db.session.commit()\n    return f'Post {post_id} deleted'\n<\/code><\/pre>\n<h3>Step 6: Advanced Querying \u2013 Filters, Joins, and Eager Loading<\/h3>\n<p>SQLAlchemy provides a rich query API that goes far beyond simple retrieval. Filters allow you to add WHERE clauses, and you can chain them. For example, to find users whose username starts with &#8220;john&#8221;:<\/p>\n<pre><code>users = User.query.filter(User.username.like('john%')).all()\n<\/code><\/pre>\n<p>You can also order results: <code>Post.query.order_by(Post.date_posted.desc()).all()<\/code>. When working with relationships, the lazy loading default can cause the N+1 query problem: if you iterate over users and access each user\u2019s posts, a separate SQL query fires for each user. To avoid this, use eager loading with <code>joinedload<\/code> or <code>subqueryload<\/code>. For example:<\/p>\n<pre><code>from sqlalchemy.orm import joinedload\nusers_with_posts = User.query.options(joinedload(User.posts)).all()\n<\/code><\/pre>\n<p>This will generate a single SQL JOIN query fetching users and their posts together. You can also perform explicit joins using <code>join()<\/code>. For instance, to get all posts with their authors:<\/p>\n<pre><code>posts = db.session.query(Post).join(User).filter(User.username == 'john_doe').all()\n<\/code><\/pre>\n<p>Another powerful feature is pagination. Flask-SQLAlchemy\u2019s <code>paginate()<\/code> method makes it easy to add page numbers to your list views:<\/p>\n<pre><code>page = request.args.get('page', 1, type=int)\nposts = Post.query.paginate(page=page, per_page=5)\n<\/code><\/pre>\n<h3>Step 7: Handling Database Migrations with Flask-Migrate<\/h3>\n<p>As your application evolves, you will need to modify your models (add columns, create new tables, change relationships). Using <code>db.create_all()<\/code> repeatedly is not a good practice because it does not handle schema changes. The solution is to use Flask-Migrate, which wraps Alembic. Install it: <code>pip install flask-migrate<\/code>. Then update your <code>app.py<\/code> to integrate it:<\/p>\n<pre><code>from flask_migrate import Migrate\nmigrate = Migrate(app, db)\n<\/code><\/pre>\n<p>Now you can use the Flask CLI commands. Initialize migrations with <code>flask db init<\/code>, then after any model changes run <code>flask db migrate -m \"your message\"<\/code> to generate a migration script, and <code>flask db upgrade<\/code> to apply it. This gives you version control for your database schema.<\/p>\n<h2>Tips and Best Practices for SQLAlchemy with Flask<\/h2>\n<h3>1. Keep Sensitive Configuration in Environment Variables<\/h3>\n<p>Hardcoding database URIs, especially with credentials, is a security risk. Use environment variables or a config file that is not committed to version control. You can set the URI in <code>app.config['SQLALCHEMY_DATABASE_URI']<\/code> from <code>os.environ.get('DATABASE_URL')<\/code>. For example: <code>app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get('DATABASE_URL', 'sqlite:\/\/\/site.db')<\/code>. This way, production databases stay secure.<\/p>\n<h3>2. Prefer Eager Loading to Avoid the N+1 Problem<\/h3>\n<p>As discussed earlier, always be aware of how many SQL queries your ORM code generates. If you are going to access related objects in a loop, explicitly use <code>joinedload()<\/code> or <code>subqueryload()<\/code>. This is especially critical in API endpoints that return large collections. A common pattern: define a query wrapper function that applies these options by default for frequently used relationships.<\/p>\n<h3>3. Use Flask-Migrate from the Start<\/h3>\n<p>Even if you think your schema is stable, you will inevitably make changes. Flask-Migrate makes it painless to evolve your database without losing data. Always create an initial migration (even if empty) right after you set up your models. This ensures the migration chain is in place and you can easily rollback if needed.<\/p>\n<h3>4. Structure Your Models in Separate Files<\/h3>\n<p>For larger applications, do not keep all models in a single file. Create a <code>models<\/code> module (e.g., <code>models\/user.py<\/code>, <code>models\/post.py<\/code>) and import them into your app factory. To avoid circular imports, define your <code>db<\/code> object in a separate file (like <code>extensions.py<\/code>) and import it in both the models and the app creation.<\/p>\n<h3>5. Use Context Managers for Sessions When Not Using Flask-SQLAlchemy\u2019s Automatic Session<\/h3>\n<p>Flask-SQLAlchemy handles session lifecycle per request automatically, but if you ever need to work outside a request context (e.g., from a background job), use <code>with app.app_context():<\/code> to create a temporary context. Also, for explicit transaction control, you can use <code>db.session.begin_nested()<\/code> for savepoints.<\/p>\n<h2>FAQ \u2013 Frequently Asked Questions About SQLAlchemy and Flask<\/h2>\n<h3>Q1: How do I connect to multiple databases in a Flask app?<\/h3>\n<p>Flask-SQLAlchemy is designed for a single primary database. To use multiple databases, you need to use raw SQLAlchemy\u2019s <code>create_engine()<\/code> and <code>Session<\/code> objects alongside Flask-SQLAlchemy. Alternatively, you can create a second SQLAlchemy instance bound to a different engine and register it with the app using <code>db.init_app(app)<\/code> with a different bind configuration. However, the simplest approach for most apps is to stick with one database.<\/p>\n<h3>Q2: How do I define a many-to-many relationship?<\/h3>\n<p>You need an association table. Define it as a separate <code>db.Table<\/code> (not a model) with foreign keys to both tables. Then on each model, use <code>db.relationship()<\/code> with <code>secondary='association_table_name'<\/code>. For example, a <code>Student<\/code> and <code>Course<\/code> many-to-many: <code>student_course = db.Table('student_course', db.Column('student_id', db.Integer, db.ForeignKey('student.id')), db.Column('course_id', db.Integer, db.ForeignKey('course.id')))<\/code> and then <code>Student.courses = db.relationship('Course', secondary=student_course, backref='students')<\/code>.<\/p>\n<h3>Q3: How can I avoid circular imports when models reference each other?<\/h3>\n<p>Use <code>db.relationship()<\/code> with a string name for the target class (e.g., <code>'Post'<\/code> instead of <code>Post<\/code>) or use <code>backref<\/code>. Also, define your <code>db<\/code> object in a separate module (like <code>database.py<\/code>) and import it in models. This prevents models from importing the main app module, which often causes circular dependencies.<\/p>\n<h3>Q4: Can I use raw SQL with SQLAlchemy?<\/h3>\n<p>Yes. You can execute raw SQL queries using <code>db.session.execute(text(\"SELECT * FROM user WHERE id = :id\"), {'id': 1})<\/code>. Import <code>text<\/code> from <code>sqlalchemy<\/code>. This is useful for complex queries that are hard to express with the ORM, but note that you lose some abstraction and portability.<\/p>\n<h3>Q5: How do I handle database migrations without Flask-Migrate?<\/h3>\n<p>While Flask-Migrate is the recommended tool, you can manually write Alembic scripts, use raw SQL DDL statements, or overwrite tables by dropping and recreating them (not safe for production). Flask-Migrate simplifies the entire process and is the standard way in the Flask ecosystem.<\/p>\n<h3>Q6: What is the difference between <code>lazy=True<\/code> and <code>lazy='dynamic'<\/code>?<\/h3>\n<p><code>lazy=True<\/code> (default in older SQLAlchemy, but now often explicitly written as <code>lazy='select'<\/code>) means when you access the relationship, SQLAlchemy issues a SELECT statement to load the related objects. <code>lazy='dynamic'<\/code> returns a Query object instead of a list, allowing you to add further filters (e.g., <code>user.posts.filter(Post.title.like('%foo%')).all()<\/code>). This can be more efficient if you only need a subset of related items. However, it cannot be used with <code>joinedload<\/code>.<\/p>\n<h2>Reference Data: Common SQLAlchemy Column Types and Relationship Patterns<\/h2>\n<table border=\"1\" cellpadding=\"8\" cellspacing=\"0\" style=\"border-collapse:collapse; width:100%;\">\n<thead>\n<tr>\n<th>Column Type<\/th>\n<th>Description<\/th>\n<th>Example<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Integer<\/td>\n<td>Integer value, often used for primary keys and counts<\/td>\n<td><code>db.Integer<\/code><\/td>\n<\/tr>\n<tr>\n<td>String(size)<\/td>\n<td>Variable-length string, maximum length defined by size<\/td>\n<td><code>db.String(50)<\/code><\/td>\n<\/tr>\n<tr>\n<td>Text<\/td>\n<td>Unlimited-length text, suitable for blog posts or comments<\/td>\n<td><code>db.Text<\/code><\/td>\n<\/tr>\n<tr>\n<td>DateTime<\/td>\n<td>Python datetime object, often used for timestamps<\/td>\n<td><code>db.DateTime<\/code><\/td>\n<\/tr>\n<tr>\n<td>Boolean<\/td>\n<td>True\/False value<\/td>\n<td><code>db.Boolean<\/code><\/td>\n<\/tr>\n<tr>\n<td>Float<\/td>\n<td>Floating point number<\/td>\n<td><code>db.Float<\/code><\/td>\n<\/tr>\n<tr>\n<td>LargeBinary<\/td>\n<td>Binary data, for files up to a few MB<\/td>\n<td><code>db.LargeBinary<\/code><\/td>\n<\/tr>\n<tr>\n<td>PickleType<\/td>\n<td>Stores Python objects serialized with pickle<\/td>\n<td><code>db.PickleType<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The table above lists the most common column types you will encounter when defining models. Note that for primary keys, <code>db.Integer<\/code> with <code>primary_key=True<\/code> is standard, but you could also use <code>UUID<\/code> or <code>BigInteger<\/code> for larger datasets.<\/p>\n<table border=\"1\" cellpadding=\"8\" cellspacing=\"0\" style=\"border-collapse:collapse; width:100%; margin-top:20px;\">\n<thead>\n<tr>\n<th>Relationship Pattern<\/th>\n<th>Code Snippet (abridged)<\/th>\n<th>Use Case<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>One-to-Many<\/td>\n<td><code>Parent.children = relationship('Child', backref='parent')<\/code> + ForeignKey in Child table<\/td>\n<td>User \u2192 Posts<\/td>\n<\/tr>\n<tr>\n<td>Many-to-One<\/td>\n<td><code>Child.parent = relationship('Parent', backref='children')<\/code> (same as above from other side)<\/td>\n<td>Post \u2192 User (reverse)<\/td>\n<\/tr>\n<tr>\n<td>Many-to-Many<\/td>\n<td>Association table + <code>secondary='assoc'<\/code> on both sides<\/td>\n<td>Students \u2194 Courses<\/td>\n<\/tr>\n<tr>\n<td>One-to-One<\/td>\n<td>Add <code>uselist=False<\/code> to the relationship on the primary side<\/td>\n<td>User \u2194 Profile<\/td>\n<\/tr>\n<tr>\n<td>Self-referential<\/td>\n<td>Foreign key referencing the same table, e.g., <code>parent_id<\/code> in Employee<\/td>\n<td>Tree structures (categories)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Understanding these patterns is crucial for correctly modeling your data. The backref parameter provides automatic reverse reference, but you can also define explicit relationships on both sides for more control.<\/p>\n<h2>Conclusion<\/h2>\n<p>Integrating SQLAlchemy with Flask opens up a world of efficient, Pythonic database management. In this comprehensive guide, we covered the entire journey from initial setup and model definition to advanced querying, migrations, and best practices. You learned how to create a Flask application with Flask-SQLAlchemy, define one-to-many and many-to-many relationships, perform CRUD operations, and optimize queries with eager loading. We also discussed the critical role of Flask-Migrate for schema evolution and provided practical tips to keep your code secure and scalable.<\/p>\n<p>The real power of SQLAlchemy lies in its ability to let you think in terms of objects while still giving you the flexibility to drop down to raw SQL when needed. By following the patterns and advice in this tutorial, you will avoid common pitfalls like the N+1 problem, circular imports, and hardcoded credentials. Whether you are building a simple blog, an e-commerce platform, or a RESTful API, the combination of Flask and SQLAlchemy provides a solid, well-documented foundation that can grow with your project. Now it\u2019s time to apply what you have learned \u2013 start modeling your data, building endpoints, and iterating with confidence. Happy coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A Comprehensive Guide to Using SQLAlchemy with Flask: From Setup to Advanced Queries Introduction Flask, the lightweight and flexible Python web framework, has gained immense popularity for building web applications ranging from simple APIs to complex data-driven platforms. When it comes to handling databases in Flask, one of the most powerful and widely adopted tools &hellip; <\/p>\n","protected":false},"author":2716,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[],"tags":[],"class_list":["post-1031","post","type-post","status-publish","format-standard","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/posts\/1031","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/users\/2716"}],"replies":[{"embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/comments?post=1031"}],"version-history":[{"count":0,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/posts\/1031\/revisions"}],"wp:attachment":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/media?parent=1031"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/categories?post=1031"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/tags?post=1031"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}