> For the complete documentation index, see [llms.txt](https://docs.tangramapps.com/en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tangramapps.com/en/app-development/core.py.md).

# core.py

{% hint style="info" %}
App module developed based on Django 3.

AppBase is the root class for the app.
{% endhint %}

### Programming

```python
from utils.appbase import AppBase
import os, sys

'''
Install the required dependency packages for the application under libs in the application folder. (install the dependency packages in the actual running environment)
Hot updates can be achieved through system upload after packaging.
'''

basedir = os.path.dirname(os.path.abspath(__file__))
libdir = os.path.join(basedir, "libs")
sys.path.insert(0, libdir)

from jira import JIRA

class Jira(AppBase):
    def __init__(self, params):
        super(Jira, self).__init__(params)
        self.__server = params.get("server")
        self.__email = params.get("email")
        self.__api_token = params.get("api_token")
        if self.__email and self.__api_token:
            self.__client = JIRA(server=self.__server, basic_auth=(self.__email, self.__api_token))
        else:
            self.__client = JIRA(server=self.__server, token_auth=self.__api_token)

    def _test(self, params):
        return self.__client.session().name

    def _get_projects(self, params):
        return list(map(lambda x: x.raw, self.__client.projects()))

    def _get_project(self, params):
        '''
        1) Params is the action parameters configured in info.json.
        2) The actual call will verify the parameter type and whether it is required.
        3) Directly input the returned results, and the AppBase class uniformly handles the return format and exceptions.
        '''
        return self.__client.project(params.get("key")).raw

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.tangramapps.com/en/app-development/core.py.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
