Brave Creator verification for Heroku hosted Django website

By Almin Piric | Talking Code | 17 Apr 2021

This may be a very specific topic, but I thought I would share how to add Brave Rewards to your Heroku hosted Django website.  I will assume that you know about Brave Rewards and are just confused about the integration of BAT into your website.  

If you are not familiar with Brave, you can read all about it here:

Adding Brave Rewards to your site looks easy enough on the Brave Publishers website.  The directions state that all you need to do is download the "brave-rewards-verification.txt" file, place it into your ".well-known" folder, and you are ready to go.  However, I use a free Heroku account to host my website.  It does not support file hosting due to its ephemeral filesystem.  Each time the dyno is shut down or restarted, your files disappear.  This led me to assume that adding BAT to my website was more trouble than it was worth and I left it alone.  After some time, I decided to look into it one more time and I found a way to get it done.  

Step 1
Download the "brave-rewards-verification.txt" file from the Brave Creators Dashboard:

Step 2
Place the file into your Django project's templates folder

Step 3
Add the following path to your file:
path('.well-known/brave-rewards-verification.txt', TemplateView.as_view(template_name="brave-rewards-verification.txt", content_type="text/plain"),)

Step 4
Go back to your Brave Creators Dashboard and click on "Verify"
The page should reload with a green alert confirming your site's verification.

Now you will have the option to allow Brave to serve ads on your website.  I believe that this feature is still in beta and I do not have any input on it yet. 

How do you rate this article?



Almin Piric
Almin Piric

I am a freelance Python and Java developer, founder of TMD Studios, hobbyist game developer, and Bitcoin enthusiast. My work can be seen here:

Talking Code
Talking Code

A blog that focuses on open source projects with a touch of crypto and game-dev talk

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.