Auto-Generated Authenticated Python Docs using nbdev and Heroku

Source: Deep Learning on Medium

Step 3. Upload to Heroku

For some reason, when hosting the nbdev docs on Heroku the URLs will only work when there is no host or base URL set. So, before building your docs make sure to set doc_host and doc_base to None in your app’s nbdev settings.inias follows:

doc_host = 
doc_base =

Then to build the nbdev docs run:

Then install jekyll-auth:

Now set the CLIENT_ID and CLIENT_SECRET from your Github OAuth application in Heroku. Also adding either your GITHUB_ORG_NAMEas written in your Github Organisation URL (i.e. 20treeAI in our case https://github.com/organizations/20treeAI/) or your GITHUB_TEAM_ID (to find you Team ID check the instructions at the bottom of the Jekyll-Auth Getting Started doc).

heroku config:set GITHUB_CLIENT_ID=[CLIENT_ID] GITHUB_CLIENT_SECRET=[CLIENT_SECRET] GITHUB_ORG_NAME=[ORG_NAME] # or GITHUB_TEAM_ID=[TEAM_ID]

Then install and push to Heroku using:

You should now be able to visit the website typing heroku open in the terminal.

The first time it asks you to allow the app to verify your Github organization or team.

After allowing access you should be able to see your documentation.