This document was tested on the machine where the compute nodes were originally installed.
Cd/home/github
1. Get the source code:
git clone https://github.com/openstack/horizon.git
Back up a copy
Mkdir/home/src
Pwd
/home
Cp-r/GITHUB/HORIZON/SRC
Cd/home/src/horizon
2.install The prerequisite packages :
apt-get install Nodejs
 &NBSP
3. Create a virtual Environment:
python Tools/install_ venv.py time is long.
Note, 1. Modify the tools/install_venv.py before running, in the Def create_virtualenv function, specify the version of the PIP to be installed as 1.1,
if not Run_command ([with_venv, ' Easy_install ', ' pip==1.1 ']). Strip ( ):
2. Timeout error often occurs when installing virtual environment, so you can modify the Def pip_install function in the tools/install_venv.py file, increase the default-timeout parameter, Run_ Command ([' tools/with_venv.sh ', ' pip ', '--default-timeout=1800 ', ' Install ', '--upgrade ') + list (args), redirect_output =false).
Also, try to run Python tools/install_venv.py install the virtual environment, and if it fails, the next installation will continue to install at the failure
Installation success will prompt:
Horizon Development environment Setup is complete.
To activate the virtualenv for the extent of the your current shell session
Can run:
$ source. venv/bin/activate
Official documents:
Note
If you would like to run commands without the prefix of tools/with_venv.sh, you may source your environment directly. This would remain active as long as your shell session stays open:
> Source. venv/bin/activate
For example, use:
> tools/with_venv.sh./manage.py runserver
Alternately specify the Listen IP and port:
> tools/with_venv.sh./manage.py runserver 0.0.0.0:8080
If you join
source. venv/bin/activate
You can enter the command directly.
Python manage.py runserver 0.0.0.0:8080
Note:0.0.0.0 needs to be modified to IP address
4. Unit tests:
./run_tests.sh time is long
Last hint:
Horizon Development environment Setup is complete.
To activate the virtualenv for the extent of the your current shell session
Can run:
$ source. venv/bin/activate
Running Horizon Application Tests
Nosetests--verbosity 1 Horizon--nocapture--nologcapture--exclude-dir=horizon/conf/--cover-package=horizon-- Cover-inclusive--all-modules
Creating test database for alias ' default ' ...
........................................................... S
----------------------------------------------------------------------
Ran Tests in 64.473s
OK (Skip=1)
Destroying test database for alias ' default ' ...
Running Openstack_dashboard Tests
Nosetests--verbosity 1 Openstack_dashboard--nocapture--nologcapture--cover-package=openstack_dashboard-- Cover-inclusive--all-modules
Failed to load keyring modules.
WARNING:root:No local_settings file found.
Creating test database for alias ' default ' ...
......................................................................................................................... ......................................................................................................................... ........................................................................................................ Ss.. S
----------------------------------------------------------------------
Ran 351 tests in 149.702s
OK (skip=3)
Destroying test database for alias ' default ' ...
Tests completed successfully.
5. CP openstack_dashboard/local/local_settings.py.example openstack_dashboard/local/local_settings.py
6. Running
Python manage.py runserver 192.168.240.101:8080
Enter username Admin password OpenStack hint authentication failed an error occurred authenticating. Please try again later.
After running the Runserver service, a service runs in the background of the server.
192.168.1.125:8080 can be entered locally via the browser
User name Admin
Password OpenStack Login
Browsers must use browsers that support HTML5, it is recommended to use the latest Firefox and Chrome, IE9 compatibility is not good.
Reference Documentation:
Http://docs.openstack.org/developer/nova/devref/development.environment.html
Http://docs.openstack.org/developer/horizon/quickstart.html
http://blog.163.com/ghj_114/blog/static/6823525620129261317875/
Http://docs.openstack.org/developer/nova/devref/development.environment.html
tools/with_venv.sh <your command>
Http://docs.openstack.org/developer/nova/devref/development.environment.html
) S5 ' 2 x-e# W5 x/l8 s
http://docs.openstack.org/developer/nova/devref/unit_tests.html! Y "O