Check if the network is on a private VPN or not

How do make a Django app available to some users only over a private VPN while the rest of the users over public network ?

I’m assuming you’re referring to authenticated users.

After they’ve authenticated, check the REMOTE_ADDR header in request.META to see if their IP address is one of the addresses being served by the VPN.

You might want to make this test in a custom PermissionRequiredMixin type-class. (Or LoginRequiredMixin, or the corresponding decorators, depending upon how you’re currently validating authentication for the views.)

(You’ll want this test performed on every view that needs to be protected this way. You don’t want to do this test only at login, because their session would remain valid if they logged in and then disconnected from the VPN.)

I’m assuming you’re referring to authenticated users

Yes, but I’m replacing the regular login with Microsoft Azure’s Active Directory.