Add the script in conf.py, then put the box on any page with a raw HTML block.
conf.py
html_js_files = [("https://askthissite.com/embed.js", {"async": "async"})]
Any .rst page
.. raw:: html
<div data-everypage-site="YOUR-SITE-ID"></div>
Your site id is on your site's page after you sign up.