Brave Creator verification for Heroku hosted Django website

Do repost and rate:

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: https://brave.com/

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: https://publishers.basicattentiontoken.org/

Step 2

Place the file into your Django project's templates folder

Step 3

Add the following path to your urls.py 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. 

Regulation and Society adoption

Ждем новостей

Нет новых страниц

Следующая новость