-1

I just used the Django tutorial to build a web site yesterday and I know very little Python as well. This might be a total Noob question, but any response is appreciated.

I’m planning to use Python + Django to build a webpage which is going to access a database at the backend. Once this is done, I want to share this website with other users in my lab. They don’t have Python or Django installed on their systems. How do I share this website with them then(intranet access)? I cannot possibly install Python + Django on all their systems. If I can’t use Python + Django, can I use some other scripting language/software to create a website with the access to the backend database being controlled by my code?

Also, I want to run some R code from this website. Does anybody have any ideas on how I can do this? I tried downloading rpy/rpy2/PypeR and since I have a 64 bit system, all these installations have failed.

Any help on this would be appreciated!

  • is it going to be intranet access? – karthikr Sep 22 '12 at 20:01
  • 7
    You never need to have Python or Django installed on a computer to *visit* a webpage built in Django, any more than you need C# installed to visit StackOverflow. – David Robinson Sep 22 '12 at 20:01
  • do you actually know python? ... start by reading some django tutorials if you do...like everything in python its really simple once you invest a little time/effort.. – Joran Beasley Sep 22 '12 at 20:05
  • It is intranet access. Also, right now, I have my website at http://127.0.0.1:8000/ . How can I make this appear in my intranet? Let's assume I have access to a sub-domain of my lab website. – user1691408 Sep 22 '12 at 20:06
  • 1
    @user1691408: It depends where your lab website is hosted. Wherever it is hosted (on a server, or a hosting service), install Python and Django there. – David Robinson Sep 22 '12 at 20:07
  • Ok, thanks - that helps. I don't know too much of web programming actually, so any help is good to have. Does anybody have any idea about how to run R code from this website? I need to use some R functions in R's quantile/loess normalization packages and the equivalent of these functions is not available in Python. – user1691408 Sep 22 '12 at 20:17
  • google and SO search are your friends... http://stackoverflow.com/questions/6688177/executing-an-r-script-from-python – Joran Beasley Sep 22 '12 at 20:28
  • Tell your friends to visit http://[your-IP-address-from-running-ipconfig]:8080 – athspk Sep 22 '12 at 21:16

1 Answers1

2

127.0.0.1 is the loopback. If you're connected to a net you must have a card with another IP. If you are on linux type ip addr or ifconfig, on Windows type ipconfig to get your IP address (mine now is 192.168.0.192). I asume here you're using the Django development server. Instead starting it with:

python manage.py runserver

try:

python manage.py runserver 0.0.0.0:8000

That 0.0.0.0 tells the server to listen all cards available in the port 8000 and serve the Django web pages. If your firewall allows access to port 8000, other users in the intranet should be able to see the Django site pointing the browser to your ip (let's say something like 192.168.0.192:8000). Of course, without installing nothing on their computers other than a browser.

As you intend to run this site in the intranet, you can simply run any program (including R) in your computer through subprocess.Popen(), but Django isn't asyncronous and the clients have to wait the program to end before see any output. I did this for a simple app that up to 5 people were using and did the trick. To run tasks asyncronously you have to use django-celery.

xbello
  • 7,223
  • 3
  • 28
  • 41