> For the complete documentation index, see [llms.txt](https://openai.gitbook.io/code-cheatsheets/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://openai.gitbook.io/code-cheatsheets/all/python/flask/blueprint.md).

# Blueprint

Split up your app routes into separate files and register them at like `/api/v1`

## Creation

simplepage.py

```python
from flask import Blueprint

simple_page = Blueprint('simple_page', __name__,
                        template_folder='templates') #can leave template_folders out

@simple_page.route('/')
def index():
  return render_template("hello.html")
```

## Registering

app.py

```python
from yourapplication.simple_page import simple_page

app = Flask(__name__)
app.register_blueprint(simple_page)

app.register_blueprint(user, url_prefix='/user')
```

## Linking

url\_for('admin.index')
