4 ================ |
4 ================ |
5 |
5 |
6 PyAMS default installation is based on `Buildout <http://www.buildout.org>`_ utility. It's not mandatory to use a |
6 PyAMS default installation is based on `Buildout <http://www.buildout.org>`_ utility. It's not mandatory to use a |
7 virtual environment, but it allows you to have a better control over your Python resources. |
7 virtual environment, but it allows you to have a better control over your Python resources. |
8 |
8 |
9 Current PyAMS version is based and validated for Python 3.4; your Python environment must also include a C |
9 Current PyAMS version is based and validated for Python 3.5; your Python environment must also include a C |
10 compiler as well as development headers for Python, *libjpeg*, *libpng*, *libfreetype*, *libxml2*, *libxslt* and |
10 compiler as well as development headers for Python, *libjpeg*, *libpng*, *libfreetype*, *libxml2*, *libxslt* and |
11 eventually *libldap* or *libzmq*. |
11 eventually *libldap* or *libzmq*. |
12 |
12 |
13 PyAMS default components configuration also pre-suppose that the following external tools are available: |
13 PyAMS default components configuration also pre-suppose that the following external tools are available: |
14 |
14 |
15 - a *memcached* server, to store sessions and cache (can be changed through Beaker configuration) |
15 - a *Memcached* or *Redis* server, to store sessions and cache (can be changed through Beaker configuration) |
16 |
16 |
17 Optional tools also include: |
17 Optional tools also include: |
18 |
18 |
19 - an *ElasticSearch* server for full text indexing (see *PyAMS_content_es* package) |
19 - an *ElasticSearch* server for full text indexing (see *PyAMS_content_es* package) |
20 |
20 |
21 - a *WebSockets* server using async IO. This is used to manage notifications (see *PyAMS_notify* and *PyAMS_notify_ws* |
21 - a *WebSockets* server using AsyncIO. This is used to manage notifications (see *PyAMS_notify* and *PyAMS_notify_ws* |
22 packages). An *out of the box* environment can be built using *pyams_asyncio* scaffold provided by *pyams_base* |
22 packages). An *out of the box* environment can be built using *pyams_asyncio* scaffold provided by *pyams_base* |
23 package. |
23 package. |
24 |
24 |
25 |
25 |
26 You can also choose to use a local ZODB instance, or a ZEO server (which can be local or remote, but is required if |
26 You can also choose to use a local ZODB instance, or a ZEO server (which can be local or remote, but is required if |
76 .. code-block:: bash |
76 .. code-block:: bash |
77 |
77 |
78 (pyams) # ./bin/buildout |
78 (pyams) # ./bin/buildout |
79 (pyams) # ./bin/pcreate -l |
79 (pyams) # ./bin/pcreate -l |
80 Available scaffolds: |
80 Available scaffolds: |
81 alchemy: Pyramid project using SQLAlchemy, SQLite, URL dispatch, and |
81 alchemy: Pyramid project using SQLAlchemy, SQLite, URL dispatch, and |
82 pyams: Pyramid project using all PyAMS packages |
82 pyams: Pyramid project using all PyAMS packages |
83 starter: Pyramid starter project using URL dispatch and Chameleon |
83 pyams_asyncio: Pyramid AsyncIO project using websockets for PyAMS notifications |
84 zodb: Pyramid project using ZODB, traversal, and Chameleon |
84 starter: Pyramid starter project using URL dispatch and Chameleon |
|
85 zodb: Pyramid project using ZODB, traversal, and Chameleon |
85 (pyams) # ./bin/pcreate -t pyams myapp |
86 (pyams) # ./bin/pcreate -t pyams myapp |
86 (pyams) # cd myapp |
87 (pyams) # cd myapp |
87 |
88 |
88 You can then check, and eventually update, the proposed Buildout configuration file *buildout.cfg*, to add or remove |
89 You can then check, and eventually update, the proposed Buildout configuration file *buildout.cfg*, to add or remove |
89 packages or update settings to your needs. Then finalize Bootstrap initialization: |
90 packages or update settings to your needs. Then finalize Bootstrap initialization: |
135 |
136 |
136 (pyams) # ./bin/pyams_upgrade etc/development.ini |
137 (pyams) # ./bin/pyams_upgrade etc/development.ini |
137 |
138 |
138 This process requires that every package is correctly included into *pyramid.includes* directive from selected |
139 This process requires that every package is correctly included into *pyramid.includes* directive from selected |
139 configuration file. |
140 configuration file. |
|
141 |
|
142 |
|
143 Starting the application |
|
144 ------------------------ |
|
145 |
|
146 When database upgrade process has ended, you can start the web application process with the standard Pyramid's |
|
147 *pserve* command line tool: |
|
148 |
|
149 .. code-block:: bash |
|
150 |
|
151 (pyams) # ./bin/pserve etc/development.ini |
|
152 |
|
153 In standard debug mode, all registered components are displayed in the console, until the final line (here using ZEO): |
|
154 |
|
155 .. code-block:: bash |
|
156 |
|
157 2016-12-28 10:58:46,347 INFO [ZEO.ClientStorage][MainThread] [('localhost', 8100)] ClientStorage (pid=30133) created RW/normal for storage: 'pyams' |
|
158 2016-12-28 10:58:46,349 DEBUG [ZODB.blob][MainThread] (30133) Blob directory `/var/local/env/pyams/db/blobs` has layout marker set. Selected `bushy` layout. |
|
159 2016-12-28 10:58:46,349 WARNI [ZODB.blob][MainThread] (30133) Blob dir /var/local/env/pyams/db/blobs/ has insecure mode setting |
|
160 2016-12-28 10:58:46,349 INFO [ZEO.cache][MainThread] created temporary cache file 5 |
|
161 2016-12-28 10:58:46,373 BLATH [ZEO.zrpc][MainThread] (30133) CM.connect(): starting ConnectThread |
|
162 2016-12-28 10:58:46,374 BLATH [ZEO.zrpc][Connect([(<AddressFamily.AF_INET: 2>, ('localhost', 8100))])] (30133) CT: attempting to connect on 1 sockets |
|
163 2016-12-28 10:58:46,380 BLATH [ZEO.zrpc][Connect([(<AddressFamily.AF_INET: 2>, ('localhost', 8100))])] (30133) CW: attempt to connect to ('127.0.0.1', 8100) |
|
164 2016-12-28 10:58:46,380 BLATH [ZEO.zrpc][Connect([(<AddressFamily.AF_INET: 2>, ('localhost', 8100))])] (30133) CW: connect_ex(('127.0.0.1', 8100)) returned EINPROGRESS |
|
165 2016-12-28 10:58:46,381 BLATH [ZEO.zrpc][Connect([(<AddressFamily.AF_INET: 2>, ('localhost', 8100))])] (30133) CT: select() 0, 1, 0 |
|
166 2016-12-28 10:58:46,381 BLATH [ZEO.zrpc][Connect([(<AddressFamily.AF_INET: 2>, ('localhost', 8100))])] (30133) CW: connect_ex(('127.0.0.1', 8100)) returned 0 |
|
167 2016-12-28 10:58:46,382 INFO [ZEO.ClientStorage][Connect([(<AddressFamily.AF_INET: 2>, ('localhost', 8100))])] [('localhost', 8100)] Testing connection <ManagedClientConnection ('127.0.0.1', 8100)> |
|
168 2016-12-28 10:58:46,383 INFO [ZEO.zrpc.Connection(b'C')][[('localhost', 8100)] zeo client networking thread] (127.0.0.1:8100) received handshake b'Z3101' |
|
169 2016-12-28 10:58:46,483 INFO [ZEO.ClientStorage][Connect([(<AddressFamily.AF_INET: 2>, ('localhost', 8100))])] [('localhost', 8100)] Server authentication protocol None |
|
170 2016-12-28 10:58:46,484 INFO [ZEO.ClientStorage][Connect([(<AddressFamily.AF_INET: 2>, ('localhost', 8100))])] [('localhost', 8100)] Connected to storage: ('localhost', 8100) |
|
171 2016-12-28 10:58:46,485 INFO [ZEO.ClientStorage][Connect([(<AddressFamily.AF_INET: 2>, ('localhost', 8100))])] [('localhost', 8100)] No verification necessary -- empty cache |
|
172 2016-12-28 10:58:46,486 DEBUG [ZEO.ClientStorage][Connect([(<AddressFamily.AF_INET: 2>, ('localhost', 8100))])] pickled inval None b'\x03\xbc>\x1a\x166f"' |
|
173 2016-12-28 10:58:46,488 BLATH [ZEO.zrpc][Connect([(<AddressFamily.AF_INET: 2>, ('localhost', 8100))])] (30133) CM.connect_done(preferred=1) |
|
174 2016-12-28 10:58:46,489 BLATH [ZEO.zrpc][Connect([(<AddressFamily.AF_INET: 2>, ('localhost', 8100))])] (30133) CT: exiting thread: Connect([(<AddressFamily.AF_INET: 2>, ('localhost', 8100))]) |
|
175 2016-12-28 10:58:46,676 DEBUG [config][MainThread] include /var/local/env/pyams/eggs/pyams_template-0.1.0-py3.4.egg/pyams_template/configure.zcml |
|
176 2016-12-28 10:58:46,677 DEBUG [config][MainThread] include /var/local/env/pyams/eggs/pyramid_zcml-1.0.0-py3.4.egg/pyramid_zcml/configure.zcml |
|
177 2016-12-28 10:58:46,678 DEBUG [config][MainThread] include /var/local/env/pyams/eggs/pyramid_zcml-1.0.0-py3.4.egg/pyramid_zcml/meta.zcml |
|
178 2016-12-28 10:58:46,684 DEBUG [config][MainThread] include /var/local/env/pyams/eggs/pyams_template-0.1.0-py3.4.egg/pyams_template/meta.zcml |
|
179 2016-12-28 10:58:46,710 DEBUG [config][MainThread] include /var/local/env/pyams/eggs/pyams_viewlet-0.1.0-py3.4.egg/pyams_viewlet/configure.zcml |
|
180 2016-12-28 10:58:46,711 DEBUG [config][MainThread] include /var/local/env/pyams/eggs/pyramid_zcml-1.0.0-py3.4.egg/pyramid_zcml/configure.zcml |
|
181 2016-12-28 10:58:46,711 DEBUG [config][MainThread] include /var/local/env/pyams/eggs/pyramid_zcml-1.0.0-py3.4.egg/pyramid_zcml/meta.zcml |
|
182 2016-12-28 10:58:46,746 DEBUG [config][MainThread] include /var/local/env/pyams/eggs/zope.browserpage-4.1.0-py3.4.egg/zope/browserpage/meta.zcml |
|
183 2016-12-28 10:58:46,825 DEBUG [config][MainThread] include /var/local/env/pyams/eggs/pyams_template-0.1.0-py3.4.egg/pyams_template/meta.zcml |
|
184 ... |
|
185 2016-12-28 11:02:01,354 DEBUG [PyAMS (utils)][MainThread] Registering adapter <function WfSharedContentIndexInfo at 0x7f506aa9a0d0> for (<InterfaceClass pyams_content.shared.common.interfaces.IWfSharedContent>,) providing <InterfaceClass pyams_content_es.interfaces.IDocumentIndexInfo> |
|
186 2016-12-28 11:02:01,370 DEBUG [PyAMS (utils)][MainThread] Registering utility <class 'pyams_content_es.site.ContentIndexerGenerationsChecker'> named 'PyAMS content indexer' providing <InterfaceClass pyams_utils.interfaces.site.ISiteGenerations> |
|
187 2016-12-28 11:02:01,383 DEBUG [PyAMS (pagelet)][MainThread] Registering pagelet view "test-indexer-process.html" for <InterfaceClass pyams_content_es.interfaces.IContentIndexerUtility> (<class 'pyams_content_es.zmi.ContentIndexerProcessTestForm'>) |
|
188 2016-12-28 11:02:01,387 DEBUG [PyAMS (pagelet)][MainThread] Registering pagelet view "properties.html" for <InterfaceClass pyams_content_es.interfaces.IContentIndexerUtility> (<class 'pyams_content_es.zmi.ContentIndexerUtilityPropertiesEditForm'>) |
|
189 2016-12-28 11:02:01,400 DEBUG [PyAMS (utils)][MainThread] Registering adapter <class 'pyams_default_theme.configuration.StaticConfiguration'> for (<InterfaceClass pyams_utils.interfaces.site.IStaticConfigurationManager>, <InterfaceClass pyams_default_theme.layer.IPyAMSDefaultLayer>, <InterfaceClass zope.interface.Interface>) providing <InterfaceClass pyams_skin.interfaces.configuration.IStaticConfiguration> |
|
190 2016-12-28 11:02:01,403 DEBUG [PyAMS (pagelet)][MainThread] Registering pagelet view "" for <InterfaceClass zope.interface.Interface> (<class 'pyams_default_theme.page.BaseIndexPage'>) |
|
191 2016-12-28 11:02:01,410 DEBUG [PyAMS (utils)][MainThread] Registering utility <class 'pyams_default_theme.skin.PyAMSDefaultSkin'> named 'PyAMS default skin' providing <InterfaceClass pyams_skin.interfaces.ISkin> |
|
192 2016-12-28 11:02:01,411 DEBUG [PyAMS (utils)][MainThread] Registering adapter <class 'pyams_default_theme.skin.ResourcesAdapter'> for (<InterfaceClass zope.interface.Interface>, <InterfaceClass pyams_default_theme.layer.IPyAMSDefaultLayer>, <InterfaceClass zope.interface.Interface>) providing <InterfaceClass pyams_skin.interfaces.resources.IResources> |
|
193 Starting server in PID 30235. |
|
194 serving on http://0.0.0.0:6543 |
|
195 |
|
196 From this point, you can launch a browser and open URL *http://127.0.0.1:6543/admin* to get access to PyAMS |
|
197 management interface; default login is "admin/admin", that you may change as soon as possible... |