Skip to content

Commit fdad5a1

Browse files
committed
profiling documentation
1 parent 8a56797 commit fdad5a1

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,21 @@ This will run the asset pipeline, start the Python server, and start BrowserSync
6161

6262
To add new dependencies, add them to `requirements.in` and then run `pip-compile requirements.in` to produce a new locked `requirements.txt`. Do not edit `requirements.txt` directly as it will be overwritten by future PRs.
6363

64+
### Profiling
65+
66+
To profile routes to figure out how long it's taking and what's taking the most time, in `conditional/__init__.py` add
67+
68+
```python
69+
from werkzeug.middleware.profiler import ProfilerMiddleware
70+
71+
app.wsgi_app = ProfilerMiddleware(
72+
app.wsgi_app,
73+
restrictions=[30]
74+
)
75+
```
76+
77+
after app initialization
78+
6479
### Database Migrations
6580

6681
If the database schema is changed after initializing the database, you must migrate it to the new schema by running:

0 commit comments

Comments
 (0)