0 Followers · 332 Posts

Caché Server Pages (CSP) is both an architecture and toolset used to build an interactive web applications with the InterSystems Data Platform.

Question Yone Moreno Jiménez · Nov 10, 2025

Hello, thanks for your time reading this question.

We are receiving each day, alerts from one of our four Production nodes. It always has the same text:

[InterSystems IRIS SEVERE ERROR gchciris4.canariasalud:ENSEMBLE] [Utility.Event] [SYSTEM MONITOR] CSPGatewayLatency(127.0.0.1:443) Alert: CSPGatewayLatency = 5001.304, 5001.233, 5000.964 (Max value is 2000).

We have looked for it in the documentation here:

https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KE…

We thought it was related to the following paragraph:

5
0 46
Question Scott Roth · Oct 24, 2025

According to the Documentation  EnsLib.Workflow.TaskRequest has the following fields...

  • %Action
  • %Command
  • %FormFields
  • %FormTemplate
  • %FormValues
  • %Message
  • %Priority
  • %Subjext
  • %TaskHandler
  • %Title
  • %UserName

I want to be able to capture the Source, Session ID, and any other Identifiers outside of the Error so it will show up on the Task List.

I am struggling how to build a csp template for me to be able to capture additional fields to send to the Workflow Operation.

0
0 30
Article Kurro Lopez · Oct 23, 2025 1m read

Hi all,

This is a quick tip about how to use case insensitive URL in REST API.

If you have a class that extends from %CSP.REST and Ens.BusinessService, to create a REST API service, and you have defined your WebApplication in lowercase

XData UrlMap [ XMLNamespace = "http://www.intersystems.com/urlmap" ]
{
<Routes>
    <Route Url="/user" Method="POST" Call="User"/>
    <Route Url="/login" Method="POST" Call="Login"/>
</Routes>
}

Only accepts the url in lowercase, i.e. http://myserver/myproduction/user

If you have any uppercase character, the url doesn't work. http://MyServer/MyProduction/user

2
0 68
Question Mary George · Oct 8, 2025

Hi Team, 

Can I please check if anyone has built a simple web interface for maintaining custom SQL lookup class.   

We have a simple persistent class in HealthShare which is used for storing Pathology test codes. Test codes in this lookup class is used for message filtering and applying additional logic when processing pathology results/orders. 

We want to make this class available to external users from pathology (not the usual management portal users) to maintain so that they can add/edit/delete test codes as required. 

2
0 74
Question Ashok Kumar T · Oct 15, 2025

Hello Community,

When I compile the Sample.User class for the first time, and include an ObjectGenerator method intended to run certain logic during each compilation, it throws a <CLASS DOES NOT EXIST> error. However, recompiling the same class works as expected.

I understand this happens because the class hasn’t been fully compiled yet during the first pass. To overcome this issue, are there any specific callback methods available that can safely be used after the class is fully compiled?

2
0 46
Question Darima Budazhapova · Oct 2, 2025

Hi community,

A colleague gets ERROR #822: Access denied every time he tries to log in via Management portal. It is NOT the case of wrong credentials: I reset his password password to a temporary one so it would prompt him to create a new one upon first login. He did get the prompt, changed his password and his next attempt at logging in displayed the same error.

The audit log record displays this:
Error message: ERROR #862: User is restricted from running application /csp/sys/op, %Admin_Operate:U required -- cannot execute.
Web Application: /csp/sys/op
$I: |TCP|1972|1533396
$P: |TCP|1972|1533396

3
0 54
Question Ashok Kumar T · Sep 28, 2025

Hello Community

The InitialExpression keyword values does not to set default values for properties in classes that extend %CSP.Page, unlike in other class types such as %Persistent or %RegisteredObject, where it works as expected during object instantiation (typically via %New()).

  1. Is %CSP.Page instantiated using %New() under the hood, or does it use a different initialization mechanism?
  2. Are there specific limitations or behaviors in CSP pages that prevent InitialExpression from working as expected?

Thank you!

5
0 54
Article Patrick Dunn · Sep 15, 2020 2m read

In the WRC, we often see customers raise questions regarding a new Web Gateway setup where the Management Portal half-loads, but doesn’t show images. This article will explain why this error occurs, as well as how to fix it. This explanation is focused on the Web Gateway serving InterSystems IRIS instances, but the same explanation should apply to the CSP Gateway serving Caché instances as well.

The Problem:

You just installed the Web Gateway on a stand-alone Web Server. When you go to load the Management Portal, you find that it cannot display or load images, like so:

Why this happens:

6
0 904
Question Sébastien Demoustiez · Aug 22, 2025

Hello,

I have a main dispatcher (that extends%CSP.REST) that contains:
<Routes>
   <Map Prefix="/v([0-9]{1,2})/news"    Forward="API.Dispatch.news"/>
</Routes>

And I have the sub-dispatcher that contains:
<Routes>
   <Route Url="/:id"                        Method="GET"  Call="NewsGetItem"/>
</Routes>
If I try to access this route:
https://mydomain.com/mobile/api/v4/news/123
It doesn't work (404).

 

8
0 92
Question David Saunders · Aug 12, 2025

I am trying to use upload.csp as a template for choosing a CDV file to process. I am calling it from a zen page using this:
<button caption="Import Client Consultation Extract" 
       controlStyle="width:500px; height:100px; font-size:1.5em;"
         onclick="zenPage.importExtract();"/>

ClientMethod importExtract() [ Language = javascript ]
{
    // Open CSP popup to upload the CSV
    //alert('importExtract called.');
    zenPage.launchPopupWindow(zenLink('Upload.CSP'),'Upload Client Consultation extract',
                              'status,scrollbars,resizable,width=750,height=250');
}

8
0 95
Question David Saunders · Aug 8, 2025

I am writing a little app where I press a button on a Zen form. It calls a ZenMethod that uses zenPage.launchPopupWindow() to provide me a way to choose a file. I then click on an upload button that calls a csp cache language script file that runs on the server, that grabs the contents of the file and stuffs it into a global. I want it then close and return to the parent window to continue processing the contents of the file. I have tried placing the javascript code that closes the window and calls a function in the parent window in different places, but it is not closing the window or calling

1
0 54
Question Yone Moreno Jiménez · Aug 5, 2025

Hello, how are you?

First of all thanks for your time reading this question.

We are investigating how to validate the indexes of a global. We have read:

https://docs.intersystems.com/irisforhealth20251/csp/docbook/DocBook.UI…

And:

https://docs.intersystems.com/irisforhealth20251/csp/documatic/%25CSP.D…

We want to validate the inxedes of the global titled "Ens.Util.LogD". We have executed on the ObjectScript terminal, on the desired namespace:

2
0 69
Article Harshitha · Aug 3, 2025 2m read

Working in healthcare IT as a young developer, especially on InterSystems TrakCare, you quickly realize one thing: it’s not just about HL7 messages or backend integrations. A hugepart of making TrakCare work smoothly for hospitals comes down to how it’s configured, customized, and supported on the application side.

That’s where people like me come in—techno-functional developers who understand both the tech and how it impacts actual hospital workflows.

We’re Not Just Techies (or Functional Consultants)

Our role sits right in the middle. We're the ones:

1
2 77
Article Guillaume Rongier · Jul 31, 2025 4m read

img

This article will introduce you to the concept of virtual environments in Python, which are essential for managing dependencies and isolating project from the OS.

What is a Virtual Environment?

A virtual environment is a folder that contains :

  • A specific version of Python
  • At start an empty site-packages directory

Virtual environments will help you to isolate your project from the OS Python installation and from other projects.

How to use it?

To use virtual environments, you can follow these steps:

  1. Create a virtual environment: You can create a virtual environment using the venv module that comes with Python. Open your terminal and run:

    python -m venv .venv
    

    Replace .venv with your desired environment name.

  2. Activate the virtual environment: After creating the virtual environment, you need to activate it. The command varies depending on your operating system:

    • On Windows:
    .venv\Scripts\Activate.ps1
    

    If you encounter an error, you may need to run the following command in your terminal:

    Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force; .venv\Scripts\Activate.ps1
    
    • On macOS and Linux:
    source .venv/bin/activate
    

Once activated, your terminal prompt will change to indicate that you are now working within the virtual environment.

Example:

(.venv) user@machine:~/project$

Notice the (.venv) prefix in the terminal prompt, which indicates that the virtual environment is active.

Now then you can install packages using pip, and they will be installed in the virtual environment rather than the global Python installation.

Can I use Virtual Environments in IRIS?

Humm, good question!

The answer is simple : Yes and No.

  • No, because IRIS do not officially support virtual environments.
  • Yes, because going through all those articles, now we understand how Python works, how Iris works and what is a virtual environment, maybe we can simulate a virtual environment within IRIS by using the right configurations and setups.

How to simulate a virtual environment in IRIS?

A virtual environment is two things:

  • A specific version of Python
  • An site-packages directory

We have in IRIS what we call Flexible Python Runtime, which allows us to

  • use a specific version of Python.
  • update the sys.path to include a specific directory.

So, we can simulate a virtual environment in IRIS by using the Flexible Python Runtime and configuring the sys.path to include a specific directory and a specific version of Python. 🥳

Setup a Flexible Python Runtime in IRIS is easy, you can follow the steps in the IRIS documentation.

In a nutshell, you need to:

  1. Configure the PythonRuntimeLibrary to point to the lib python file of the specific Python version you want to use.

    Example:

    • Windows : C:\Program Files\Python311\python3.dll (Python 3.11 on Windows)
    • Linux : /usr/lib/x86_64-linux-gnu/libpython3.11.so.1.0 (Python 3.11 on Ubuntu 22.04 on the x86 architecture)
  2. Configure the PythonPath to point to the site-packages directory of the specific Python version you want to use.

    Example:

    • Use your virtual environment site-packages directory, which is usually located in the .venv/lib/python3.x/site-packages directory.

⚠️ This will setup your whole IRIS instance to use a specific version of Python and a specific site-packages directory.

🩼 Limitation :

  • You will not end up with exactly the same sys.path as a virtual environment, because IRIS will add some directories to the sys.path automatically, like <installation_directory>/lib/python an others we have seen in the module article.

🤫 If you want to make it automatic, you can use this awsome package: iris-embedded-python-wrapper

To use it, you need to:

Be in your venv environment, then install the package:

(.venv) user@machine:~/project$
pip install iris-embedded-python-wrapper

Then, simply bind this venv to IRIS with the following command:

(.venv) user@machine:~/project$
bind_iris

You will see the following message:

INFO:iris_utils._find_libpyton:Created backup at /opt/intersystems/iris/iris.cpf.0f4a1bebbcd4b436a7e2c83cfa44f515
INFO:iris_utils._find_libpyton:Created merge file at /opt/intersystems/iris/iris.cpf.python_merge
IRIS Merge of /opt/intersystems/iris/iris.cpf.python_merge into /opt/intersystems/iris/iris.cpf
INFO:iris_utils._find_libpyton:PythonRuntimeLibrary path set to /usr/local/Cellar/python@3.11/3.11.13/Frameworks/Python.framework/Versions/3.11/Python
INFO:iris_utils._find_libpyton:PythonPath set to /xxxx/.venv/lib/python3.11/site-packages
INFO:iris_utils._find_libpyton:PythonRuntimeLibraryVersion set to 3.11

To unbind the venv from IRIS, you can use the following command:

(.venv) user@machine:~/project$
unbind_iris

Conclusion

We have seen what are the benefits of using virtual environments in Python, how to create and use them, and how to simulate a virtual environment in IRIS using the Flexible Python Runtime.

3
2 133
Question André-Claude Gendron · Jul 31, 2025

Hi everyone,

I’m working with an existing InterSystems IRIS server that hosts several web applications and namespace-specific code and data. I’d like to reverse-engineer the current environment into a %Installer.Manifest file so I can store it in Git and manage its changes.

My goal is to:

  • Track the application setup and configuration in version control
  • Rebuild environments consistently (namespaces, CSP apps, security roles, etc.)
  • Possibly automate deployments later on
1
2 60
Article Guillaume Rongier · Jul 24, 2025 5m read

img

Modules what a topic! We don't have this notion in ObjectScript, but it's a fundamental concept in Python. Let's discover it together.

What is a Module?

I see modules as an intermediate layer between classes and packages. Let see it by example.

A bad example :

# MyClass.py
class MyClass:
    def my_method(self):
        print("Hello from MyClass!")

When you try to use this class in another script, you would do:

# class_usage.py
from MyClass import MyClass # weird, right?

my_instance = MyClass()
my_instance.my_method()

Why this is a bad example?

First because file names should be in snake_case according to PEP 8, so it should be my_class.py. Second, because you are importing a class from a file that has the same name as the class. This is not a good practice in Python.

I know this can be confusing, especially if you come from ObjectScript where classes are defined in files with the same name as the class.

Advanced notions

A Module is a Python File

So we just saw that modules can be a python file but without the .py extension.

But wait, does it mean that a python script is a module too? Yes, it is!

That's why you should be careful when importing a script, because it will execute the code in that script. See the Introduction to Python article for more details.

A Module is a Folder with an __init__.py File

Wow, can a folder be a module? Yes, it can!

A folder can be a module if it contains an __init__.py file. This file can be empty or contain initialization code for the module.

Let's see an example:

src/python/article/
└── my_folder_module/
    ├── __init__.py
    ├── my_sub_module.py
    └── another_sub_module.py
# my_folder_module/my_sub_module.py
class MySubModule:
    def my_method(self):
        print("Hello from MySubModule!")
# my_folder_module/another_sub_module.py
class AnotherSubModule:
    def another_method(self):
        print("Hello from AnotherSubModule!")
# my_folder_module/__init__.py
# This file can be empty or contain initialization code for the module.

In this case, my_folder_module is a module, and you can import it like this:

from my_folder_module import my_sub_module, another_sub_module

Or if you define an __init__.py file with the following content:

# my_folder_module/__init__.py
from .my_sub_module import MySubModule
from .another_sub_module import AnotherSubModule

You can import it like this:

from my_folder_module import MySubModule, AnotherSubModule

You see the subtility? You can import the classes directly from the module without specifying the sub-module, because the __init__.py file is executed when you import the module, and it can define what is available in the module's namespace.

sys.path

When you import a module, Python looks for it in the directories listed in sys.path. This is a list of strings that specifies the search path for modules.

You can view the current sys.path by running the following code:

import sys
print(sys.path)

By default, it includes the current directory and other various directories depending on your Python installation.

You can also add directories to sys.path at runtime, which is useful when you want to import modules from a specific location. For example:

import sys
sys.path.append('/path/to/your/module')
from your_module import YourClass

This is why in the previous article, we added the path to the module before importing it:

Set sys = ##class(%SYS.Python).Import("sys")
do sys.path.append("/irisdev/app/src/python/article")
set my_module = ##class(%SYS.Python).Import("my_module")

sys.path and the other directories

What are the other directories in sys.path? They are usually:

  • The directory containing the input script (or the current directory if no script is specified).
  • The standard library directories, which contain the built-in modules that come with Python.
  • site-packages directories where third-party packages are installed.

site-packages

How site-packages works? When you install a package using pip, it is installed in the site-packages directory, which is automatically included in sys.path. This allows you to import the package without having to specify its location.

🤨🔍 But how and where the site-packages directory are set and by who?

The site-packages directory is created during the installation of Python and is typically located in the lib directory of your Python installation. The exact location depends on your operating system and how Python was installed.

For example, on a typical Linux installation, the site-packages directory might be located at:

/usr/local/lib/python3.x/site-packages

On Windows, it might be located at:

C:\Python3x\Lib\site-packages

When you install a package using pip, it is installed in the site-packages directory, which is automatically included in sys.path. This allows you to import the package without having to specify its location.

import site
print(site.getsitepackages())

🤨🔍 When and where python interpreter reads the site.py file?

The site.py file (which is located in the standard library directory) is executed automatically when the Python interpreter starts. It is responsible for setting up the site-packages directory and adding it to sys.path. This file is located in the standard library directory of your Python installation.

sys.path in IRIS

In IRIS, we also have a site.py file, which is located in <installation_directory>/lib/python/iris_site.py. This file is executed when you start or import aa script/module in IRIS, and it sets up the sys.path for you.

Roughly, the iris_site.py file does the following:

Conclusion

A module can be :

  • a Python file (with or without the .py extension)
  • a folder with an __init__.py file
  • a Python script (which is also a module)
  • if you can't import a module, check if it is in the sys.path list
0
2 125
Question Ronaldo Nascimento · Jul 22, 2025

Working on wrapping an IRIS Cache ObjectScript method that runs for a few seconds. Trying to get UI updates to show BEFORE the method runs in an async/await function. But it seems to be running synchronously rather than asynchronously . So my question is does IRIS/ObjectScript CSP pages support futures with JavaScript or does it run all synchronously.

2
0 84
Question Riccardo Villa · Jul 15, 2025

Hello,

I need to expose InterSystems HealthInsight dashboards over the internet to external operators. The authentication flow is managed externally. When a user is authenticated, our system receives an HTTP request with specific headers (e.g., operator’s fiscal code and hospital identifier) that we need to extract in order to:

  • Authorize the user to access the dashboards.
  • Apply row-level security on the dashboards, filtering the data by hospital and user role.

I created a new Web Application on IRIS as shown in the screenshot:

2
0 68
Question Yone Moreno Jiménez · Jul 15, 2025

Hello InterSystems Community,

I'm working with HealthShare, and need to create a user account for our development environment with specific access requirements. This user will need only to:

    Review messaging and environments
    See production and namespaces
    NOT modify anything (read-only access)

After reviewing the documentation on user roles and rights management, I can see the default roles available in our system include:

Ensemble/Interoperability Roles:

2
0 63
Question Yone Moreno Jiménez · Feb 28, 2025

Good morning,

We need your help:

We wonder if there is a way to filter EnsLib.DICOM.Document, by using its DataSet properties on the Message Viewer.

For example, we would like to find the following DICOM.Document which DataSet.AccessionNumber is SR115985013100

By using the Message Viewer Filter we have tried the following:

FixedDataSet.AccessionNumber = SR115985013100

Because when we look fod a Body Property of the EnsLib.DICOM.Document it shows this drop down menu:

However, it replies with an error:

3
0 132
Question Ronaldo Nascimento · Jul 9, 2025

I am trying to get the value of a Submit button on a CSP object page.

<input type="Submit" value="Assign" name="action" id="action">

I tried getting it thru $GET(%Request.Data("action")), but it throws an Undefined error. Isnt $GET supposed to handle it if its undefined anyway?

How do I get the "value" of the button pushed when the form is set to POST?

5
1 78
Question Cristiano Silva · Jun 26, 2025

VSCode version:

Version: 1.101.2 (user setup)
Commit: 2901c5ac6db8a986a5666c3af51ff804d05af0d4
Date: 2025-06-24T20:27:15.391Z
Electron: 35.5.1
ElectronBuildId: 11727614
Chromium: 134.0.6998.205
Node.js: 22.15.1
V8: 13.4.114.21-electron.0
OS: Windows_NT x64 10.0.26100

-----------------------
I'm working with a CSP legacy system. 

When a csp file is newer in Caché them my local version, I try to do a compare with the server and receive the error in VSCode

2
1 81
Question Colin Brough · Jun 26, 2025

I am attempting to follow the tutorial at Publishing Web Services Using Caché | Caché Web Services QuickStart Tutorial | Caché & Ensemble 2018.1.4 – 2018.1.11 to build a toy SOAP web-service using Cache but am running into what I suspect are permissions issues, or perhaps setting up the "plumbing" to get an incoming request to call the web-service methods.

Ensemble instance running on local laptop. Only the Ensemble private web-server installed on the machine (no IIS or Apache).

0
0 45
Question Yone Moreno Jiménez · Jun 23, 2025

Hello, good morning, thank you so much for reading this question. ☺️🙂👍

We are developing a code to get information about our Production's items: services, processes and operations.

We know we can get various configurations of a given item: Category, Port, Enabled...

But we wonder how we could get the date time of the last mesage (most recent) received in an item.

To give a code snippet a small section of the code we have developed (and tested), it looks like:

2
0 81
Article Guillaume Rongier · Jul 8, 2024 6m read

Flask_logo

Description

This is a template for a Flask application that can be deployed in IRIS as an native Web Application.

Installation

  1. Clone the repository
  2. Create a virtual environment
  3. Install the requirements
  4. Run the docker-compose file
git clone
cd iris-flask-template
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
docker-compose up

Usage

The base URL is http://localhost:53795/flask/.

Endpoints

  • /iris - Returns a JSON object with the top 10 classes present in the IRISAPP namespace.
  • /interop - A ping endpoint to test the interoperability framework of IRIS.
  • /posts - A simple CRUD endpoint for a Post object.
  • /comments - A simple CRUD endpoint for a Comment object.

How to develop from this template

See WSGI introduction article: wsgi-introduction.

TL;DR : You can toggle the DEBUG flag in the Security portal to make changes to be reflected in the application as you develop.

Code presentation

app.py

This is the main file of the application. It contains the Flask application and the endpoints.

from flask import Flask, jsonify, request
from models import Comment, Post, init_db

from grongier.pex import Director

import iris

app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'iris+emb://IRISAPP'

db = init_db(app)
  • from flask import Flask, jsonify, request: Import the Flask library.
  • from models import Comment, Post, init_db: Import the models and the database initialization function.
  • from grongier.pex import Director: Import the Director class to bind the flask app to the IRIS interoperability framework.
  • import iris: Import the IRIS library.
  • app = Flask(__name__): Create a Flask application.
  • app.config['SQLALCHEMY_DATABASE_URI'] = 'iris+emb://IRISAPP': Set the database URI to the IRISAPP namespace.
    • The iris+emb URI scheme is used to connect to IRIS as an embedded connection (no need for a separate IRIS instance).
  • db = init_db(app): Initialize the database with the Flask application.

models.py

This file contains the SQLAlchemy models for the application.

from dataclasses import dataclass
from typing import List
from flask_sqlalchemy import SQLAlchemy

db = SQLAlchemy()

@dataclass
class Comment(db.Model):
    id:int = db.Column(db.Integer, primary_key=True)
    content:str = db.Column(db.Text)
    post_id:int = db.Column(db.Integer, db.ForeignKey('post.id'))

@dataclass
class Post(db.Model):
    __allow_unmapped__ = True
    id:int = db.Column(db.Integer, primary_key=True)
    title:str = db.Column(db.String(100))
    content:str = db.Column(db.Text)
    comments:List[Comment] = db.relationship('Comment', backref='post')

Not much to say here, the models are defined as dataclasses and are subclasses of the db.Model class.

The use of the __allow_unmapped__ attribute is necessary to allow the creation of the Post object without the comments attribute.

dataclasses are used to help with the serialization of the objects to JSON.

The init_db function initializes the database with the Flask application.

def init_db(app):
    db.init_app(app)

    with app.app_context():
        db.drop_all()
        db.create_all()
        # Create fake data
        post1 = Post(title='Post The First', content='Content for the first post')
        ...
        db.session.add(post1)
        ...
        db.session.commit()
    return db
  • db.init_app(app): Initialize the database with the Flask application.
  • with app.app_context(): Create a context for the application.
  • db.drop_all(): Drop all the tables in the database.
  • db.create_all(): Create all the tables in the database.
  • Create fake data for the application.
  • return the database object.

/iris endpoint

######################
# IRIS Query example #
######################

@app.route('/iris', methods=['GET'])
def iris_query():
    query = "SELECT top 10 * FROM %Dictionary.ClassDefinition"
    rs = iris.sql.exec(query)
    # Convert the result to a list of dictionaries
    result = []
    for row in rs:
        result.append(row)
    return jsonify(result)

This endpoint executes a query on the IRIS database and returns the top 10 classes present in the IRISAPP namespace.

/interop endpoint

########################
# IRIS interop example #
########################
bs = Director.create_python_business_service('BS')

@app.route('/interop', methods=['GET', 'POST', 'PUT', 'DELETE'])
def interop():
    
    rsp = bs.on_process_input(request)

    return jsonify(rsp)

This endpoint is used to test the interoperability framework of IRIS. It creates a Business Service object and binds it to the Flask application.

NB : The bs object must be outside of the scope of the request to keep it alive.

  • bs = Director.create_python_business_service('BS'): Create a Business Service object named 'BS'.
  • rsp = bs.on_process_input(request): Call the on_process_input method of the Business Service object with the request object as an argument.

/posts endpoint

############################
# CRUD operations posts    #
############################

@app.route('/posts', methods=['GET'])
def get_posts():
    posts = Post.query.all()
    return jsonify(posts)

@app.route('/posts', methods=['POST'])
def create_post():
    data = request.get_json()
    post = Post(title=data['title'], content=data['content'])
    db.session.add(post)
    db.session.commit()
    return jsonify(post)

@app.route('/posts/<int:id>', methods=['GET'])
def get_post(id):
    ...

This endpoint is used to perform CRUD operations on the Post object.

Thanks to the dataclasses module, the Post object can be easily serialized to JSON.

Here we use the sqlalchemy query method to get all the posts, and the add and commit methods to create a new post.

/comments endpoint

############################
# CRUD operations comments #
############################

@app.route('/comments', methods=['GET'])
def get_comments():
    comments = Comment.query.all()
    return jsonify(comments)

@app.route('/comments', methods=['POST'])
def create_comment():
    data = request.get_json()
    comment = Comment(content=data['content'], post_id=data['post_id'])
    db.session.add(comment)
    db.session.commit()
    return jsonify(comment)

@app.route('/comments/<int:id>', methods=['GET'])
def get_comment(id):
    ...

This endpoint is used to perform CRUD operations on the Comment object.

The Comment object is linked to the Post object by a foreign key.

Troubleshooting

How to run the Flask application in a standalone mode

You can always run a standalone Flask application with the following command:

python3 /irisdev/app/community/app.py

NB : You must be inside of the container to run this command.

docker exec -it iris-flask-template-iris-1 bash

Restart the application in IRIS

Be in DEBUG mode make multiple calls to the application, and the changes will be reflected in the application.

How to access the IRIS Management Portal

You can access the IRIS Management Portal by going to http://localhost:53795/csp/sys/UtilHome.csp.

Run this template locally

For this you need to have IRIS installed on your machine.

Next you need to create a namespace named IRISAPP.

Install the requirements.

Install IoP :

#init iop
iop --init

# load production
iop -m /irisdev/app/community/interop/settings.py

# start production
iop --start Python.Production

Configure the application in the Security portal.

4
1 491
Question Thembelani Mlalazi · May 29, 2025

I am trying to log in to the Web Gateway Management and I have missed placed the password to access the system I have tried 

changing the password under local settings in the CSP.ini  and that has managed to change the password to access the gateway but cannot log me into the management area I have followed a post here and read here and I seem not to get the answers that actual explain how I can get to the web gateway management.

3
1 123
Question Patrik Spisak · May 24, 2025

Hi,

How do I create CSP page in IIS to be loaded from the class? 

Im able to open my index.html but I have class webapp.init.cls which extends %CSP.Page which should generate html. If I write localhost/myapp/webapp.init.cls I just got an error Invalid action.

In IIS Handler Mappings I did setup for *.cls and *.csp files. 

I followed this

https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cl…

When I created index.csp my IIS just return NOT FOUND. With the old APACHE server I had no issue with all, but Im trying to migrate to IIS.

1
0 72