There are actually two ways of handling this issue. The first one is for less tech savvy users, and it goes through opening the System Preferences/ Security and finding there a button saying: Open this app anyway. Afterwards you are prompted to enter your administrator password and that is it.
The second way is over Terminal, by typing in the following command: sudo spctl --master-disable and subsequently entering your administrator password again.
One solution for mac computers would be:
1.Open your terminal
2. Type “sudo nano /etc/hosts” and hit "enter" to open the "hosts" file in another window.
3.Add the website you want blocked after the number 127.0.0.1
4.Press the Control Key + "O"
5. Type in “sudo dscacheutil -flushcache” and press "enter." ( this will reset the cache to put your changes in effect.