Skip to content

Commit

Permalink
Merge pull request #343 from raj454raj/master
Browse files Browse the repository at this point in the history
Fix issue #342 + minor typo
  • Loading branch information
mdipierro committed Mar 27, 2017
2 parents 58dcf02 + d43ef81 commit 406deda
Show file tree
Hide file tree
Showing 14 changed files with 204 additions and 206 deletions.
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,5 @@ git-credential*
.gitignore
.pydevproject
.idea




/errors/*
/static_chaps/*
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ License: [Creative Commons BY-NC-ND](http://creativecommons.org/licenses/by-nc-

[Read the book online](http://web2py.com/books)

The gitbub repo includes code and sources. The book sources are in the sources folder. You can contribute to the book by submitting patches.
The github repo includes code and sources. The book sources are in the sources folder. You can contribute to the book by submitting patches.

## Notes to translators

Expand Down Expand Up @@ -39,4 +39,4 @@ Once done submit patch as a pull request on github or email the author.

### Translator agreement

If you plan to help with the book translation please contact me we can reach an agreement about copyright and distribution.
If you plan to help with the book translation please contact me we can reach an agreement about copyright and distribution.
4 changes: 2 additions & 2 deletions sources/29-web2py-english/13.markmin
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ Here are some steps to install apache+python+mod_wsgi+web2py+postgresql from scr

On Ubuntu:
``
wget http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh
wget https://raw.githubusercontent.com/web2py/web2py/master/scripts/setup-web2py-ubuntu.sh
chmod +x setup-web2py-ubuntu.sh
sudo ./setup-web2py-ubuntu.sh
``
On Fedora:
``
wget http://web2py.googlecode.com/hg/scripts/setup-web2py-fedora.sh
wget https://raw.githubusercontent.com/web2py/web2py/master/scripts/setup-web2py-fedora.sh
chmod +x setup-web2py-fedora.sh
sudo ./setup-web2py-fedora.sh
``
Expand Down
4 changes: 2 additions & 2 deletions sources/32-web2py-german/13.markmin
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ Here are some steps to install apache+python+mod_wsgi+web2py+postgresql from scr

On Ubuntu:
``
wget http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh
wget https://raw.githubusercontent.com/web2py/web2py/master/scripts/setup-web2py-ubuntu.sh
chmod +x setup-web2py-ubuntu.sh
sudo ./setup-web2py-ubuntu.sh
``
On Fedora:
``
wget http://web2py.googlecode.com/hg/scripts/setup-web2py-fedora.sh
wget https://raw.githubusercontent.com/web2py/web2py/master/scripts/setup-web2py-fedora.sh
chmod +x setup-web2py-fedora.sh
sudo ./setup-web2py-fedora.sh
``
Expand Down
24 changes: 12 additions & 12 deletions sources/33-web2py-japanese/13.markmin
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ python anyserver.py -h

Ubuntuでは:
``
wget http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh
wget https://raw.githubusercontent.com/web2py/web2py/master/scripts/setup-web2py-ubuntu.sh
chmod +x setup-web2py-ubuntu.sh
sudo ./setup-web2py-ubuntu.sh
``
Fedoraでは:
``
wget http://web2py.googlecode.com/hg/scripts/setup-web2py-fedora.sh
wget https://raw.githubusercontent.com/web2py/web2py/master/scripts/setup-web2py-fedora.sh
chmod +x setup-web2py-fedora.sh
sudo ./setup-web2py-fedora.sh
``
Expand Down Expand Up @@ -516,9 +516,9 @@ server {
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWARE nginx/$nginx_version;
}

}
``:code
``:code

ファイルのシンボリックリンクとデフォルトの削除が必要です。

Expand All @@ -533,16 +533,16 @@ mkdir /etc/nginx/ssl
cp web2py.key /etc/nginx/ssl
cp web2py.crt /etc/nginx/ssl
``:code

その後、uWSGIをインストールしセットアップを行う必要があります。

``
sudo mkdir /etc/uwsgi
sudo mkdir /var/log/uwsgi
``:code

さらに、"/etc/uwsgi/web2py.xml" 設定ファイルを作成します:

``
<uwsgi>
<socket>/tmp/web2py.socket</socket>
Expand All @@ -569,7 +569,7 @@ sudo mkdir /var/log/uwsgi
また二番目の設定ファイル "/etc/init/uwsgi-emperor.conf" の編集も必要です:

``
# Emperor uWSGI script
# Emperor uWSGI script
description "uWSGI Emperor"
start on runlevel [2345]
stop on runlevel [06]
Expand All @@ -581,7 +581,7 @@ exec uwsgi --master --die-on-term --emperor /etc/uwsgi --logto /var/log/uwsgi/uw

``
start uwsgi-emperor
/etc/init.d/nginx restart
/etc/init.d/nginx restart
``:code

次のコマンドで、uwsgiをリロードできます。
Expand Down Expand Up @@ -799,7 +799,7 @@ sudo nano /etc/postgresql/9.1/main/postgresql.conf
そして、次の二行を記述します。
``
...
listen_addresses = 'localhost'
listen_addresses = 'localhost'
...
track_counts = on
...
Expand Down Expand Up @@ -1330,7 +1330,7 @@ cache.memcache = MemcacheClient(request, memcache_servers)
cache.ram = cache.disk = cache.memcache
``:code

最初の行はmemcacheをインポートします。2行目はmemcache socket(サーバー:ポート)のリストです。3行目はcache.memcacheを定義します。4行目は ``cache.ram`` と
最初の行はmemcacheをインポートします。2行目はmemcache socket(サーバー:ポート)のリストです。3行目はcache.memcacheを定義します。4行目は ``cache.ram`` と

Memcacheオブジェクトを指している全く新しいキャッシュオブジェクトを定義するために、それらの一つだけを再定義するために選択することができます。

Expand Down Expand Up @@ -1799,7 +1799,7 @@ id = db.table.insert(field1=value1, field2=value2)

下記のような効果があります:
- 新規行が、``db.table`` に挿入されます。行はweb2pyによって値が割り当てられる、``id`` を持ちます。行はDetastore主キーを持ちますが、しかしこの主キーは、``id`` では ''なく''、そして公開もされません。
- ``db.table`` のインデックスは更新されます。特に、``id`` のインデックスが更新され、新規行は ''最終的に'' ``db.table.id`` でクエリすることが可能になります。
- ``db.table`` のインデックスは更新されます。特に、``id`` のインデックスが更新され、新規行は ''最終的に'' ``db.table.id`` でクエリすることが可能になります。
この2つのステップが完了した後のみ、新規データの ``id`` によるクエリが可能になります。
とりわけ、下のようなweb2pyで通常使われる模範例は ''フェイル'' します:

Expand Down
4 changes: 2 additions & 2 deletions sources/34-web2py-italian-translation-in-progress/13.markmin
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ Here are some steps to install apache+python+mod_wsgi+web2py+postgresql from scr

On Ubuntu:
``
wget http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh
wget https://raw.githubusercontent.com/web2py/web2py/master/scripts/setup-web2py-ubuntu.sh
chmod +x setup-web2py-ubuntu.sh
sudo ./setup-web2py-ubuntu.sh
``
On Fedora:
``
wget http://web2py.googlecode.com/hg/scripts/setup-web2py-fedora.sh
wget https://raw.githubusercontent.com/web2py/web2py/master/scripts/setup-web2py-fedora.sh
chmod +x setup-web2py-fedora.sh
sudo ./setup-web2py-fedora.sh
``
Expand Down
4 changes: 2 additions & 2 deletions sources/35-web2py-chinese-work-in-progress/13.markmin
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ Here are some steps to install apache+python+mod_wsgi+web2py+postgresql from scr

On Ubuntu:
``
wget http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh
wget https://raw.githubusercontent.com/web2py/web2py/master/scripts/setup-web2py-ubuntu.sh
chmod +x setup-web2py-ubuntu.sh
sudo ./setup-web2py-ubuntu.sh
``
On Fedora:
``
wget http://web2py.googlecode.com/hg/scripts/setup-web2py-fedora.sh
wget https://raw.githubusercontent.com/web2py/web2py/master/scripts/setup-web2py-fedora.sh
chmod +x setup-web2py-fedora.sh
sudo ./setup-web2py-fedora.sh
``
Expand Down
28 changes: 14 additions & 14 deletions sources/36-web2py-spanish-translation-in-progress/13.markmin
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ Aquí presentamos instrucciones para instalar apache+python+mod_wsgi+web2py+post

En Ubuntu:
``
wget http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh
wget https://raw.githubusercontent.com/web2py/web2py/master/scripts/setup-web2py-ubuntu.sh
chmod +x setup-web2py-ubuntu.sh
sudo ./setup-web2py-ubuntu.sh
``

En Fedora:
``
wget http://web2py.googlecode.com/hg/scripts/setup-web2py-fedora.sh
wget https://raw.githubusercontent.com/web2py/web2py/master/scripts/setup-web2py-fedora.sh
chmod +x setup-web2py-fedora.sh
sudo ./setup-web2py-fedora.sh
``
Expand Down Expand Up @@ -545,9 +545,9 @@ server {
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWARE nginx/$nginx_version;
}

}
``:code
``:code

Necesitarás crear un symlink del archivo y eliminar default

Expand All @@ -564,15 +564,15 @@ cp web2py.key /etc/nginx/ssl
cp web2py.crt /etc/nginx/ssl
``:code

Luego debes instalar y configurar uWSGI
Luego debes instalar y configurar uWSGI

``
sudo mkdir /etc/uwsgi
sudo mkdir /var/log/uwsgi
``:code

Y crear el archivo de configuración "/etc/uwsgi/web2py.xml":

``
<uwsgi>
<socket>/tmp/web2py.socket</socket>
Expand Down Expand Up @@ -612,7 +612,7 @@ Por último reinicia todo:

``
start uwsgi-emperor
/etc/init.d/nginx restart
/etc/init.d/nginx restart
``:code

Puedes volver a cargar uwsgi con
Expand Down Expand Up @@ -850,7 +850,7 @@ sudo nano /etc/postgresql/9.1/main/postgresql.conf
y asegúrate de que contenga estas dos líneas
``
...
listen_addresses = 'localhost'
listen_addresses = 'localhost'
...
track_counts = on
...
Expand Down Expand Up @@ -1103,7 +1103,7 @@ El comando para iniciar el planificador es ''pythonw.exe -K <nombredeapp>''
Utilizamos nssm para envolver este comando, convirtiéndolo en un servicio.
Antes de hacer esto, debes elegir el nombre del servicio.
Existen claras razones para crear un servicio específico para cada app que requiera un scheduler.
Por lo tanto, la convención para el uso de nombres que utilices podría ser web2py_scheduler_app1
Por lo tanto, la convención para el uso de nombres que utilices podría ser web2py_scheduler_app1

Luego de extraer el archivo zip, abre una consola del intérprete de comandos de Windows en la carpeta que contiene la versión para la arquitectura de tu sistema, y escribe

Expand Down Expand Up @@ -1419,7 +1419,7 @@ Con este ajuste, ya no se necesita que la carpeta "errors" esté compartida, ya
#### Memcache
``memcache``:inxx

Hemos mostrado que web2py provee de dos tipos de caché:``cache.ram`` y ``cache.disk``.
Hemos mostrado que web2py provee de dos tipos de caché:``cache.ram`` y ``cache.disk``.

Los dos tipos de caché funcionan en un ambiente distribuido con múltiples servidores simultáneos, pero no funcionan como se esperaría. En particular, ``cache.ram`` solo hará caché en el nivel del servidor; esto hace que pierda su utilidad. ``cache.disk`` también hará el caché en el nivel del servidor a menos que la carpeta "cache" sea una carpeta compartida son soporte para bloqueo o ''locking''; por lo tanto, en lugar de hacer el sistema más eficiente, se convierte en un importante cuello de botella.

Expand All @@ -1436,7 +1436,7 @@ cache.ram = cache.disk = cache.memcache

La primera línea importa memcache. La segunda línea tiene que ser una lista de socket memcache (servidor:puerto). La tercer línea define ``cache.memcache``. La cuarta línea redefine ``cache.ram`` y ``cache.disk`` en función de memcache.

Podrías optar por redefinir solo uno de ellos para definir un objeto cache totalmente nuevo asociado al objeto Memcache.
Podrías optar por redefinir solo uno de ellos para definir un objeto cache totalmente nuevo asociado al objeto Memcache.

Con este ajuste ya no será necesario compartir la carpeta "cache", ya que no se volverá a utilizar.

Expand Down Expand Up @@ -1619,7 +1619,7 @@ Agradecemos al equipo de PythonAnywhere por su ayuda y apoyo.
### Despliegue en Heroku
``heroku``:cite ``Heroku``:inxx

Heroku es una solución en alojamiento multiplataforma moderna y ágil. Permite aplicar cambios a tus aplicaciones en a una nube de servidores usando Git. Para poder usar Heroku debes tener Git instalado y además debes tener el SDK Heroku instalado. La interacción con Heroku es a través del SDK en forma local y los comandos se actualizan y ejecutan en el servidor.
Heroku es una solución en alojamiento multiplataforma moderna y ágil. Permite aplicar cambios a tus aplicaciones en a una nube de servidores usando Git. Para poder usar Heroku debes tener Git instalado y además debes tener el SDK Heroku instalado. La interacción con Heroku es a través del SDK en forma local y los comandos se actualizan y ejecutan en el servidor.

Las aplicaciones que corren sobre Heroku no pueden depender de un sistema de archivos permanente ya que se actualiza en forma periódica. Por esta razón sólo se debe almacenar el código de la aplicación en el sistema de archivos. Todo dato debe ser almacenado en la base de datos. Heroku depende de PostgreSQL. Igualmente, PostgreSQL también se configura usando el SDK de Heroku y la URI para la base de datos se asigna en forma dinámica en tiempo de ejecución y se almacena en una variable de entorno.

Expand All @@ -1646,7 +1646,7 @@ Si no se corre la plataforma Heroku, ``get_db`` usará una base de datos de desa

En ambos casos las sesiones se almacenarán en la base de datos.

Web2py provee de un script "scripts/setup-web2py-heroku.py" para desplegar tu instalación en Heroku. El script ejecuta los siguientes pasos:
Web2py provee de un script "scripts/setup-web2py-heroku.py" para desplegar tu instalación en Heroku. El script ejecuta los siguientes pasos:


Instala virtualenv y el controlador psycopg2:
Expand Down
32 changes: 16 additions & 16 deletions sources/37-web2py-portuguese-work-in-progress/13.markmin
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ Here are some steps to install apache+python+mod_wsgi+web2py+postgresql from scr

On Ubuntu:
``
wget http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh
wget https://raw.githubusercontent.com/web2py/web2py/master/scripts/setup-web2py-ubuntu.sh
chmod +x setup-web2py-ubuntu.sh
sudo ./setup-web2py-ubuntu.sh
``
On Fedora:
``
wget http://web2py.googlecode.com/hg/scripts/setup-web2py-fedora.sh
wget https://raw.githubusercontent.com/web2py/web2py/master/scripts/setup-web2py-fedora.sh
chmod +x setup-web2py-fedora.sh
sudo ./setup-web2py-fedora.sh
``
Expand Down Expand Up @@ -482,7 +482,7 @@ Nginx is more than an HTTP server and reverse proxy, it is also an IMAP/POP3 pro

Nginx is easy to configure and its configuration files and simpler and more compact than the corresponding Apache ones.

Nginx does not support WSGI but provides native support for the uWSGI ``uwsgi``:cite protocol.``uwsgi``:inxx
Nginx does not support WSGI but provides native support for the uWSGI ``uwsgi``:cite protocol.``uwsgi``:inxx

On Ubuntu you can install Nginx with:
``
Expand Down Expand Up @@ -532,9 +532,9 @@ server {
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWARE nginx/$nginx_version;
}

}
``:code
``:code

You will need to symlink the file and remove the default

Expand All @@ -549,16 +549,16 @@ mkdir /etc/nginx/ssl
cp web2py.key /etc/nginx/ssl
cp web2py.crt /etc/nginx/ssl
``:code
You then need to install and setup uWSGI

You then need to install and setup uWSGI

``
sudo mkdir /etc/uwsgi
sudo mkdir /var/log/uwsgi
``:code

And create a configuration file "/etc/uwsgi/web2py.xml":

``
<uwsgi>
<socket>/tmp/web2py.socket</socket>
Expand All @@ -582,10 +582,10 @@ And create a configuration file "/etc/uwsgi/web2py.xml":

This file assumes web2py is installed under "/home/www-data/web2py", as in the Aapache case.

You also need to edit a second configuration file "/etc/init/uwsgi-emperor.conf":
You also need to edit a second configuration file "/etc/init/uwsgi-emperor.conf":

``
# Emperor uWSGI script
# Emperor uWSGI script
description "uWSGI Emperor"
start on runlevel [2345]
stop on runlevel [06]
Expand All @@ -597,7 +597,7 @@ Finally restart everything:

``
start uwsgi-emperor
/etc/init.d/nginx restart
/etc/init.d/nginx restart
``:code

You can reload uwsgi with
Expand Down Expand Up @@ -1153,7 +1153,7 @@ session.forget()

Sessions are automatically forgotten is unchanged.

With sessions in database, "sessions" folder does not need to be a shared folder because it will no longer be accessed.
With sessions in database, "sessions" folder does not need to be a shared folder because it will no longer be accessed.

-------
Notice that, if sessions are disabled, you must not pass the ``session`` to ``form.accepts`` and you cannot use ``session.flash`` nor CRUD.
Expand Down Expand Up @@ -1451,11 +1451,11 @@ You just need to let your webserver know when to send those files ``apache-conte

PythonAnywhere is the simplest way to deploy web2py applications.

PythonAnywhere is a Python development and hosting environment that displays in your web browser and runs on cloud servers. They are already set up with everything you need to run Python
and they support web2py specifically. In our experience PythonAnywhere is easy to use, fast, and powerful. They also provide MySQL databases, python shells and Dropbox integration.
PythonAnywhere is a Python development and hosting environment that displays in your web browser and runs on cloud servers. They are already set up with everything you need to run Python
and they support web2py specifically. In our experience PythonAnywhere is easy to use, fast, and powerful. They also provide MySQL databases, python shells and Dropbox integration.
Professional hosting is available if the free basic one is not enough for you.

In order to use PythonAnywhere you need to create an account, login, then use the provided web Dashboard to add a new Web App of type web2py.
In order to use PythonAnywhere you need to create an account, login, then use the provided web Dashboard to add a new Web App of type web2py.

[[image @///image/pythonanywhere1.png center 300px]]
[[image @///image/pythonanywhere1.png center 300px]]
Expand Down
Loading

0 comments on commit 406deda

Please sign in to comment.