src/source/appinstall.rst
branchdoc-dc
changeset 50 6ed429390935
parent 36 55a05201f18c
child 51 5ebe61e3a965
equal deleted inserted replaced
49:a33f67e15345 50:6ed429390935
     1 .. _appinstall:
     1 .. _appinstall:
       
     2 
       
     3 .. _intall:
     2 
     4 
     3 Installing PyAMS application
     5 Installing PyAMS application
     4 ============================
     6 ============================
     5 
     7 
     6 **PyAMS** default installation is based on `Buildout <http://www.buildout.org>`_ utility.
     8 **PyAMS** default installation is based on `Buildout <http://www.buildout.org>`_ utility.
   184 distribution and packages versions.
   186 distribution and packages versions.
   185 
   187 
   186 
   188 
   187 **Then finalize Bootstrap initialization:**
   189 **Then finalize Bootstrap initialization:**
   188 
   190 
   189 
       
   190 .. code-block:: bash
   191 .. code-block:: bash
   191 
   192 
   192     (env) $ python3.5 bootstrap.py
   193     (env) $ python3.5 bootstrap.py
   193     (env) $ ./bin/buildout
   194     (env) $ ./bin/buildout
       
   195 
       
   196 
       
   197 .. seealso::
       
   198 
       
   199     `zc.buildout <https://pypi.python.org/pypi/zc.buildout>`_ is a powerful
       
   200     tool for creating repeatable builds of a given software configuration
       
   201     and environment.
       
   202 
   194 
   203 
   195 Environment settings
   204 Environment settings
   196 --------------------
   205 --------------------
   197 
   206 
   198 The project generated from *pyams* scaffold is based on default Pyramid's *zodb* scaffold, but it adds:
   207 The project generated from *pyams* scaffold is based on default Pyramid's *zodb* scaffold, but it adds:
   215 
   224 
   216 *development.ini* and *production.ini* files contain many commented directives related to PyAMS components. Read and
   225 *development.ini* and *production.ini* files contain many commented directives related to PyAMS components. Read and
   217 update them carefully before initializing your application database!
   226 update them carefully before initializing your application database!
   218 
   227 
   219 
   228 
       
   229 .. _zodbinit:
       
   230 
   220 Initializing the ZODB database
   231 Initializing the ZODB database
   221 =========================
   232 ==============================
   222 
   233 
   223 After, you have downloaded and installed all required packages, you have to initialize the database so that all
   234 After, you have downloaded and installed all required packages, you have to initialize the database so that all
   224 required components are available.
   235 required components are available.
   225 
   236 
   226 From a shell, just type:
   237 From a shell, just type:
   306 (1) On Debian GNU/Linux, you can choose any directory between '*~/nltk_data*' (where '~' is the homedir of user running
   317 (1) On Debian GNU/Linux, you can choose any directory between '*~/nltk_data*' (where '~' is the homedir of user running
   307 Pyramid application), '*/usr/share/nltk_data*', '*/usr/local/share/nltk_data*', '*/usr/lib/nltk_data*' and
   318 Pyramid application), '*/usr/share/nltk_data*', '*/usr/local/share/nltk_data*', '*/usr/lib/nltk_data*' and
   308 '*/usr/local/lib/nltk_data*'.
   319 '*/usr/local/lib/nltk_data*'.
   309 
   320 
   310 
   321 
   311 Starting the application
       
   312 ========================
       
   313 
       
   314 When database upgrade process has ended, you can start the web application process with the standard Pyramid's
       
   315 *pserve* command line tool:
       
   316 
       
   317 .. code-block:: bash
       
   318 
       
   319     (env) $ ./bin/pserve etc/development.ini
       
   320 
       
   321 In standard debug mode, all registered components are displayed in the console, until the final line (here using ZEO):
       
   322 
       
   323 .. code-block:: bash
       
   324 
       
   325     2018-01-14 11:37:54,339 INFO  [ZEO.ClientStorage][MainThread] [('127.0.0.1', 8100)] ClientStorage (pid=28695) created RW/normal for storage: 'pyams'
       
   326     2018-01-14 11:37:54,340 INFO  [ZEO.cache][MainThread] created temporary cache file 3
       
   327     2018-01-14 11:37:54,345 INFO  [ZODB.blob][MainThread] (28695) Blob directory `/var/local/env/pyams/var/db/blobs` is used but has no layout marker set. Selected `lawn` layout.
       
   328     2018-01-14 11:37:54,345 WARNI [ZODB.blob][MainThread] (28695) The `lawn` blob directory layout is deprecated due to scalability issues on some file systems, please consider migrating to the `bushy` layout.
       
   329     2018-01-14 11:37:54,346 DEBUG [asyncio][[('127.0.0.1', 8100)] zeo client networking thread] Using selector: EpollSelector
       
   330     2018-01-14 11:37:54,347 DEBUG [ZEO.asyncio.client][[('127.0.0.1', 8100)] zeo client networking thread] disconnected <ZEO.asyncio.client.Client object at 0x7feeb1de7390> None
       
   331     2018-01-14 11:37:54,348 DEBUG [ZEO.asyncio.client][[('127.0.0.1', 8100)] zeo client networking thread] try_connecting
       
   332     2018-01-14 11:37:54,349 INFO  [ZEO.asyncio.base][[('127.0.0.1', 8100)] zeo client networking thread] Connected Protocol(('127.0.0.1', 8100), 'pyams', False)
       
   333     2018-01-14 11:37:54,355 INFO  [ZEO.ClientStorage][[('127.0.0.1', 8100)] zeo client networking thread] [('127.0.0.1', 8100)] Connected to storage: ('localhost', 8100)
       
   334     2018-01-14 11:37:54,358 DEBUG [txn.140663320073984][MainThread] new transaction
       
   335     2018-01-14 11:37:54,360 DEBUG [txn.140663320073984][MainThread] commit
       
   336     2018-01-14 11:37:54,484 DEBUG [config][MainThread] include /home/tflorac/Dropbox/src/PyAMS/pyams_template/src/pyams_template/configure.zcml
       
   337     2018-01-14 11:37:54,485 DEBUG [config][MainThread] include /var/local/env/pycharm/lib/python3.5/site-packages/pyramid_zcml/configure.zcml
       
   338     ...
       
   339     2018-01-14 11:37:54,833 DEBUG [PyAMS (utils)][MainThread] Registering utility <class 'pyams_utils.timezone.utility.TimezoneGenerationsChecker'> named 'PyAMS timezone' providing <InterfaceClass pyams_utils.interfaces.site.ISiteGenerations>
       
   340     2018-01-14 11:37:54,834 DEBUG [PyAMS (utils)][MainThread] Registering class <class 'pyams_utils.timezone.vocabulary.TimezonesVocabulary'> as vocabulary with name "PyAMS timezones"
       
   341     2018-01-14 11:37:54,835 DEBUG [PyAMS (utils)][MainThread] Registering adapter <class 'pyams_utils.traversing.PathElementsAdapter'> for (<InterfaceClass zope.location.interfaces.IContained>,) providing <InterfaceClass pyams_utils.interfaces.traversing.IPathElements>
       
   342     2018-01-14 11:37:54,839 DEBUG [PyAMS (utils)][MainThread] Registering adapter <class 'pyams_utils.url.AbsoluteUrlTalesExtension'> for (<InterfaceClass zope.interface.Interface>, <InterfaceClass zope.interface.Interface>, <InterfaceClass zope.interface.Interface>) providing <InterfaceClass pyams_utils.interfaces.tales.ITALESExtension>
       
   343     2018-01-14 11:37:54,847 DEBUG [PyAMS (utils)][MainThread] Registering adapter <class 'pyams_utils.widget.decimal.DottedDecimalDataConverter'> for (<InterfaceClass pyams_utils.schema.IDottedDecimalField>, <InterfaceClass z3c.form.interfaces.IWidget>) providing <InterfaceClass z3c.form.interfaces.IDataConverter>
       
   344     2018-01-14 11:37:54,942 DEBUG [PyAMS (utils)][MainThread] Registering adapter <class 'pyams_utils.zmi.intids.IntIdsLengthAdapter'> for (<InterfaceClass zope.intid.interfaces.IIntIds>,) providing <InterfaceClass pyams_utils.interfaces.intids.IIndexLength>
       
   345     2018-01-14 11:37:54,943 DEBUG [PyAMS (pagelet)][MainThread] Registering pagelet view "properties.html" for <InterfaceClass zope.intid.interfaces.IIntIds> (<class 'pyams_utils.zmi.intids.IntIdsPropertiesDisplayForm'>)
       
   346     2018-01-14 11:37:54,949 DEBUG [PyAMS (pagelet)][MainThread] Registering pagelet view "properties.html" for <InterfaceClass pyams_utils.interfaces.timezone.IServerTimezone> (<class 'pyams_utils.zmi.timezone.ServerTimezonePropertiesEditForm'>)
       
   347     2018-01-14 11:37:54,980 DEBUG [PyAMS (utils)][MainThread] Registering class <class 'pyams_utils.zodb.ZEOConnectionVocabulary'> as vocabulary with name "PyAMS ZEO connections"
       
   348     2018-01-14 11:37:54,981 DEBUG [PyAMS (utils)][MainThread] Registering class <class 'pyams_utils.zodb.ZODBConnectionVocabulary'> as vocabulary with name "PyAMS ZODB connections"
       
   349     2018-01-14 11:37:55,015 DEBUG [PyAMS (pagelet)][MainThread] Registering pagelet view "add-zeo-connection.html" for <InterfaceClass zope.component.interfaces.ISite> (<class 'pyams_utils.zmi.zeo.ZEOConnectionAddForm'>)
       
   350     2018-01-14 11:37:55,016 DEBUG [PyAMS (utils)][MainThread] Registering adapter <class 'pyams_utils.zmi.zeo.ZEOConnectionNameAdapter'> for (<InterfaceClass pyams_utils.interfaces.zeo.IZEOConnection>, <InterfaceClass pyams_zmi.layer.IAdminLayer>) providing <InterfaceClass pyams_skin.interfaces.container.ITableElementName>
       
   351     2018-01-14 11:37:55,017 DEBUG [PyAMS (pagelet)][MainThread] Registering pagelet view "properties.html" for <InterfaceClass pyams_utils.interfaces.zeo.IZEOConnection> (<class 'pyams_utils.zmi.zeo.ZEOConnectionPropertiesEditForm'>)
       
   352     ...
       
   353     2018-01-14 11:41:13,214 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>
       
   354     2018-01-14 11:43:36,665 INFO  [ZEO.ClientStorage][MainThread] [('127.0.0.1', 8100)] ClientStorage (pid=29335) created RW/normal for storage: 'pyams'
       
   355     2018-01-14 11:43:36,665 INFO  [ZEO.cache][MainThread] created temporary cache file 9
       
   356     2018-01-14 11:43:36,673 DEBUG [asyncio][[('127.0.0.1', 8100)] zeo client networking thread] Using selector: EpollSelector
       
   357     2018-01-14 11:43:36,674 DEBUG [ZEO.ClientStorage.check_blob_cache][[('127.0.0.1', 8100)] zeo client check blob size thread] 140712483907328 Checking blob cache size. (target: 966367642)
       
   358     2018-01-14 11:43:36,674 DEBUG [ZEO.asyncio.client][[('127.0.0.1', 8100)] zeo client networking thread] disconnected <ZEO.asyncio.client.Client object at 0x7ffa54058860> None
       
   359     2018-01-14 11:43:36,675 DEBUG [ZEO.ClientStorage.check_blob_cache][[('127.0.0.1', 8100)] zeo client check blob size thread] 140712483907328   blob cache size: 0
       
   360     2018-01-14 11:43:36,675 DEBUG [ZEO.asyncio.client][[('127.0.0.1', 8100)] zeo client networking thread] try_connecting
       
   361     2018-01-14 11:43:36,675 DEBUG [ZEO.ClientStorage.check_blob_cache][[('127.0.0.1', 8100)] zeo client check blob size thread] 140712483907328   -->
       
   362     2018-01-14 11:43:36,677 INFO  [ZEO.asyncio.base][[('127.0.0.1', 8100)] zeo client networking thread] Connected Protocol(('127.0.0.1', 8100), 'pyams', False)
       
   363     2018-01-14 11:43:36,679 INFO  [ZEO.ClientStorage][[('127.0.0.1', 8100)] zeo client networking thread] [('127.0.0.1', 8100)] Connected to storage: ('localhost', 8100)
       
   364     2018-01-14 11:43:36,682 DEBUG [txn.140713340237568][MainThread] new transaction
       
   365     2018-01-14 11:43:36,683 DEBUG [txn.140713340237568][MainThread] commit
       
   366     2018-01-14 11:43:36,690 INFO  [PyAMS (scheduler][MainThread] Starting tasks scheduler <SchedulerProcess(SchedulerProcess-1, initial)>...
       
   367     2018-01-14 11:43:36,698 INFO  [PyAMS (scheduler][MainThread] Started tasks scheduler with PID 29361.
       
   368     2018-01-14 11:43:36,701 INFO  [apscheduler.scheduler][MainThread] Scheduler started
       
   369     2018-01-14 11:43:36,702 DEBUG [apscheduler.scheduler][APScheduler] Looking for jobs to run
       
   370     2018-01-14 11:43:36,704 DEBUG [apscheduler.scheduler][APScheduler] No jobs; waiting until a job is added
       
   371     2018-01-14 11:43:36,719 INFO  [ZEO.ClientStorage][MainThread] [('127.0.0.1', 8100)] ClientStorage (pid=29335) created RW/normal for storage: 'pyams'
       
   372     2018-01-14 11:43:36,720 INFO  [ZEO.cache][MainThread] created temporary cache file 15
       
   373     2018-01-14 11:43:36,724 DEBUG [asyncio][[('127.0.0.1', 8100)] zeo client networking thread] Using selector: EpollSelector
       
   374     2018-01-14 11:43:36,725 DEBUG [ZEO.asyncio.client][[('127.0.0.1', 8100)] zeo client networking thread] disconnected <ZEO.asyncio.client.Client object at 0x7ffa557e8b00> None
       
   375     2018-01-14 11:43:36,726 DEBUG [ZEO.asyncio.client][[('127.0.0.1', 8100)] zeo client networking thread] try_connecting
       
   376     2018-01-14 11:43:36,727 DEBUG [ZEO.ClientStorage.check_blob_cache][[('127.0.0.1', 8100)] zeo client check blob size thread] 140712483907328 Checking blob cache size. (target: 966367642)
       
   377     2018-01-14 11:43:36,728 INFO  [ZEO.asyncio.base][[('127.0.0.1', 8100)] zeo client networking thread] Connected Protocol(('127.0.0.1', 8100), 'pyams', False)
       
   378     2018-01-14 11:43:36,729 DEBUG [ZEO.ClientStorage.check_blob_cache][[('127.0.0.1', 8100)] zeo client check blob size thread] 140712483907328   blob cache size: 0
       
   379     2018-01-14 11:43:36,729 DEBUG [ZEO.ClientStorage.check_blob_cache][[('127.0.0.1', 8100)] zeo client check blob size thread] 140712483907328   -->
       
   380     2018-01-14 11:43:36,732 INFO  [ZEO.ClientStorage][[('127.0.0.1', 8100)] zeo client networking thread] [('127.0.0.1', 8100)] Connected to storage: ('localhost', 8100)
       
   381     2018-01-14 11:43:36,735 DEBUG [txn.140713340237568][MainThread] new transaction
       
   382     2018-01-14 11:43:36,736 DEBUG [txn.140713340237568][MainThread] commit
       
   383     2018-01-14 11:43:36,743 INFO  [PyAMS (media)][MainThread] Starting medias converter <MediaConversionProcess(MediaConversionProcess-2, initial)>...
       
   384     2018-01-14 11:43:36,751 INFO  [PyAMS (media)][MainThread] Started medias converter with PID 29367.
       
   385     Starting server in PID 29335.
       
   386     Serving on http://0.0.0.0:6543
       
   387 
       
   388 
       
   389 Congrats: PyAMS is running !
       
   390 
       
   391 Launch a browser and open URL http://127.0.0.1:6543/admin to get access to PyAMS management interface.
       
   392 
       
   393 .. warning::
       
   394 
       
   395     By default:
       
   396 
       
   397     - Login: admin
       
   398 
       
   399     - Password: admin
       
   400 
       
   401     **You must change it as soon as possible!**
       
   402     (see :ref:`pyams_security`)!!.
       
   403