~ubuntu-branches/ubuntu/utopic/horizon/utopic-updates

« back to all changes in this revision

Viewing changes to doc/source/quickstart.rst

  • Committer: Package Import Robot
  • Author(s): James Page, Chris Johnston, James Page
  • Date: 2014-10-03 17:54:18 UTC
  • mfrom: (0.4.1) (1.1.44) (70.1.2 utopic)
  • Revision ID: package-import@ubuntu.com-20141003175418-1jomx0azdvnl5fxz
Tags: 1:2014.2~rc1-0ubuntu1
[ Chris Johnston ]
* d/theme/css/ubuntu.css: Fix Ubuntu theme for Instances "more" dropdown
  (LP: #1308651).

[ James Page ]
* New upstream release candidate:
  - d/p/*: Refresh.
* d/watch: Use tarballs.openstack.org for upstream releases. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    > cd horizon
31
31
    > ./run_tests.sh
32
32
 
 
33
.. note::
 
34
 
 
35
    Running ``run_tests.sh`` will build a virtualenv, ``.venv``, where all the
 
36
    python dependencies for Horizon are installed and referenced. After the
 
37
    dependencies are installed, the unit test suites in the Horizon repo will be
 
38
    executed.  There should be no errors from the tests.
 
39
 
33
40
Next you will need to setup your Django application config by copying ``openstack_dashboard/local/local_settings.py.example`` to ``openstack_dashboard/local/local_settings.py``. To do this quickly you can use the following command::
34
41
 
35
42
    > cp openstack_dashboard/local/local_settings.py.example openstack_dashboard/local/local_settings.py
39
46
    To add new settings or customize existing settings, modify the ``local_settings.py`` file.
40
47
 
41
48
Horizon assumes a single end-point for OpenStack services which defaults to
42
 
the local host (127.0.0.1). If this is not the case change the
43
 
``OPENSTACK_HOST`` setting in the ``openstack_dashboard/local/local_settings.py`` file, to the actual IP address of the OpenStack end-point Horizon should use.
44
 
 
45
 
To start the Horizon development server use the Django ``manage.py`` utility
46
 
with the context of the virtual environment::
47
 
 
48
 
    > tools/with_venv.sh ./manage.py runserver
49
 
 
50
 
Alternately specify the listen IP and port::
51
 
 
52
 
    > tools/with_venv.sh ./manage.py runserver 0.0.0.0:8080
53
 
 
54
 
.. note::
55
 
 
56
 
    If you would like to run commands without the prefix of ``tools/with_venv.sh`` you may source your environment directly. This will remain active as long as your shell session stays open::
57
 
 
58
 
    > source .venv/bin/activate
59
 
 
60
 
 
61
 
Once the Horizon server is running point a web browser to http://localhost:8000
 
49
the local host (127.0.0.1), as is the default in DevStack. If this is not the
 
50
case change the ``OPENSTACK_HOST`` setting in the
 
51
``openstack_dashboard/local/local_settings.py`` file, to the actual IP address
 
52
of the OpenStack end-point Horizon should use.
 
53
 
 
54
To start the Horizon development server use ``run_tests.sh``::
 
55
 
 
56
    > ./run_tests.sh --runserver localhost:9000
 
57
 
 
58
.. note::
 
59
 
 
60
    The default port for runserver is 8000 which is already consumed by
 
61
    heat-api-cfn in DevStack. If not running in DevStack
 
62
    `./run_tests.sh --runserver` will start the test server at
 
63
    `http://localhost:8000`.
 
64
 
 
65
 
 
66
.. note::
 
67
 
 
68
    The ``run_tests.sh`` script provides wrappers around ``manage.py``.
 
69
    For more information on manage.py which is a django, see
 
70
    `https://docs.djangoproject.com/en/dev/ref/django-admin/`
 
71
 
 
72
 
 
73
Once the Horizon server is running, point a web browser to http://localhost:9000
62
74
or to the IP and port the server is listening for.
63
75
 
64
76
.. note::
65
77
 
66
78
    The ``DevStack`` project (http://devstack.org/) can be used to install
67
 
    an OpenStack development environment from scratch.
 
79
    an OpenStack development environment from scratch. For a local.conf that
 
80
    enables most services that Horizon supports managing see
 
81
    :doc:`local.conf <ref/local_conf>`
68
82
 
69
83
.. note::
70
84
 
77
91
 
78
92
    Optional support is provided for Swift.
79
93
 
 
94
 
 
95
Editing Horizon's Source
 
96
========================
 
97
 
 
98
Although DevStack installs and configures an instance of Horizon when running
 
99
stack.sh, the preferred development setup follows the instructions above on the
 
100
server/VM running DevStack. The are several advantages to maintaining a
 
101
separate copy of the Horizon repo, rather than editing the devstack installed
 
102
copy.
 
103
 
 
104
    * Source code changes aren't as easily lost when running unstack.sh/stack.sh
 
105
    * The development server picks up source code changes (other than JavaScript
 
106
      and CSS due to compression and compilation) while still running.
 
107
    * Log messages and print statements go directly to the console.
 
108
    * Debugging with pdb becomes much simpler to interact with.
 
109
 
 
110
.. Note::
 
111
    JavaScript and CSS changes require a development server restart. Also,
 
112
    forcing a refresh of the page (e.g. using Shift-F5) in the browser is
 
113
    required to pull down non-cached versions of the CSS and JavaScript. The
 
114
    default setting in Horizon is to do compilation and compression of these
 
115
    files at server startup. If you have configured your local copy to do
 
116
    offline compression, more steps are required.
 
117
 
 
118
 
80
119
Horizon's Structure
81
120
===================
82
121