Open shivendra2015iiit opened 2 years ago
@pplonski anything you want me to update?
@shivendra2015iiit thank you for docs!
I think the step with editing the settings.py
is not needed. There is environment variable ALLOWED_HOSTS
that can be set with the IP number.
In the linux terminal I would do:
ALLOWED_HOSTS=192.168.29.186 mercury runserver 192.168.29.186:8000 --runworker
without changing the settings.py
. Could you please check how the command with env variable set should look like on Windows?
yes @pplonski , found out in same bash shell if we set ALLOWED_HOSTS=<IP_ADDRESS>
and then host mercury, it works. I have updated the documentation.
I'm closing the issue. We will provide Mercury Cloud soon for easy deployments.
@shivendra2015iiit this guide you made is super helpful, thank you! @pplonski would it be possible to add this LAN guide to the documentation/wiki?
Also wanted to mention a few points based on my experience in implementing your guide:
set ALLOWED_HOSTS=192.168.29.186
. Instead what I did was create a .env
file and place ALLOWED_HOSTS=192.168.29.186
in it. The .env
file needs to be in the folder where you plan to run mercury from.mercury runserver 192.168.29.186:8000 --runworker
is to just run mercury run 192.168.29.186:8000
inside the folder where your notebooks are.Thank you both for all your time and effort! God bless you!
@apjanusz what do you think about it?
@pplonski @apjanusz if you have any review suggestion I can accommodate here.
Hello and hope you are all doing well. Any ideas regarding how to accomplish bullets 3 (separate git branches) and 4 (several deployments of mercury)? @pplonski
@shivendra2015iiit thanks again for this guide, it was super helpful and has been working great on LAN. By any chance do you also know how we can deploy mercury in a way where it can be accessed outside the network? My understanding is it would be similar to the LAN process but somehow we have to create a webserver with non-local IP address. I'm not very experienced in this field so I would appreciate any help. Thanks!
Prerequisite
Mercury is setup and accessible at 127.0.0.1:8000 (https://github.com/mljar/mercury#readme)
Background
Here our aim is to make mercury accessible within LAN. Currently it can only be accessed on the same computer it is hosted on at Localhost (127.0.0.1:8000). To achieve this please follow along. These steps are for windows Computer but same can be applied for other OS with some tweaks (for ubuntu we do not require firewall configuration discussed later)
Adding you IPV4 address to Allowed host
Get IPV4 address
On cmd
Firewall access
Now we have to allow firewall to accept incoming connection to mercury port (8000 by default)
Go To windows firewall settings by search. (Control Panel\System and Security\Windows Defender Firewall)
Click on Advanced settings in left tab
Click on inbound Rules
Click on add New Rule
Select Port from the menu
Input port number on which you want mercury to be hosted (Default is 8000)
Provide some name and Finish
Bind your IP with mercury instead localhost
We can not access 127.0.0.1 from other computer, we can only access it with it's ip-address once we have access to the computer port number will help us access the process we are looking for. For us port is 8000 (for process mercury)
-To start mercury on specific ip use below command which running mercury.
mercury runserver \<yourIPaddress:portNumber> --runworker
Voila you are done! now you can access it from anywhere on LAN