I am developing a Django site using Windows 7 as my dev environment. I have IE6 running through XP mode. Accessing my site through localhost:8000 doesn't work in IE6 (probably since it is still running a VM). Is there a way to access my site in IE6 while it is being served through Django's test server running on Windows 7?
When running the Django runserver on one machine ,but accessing it from another (or Virtual Machine in your case), be sure to:
a) Have the django test server bind to an address that IE6 in the VM can access. To do this, run the server with:
$ python manage.py runserver 192.168.x.x:8000
b) Visit that explicit address and port in IE. For IE6, be sure to specify the 'http' protocol as IE6 doesn't like IP addresses without a protocol:
http://192.168.x.x:8000/
The reason for this is that, inside the VM, localhost or 127.0.0.1 (the defaults for runserver) refer to the virtual machine's IP address space. If using IE6 to test, you want to refer to the host OS, so use an absolute IP address that the client VM can address. There is some documentation on this from the django project, and rest assured this is a common enough need that we all do it - testing multiple variants of IE in a virtual machine seems to be a fact of life :-)
If you are still having troubles, be sure you have determined whether you're using NAT or bridged networking for your client VM as this controls the IP address, OS firewall restrictions (if any), and other avenues for communicating between a VM client and host.
your VM and the server running django are in two separate containers, and you can't access django app using localhost since Django is not installed on the VM. but what you can do is install IE tester http://www.my-debugbar.com/wiki/IETester/HomePage] in windows 7 to test all versions of IE.
Related
On our development server and test linux boxes, we have been using Google SQL with Cloud Proxy for connections. Everything is working just fine.
However, I need to setup a couple users with WAMP. (Windows 10 64bit Apache, PHP 7). I am not very familiar with WAMP. We have everything working except Cloud Proxy.
On our Linux boxes we have the socket setup in its own folder (under root) /cloudsql.
What is the equivalent location on WAMP? (We don't want to have to maintain different configuration files just for one or two WAMP boxes).
On Windows, you must use TCP sockets. The documentation can be found here:
https://cloud.google.com/sql/docs/mysql/connect-external-app#6_start_the_proxy
Specifically you must tell the proxy the instance name and the local port on which to listen for connections for that instance:
cloud_sql_proxy.exe -instances=<INSTANCE_CONNECTION_NAME>=tcp:3306
To this point, I just created and played my Django server in my localhost, like setting up a basic server Linux distro on my another device and testing etc.
However, I also heard of server applications like apache2 or nginx. The thing I wonder about is: Do I really need to use one of them in production? I want to buy (or rent?) a VPS service, then deploy (or publish?) my project on that server. The questions on my head are:
Running server with manage.py runserver 0.0.0.0:80 means it does not make my application worldwide? An server application (or whatever it is) makes it accessible outside?
Or a server application is simply needed for better performance, optimization etc. ?
Simply, why do I need to use apache2 or nginx to deploy my project?
It's a long story. In few words:
Running your project on localhost surely wont make it worldwide accessible, since at least you need a public address for your server, but not a local one.
Speaking honestly it is not a problem to run a site in pro using django built-in server. But, as you can read in docs, it is strongly NOT recommended. Why? Because it was developed specially for testing. It is written in python (slow enough for web server) and not suitable for handling multiple queries to the server and it is only a matter of time when it will crash. Of course, there are plenty of other reasons like cache and access settings, redirects and others.
I am running a django runserver from my macbook at home. Able to load the page in my mac. But when i tried copy the link and load the page on other PC the page is not loading. Why? Please help..
If both computers are in same network, you can use local IP and the port you indicated with runserver command. For instance, if the computer with django app has an IP of 192.168.1.145, you need to go to http://192.168.1.145:8000 to access your app in other computers with same network.
If it's about accessing the app from different computers with different networks. We have servers for that. If you have to need the app from your own computer, you need to get a static IP.(It's not recommended though.) Call your ISP for static IP.
I'm currently writing a webservice (with node.js) for an AngularJS frontend which is hosted with node.js
It will later be available through a proxy under domain.com/api and therefore I don't need JSONP.
For local testing purposes i have my AngularJS app running on localhost:80 and my node.js backend on localhost:3000. Naturally I'm not able to query json requests. The easies
What would be the best setup to test my homepage locally without screwing to much in my setup?
I'm currently working on windows. Linux is also an option if it is easier.
Would it be possible to write a simple proxy for express that hosts both apps in the same domain?
You can use the hosts file to set the domain.com/api to localhost. This is done in /etc/hosts in Linux, but its present somewhere in Windows too. Another thing that helps me a lot is ssh tunneling. You can, for example, tunnel remote ports (where your backend is running) to localhost with ssh -L localPort:your.server:remotePort
It's not exactly what you asked for, but the easiest might be to have the node.js app serve the AngularJS app, too. It's quite efficient, certainly efficient enough to use for development.
If it's an expressjs app, you can just add
app.use(express['static'](__dirname + "/public"));
before your other routes to have it look for static files in ./public/
If your app is served by a template or build system that you can't easily reproduce in node.js, then another option would be to run nginx, apache or haproxy on some port (80 or 5000 or ...) and have that proxy to the current backend server for the app and port 3000 (the node.js app) for the API/data requests.
You might even be able to have your server currently running on port 80 do this.
As a final idea you could also setup the node.js app to proxy to port 80 for the "app files".
Edit - I just realized that both of your apps are written in node.js. Would it be possible to set it up so you run them separately in production but together in development? Put all the real functionality in modules and then have three separate "loaders" that start the apps, one together and then a loader for each individually.
I currently have a django project that I am working on. The project is sitting on my remote webserver, and I start it by running manage.py runserver 0.0.0.0:8000. Howver, if I try to access the site via domainname.com:8000, I can't see the site.
How can I view a django project remotely like this? Do I need to do setup using apache? Punch a hole in the firewall? Is there an easy way?
This is strictly for development purposes.
You need to bind it to an IP, not 0.0.0.0.
Also, you may want to check that firewall rules are not stopping you from accessing port 8000 (I did this this morning!)
You can use ssh tunnels. It's easy to set up in Windows with Putty (look at this example for manageing postgresql) or google how to use tunnels with ssh in Linux. I think this is amazing thing, since I first time get to my databse on remote server :)