top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to visit the page hoisted by python-django installed On virtual box.

+2 votes
604 views

I have python-django installed on ubuntu installed on top of virtual Box. Also I have apache2 installed in the same way. When i visit the page hoisted by Apache2 from my Windows Host machine it worked.
But When i am doing the same for Django pages it's not opening up in Web browser from Host machine.
In the virtual box I am using bridged adapter and Eth0.

Please Help me to sort out this problem

posted Mar 28, 2014 by Prakash

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Django development web server normally binds to localhost (127.0.0.1) only, therefore you can only access it from the same machine (or VM). You can change this behavior by starting it using:

python manage.py runserver 0.0.0.0:8000

This way it will bind to every IP address (both 127.0.0.1 and whatever IP address you gave to your VM) so that you can access it from "outside".

Credit: http://stackoverflow.com/questions/22710387/installed-python-django-on-my-virtualbox-but-not-able-to-access-the-web-pages

answer Mar 28, 2014 by Salil Agrawal
Thanks It's working now.
Similar Questions
+2 votes

I am trying to learn Django. My initial exercise seems fine. I want to create an API with REST on Django for an interactive Python code. REST framework on Django I am understanding more or less.

I am looking for a simple example to start with. I am using Python 2.7+ on MS-Windows 7 Professional.

If any one may kindly suggest.

+4 votes

I am getting the following error -

UserProfile.picture: (fields.E210) Cannot use ImageField because Pillow is not installed.

HINT: Get Pillow at https://pypi.python.org/pypi/Pillow or run command "pip install pillow".
System check identified 1 issue (0 silenced).

This is installation Summary of pillow

PIL SETUP SUMMARY
version Pillow 2.6.1
platform linux 3.4.2 (default, Oct 8 2014, 13:08:17) [GCC 4.9.1]

--- TKINTER support available
--- JPEG support available
--- OPENJPEG (JPEG2000) support not available
--- ZLIB (PNG/ZIP) support available
--- LIBTIFF support available
--- FREETYPE2 support available
--- LITTLECMS2 support available
--- WEBP support available
--- WEBPMUX support available
+1 vote

I want to count the number of active user in website and also I have to display their IP Address by using python Django framework.

+1 vote
avinash@dell ~ $ sudo pip install django-tracking

Downloading/unpacking django-tracking
Downloading django-tracking-0.4.1.tar.gz (1.9MB): 1.9MB downloaded
Running setup.py (path:/tmp/pip_build_root/django-tracking/setup.py) egg_info for package django-tracking
Traceback (most recent call last):
File "", line 17, in
File "/tmp/pip_build_root/django-tracking/setup.py", line 6, in
import tracking
File "tracking/__init__.py", line 1, in
import listeners
File "tracking/listeners.py", line 6, in
from django.core.cache import cache
File "/usr/local/lib/python2.7/dist-packages/django/core/cache/__init__.py", line 34, in
if DEFAULT_CACHE_ALIAS not in settings.CACHES:
File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 46, in __getattr__
self._setup(name)
File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 40, in _setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting CACHES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "", line 17, in

File "/tmp/pip_build_root/django-tracking/setup.py", line 6, in

import tracking

File "tracking/__init__.py", line 1, in

import listeners

File "tracking/listeners.py", line 6, in

from django.core.cache import cache

File "/usr/local/lib/python2.7/dist-packages/django/core/cache/__init__.py", line 34, in

if DEFAULT_CACHE_ALIAS not in settings.CACHES:

File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 46, in __getattr__

self._setup(name)

File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 40, in _setup

% (desc, ENVIRONMENT_VARIABLE))

django.core.exceptions.ImproperlyConfigured: Requested setting CACHES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

–1 vote

I found a problem at this moment. I need to get full screen mode when run D.O.S. on a Windows XP Guest. I hit "Alt + Enter" and go to full screen but this screen no cover all the window. This happend on both
method conecctions, i say, over RDP or running directly from my Ubuntu Destkop Box.
This full screen looks like a 50% of the windows and centered.

Can i get a really full screen ?

...