### Tutorials, API documentation and Model Reference
Frappé is a full stack web application framework written in Python,
Javascript, HTML/CSS with MySQL as the backend. It was built for ERPNext
but is pretty generic and can be used to build database driven apps.
The key differece in Frappé compared to other frameworks is that Frappé
is that meta-data is also treated as data and is used to build front-ends
very easily. Frappé comes with a full blown admin UI called the **Desk**
that handles forms, navigation, lists, menus, permissions, file attachment
and much more out of the box.
Frappé also has a plug-in architecture that can be used to build plugins
to ERPNext.
Frappé Framework was designed to build [ERPNext](https://erpnext.com), open source
ERP for managing small and medium sized businesses.
[Get started with the Tutorial](/docs/user/)
### Feedback
You're encouraged to help improve the quality of this documentation, by sending a pull request on the [GitHub Repository](https://github.com/frappe/erpnext). If you would like to have a discussion regarding the documentation, you can do so [at the forum](https://discuss.erpnext.com).
Frappe version 6.7 onwards includes a full-blown documentation generator so that you can easily create a website for your app that has both user docs and developers docs (auto-generated).
Frappé version 6.7 onwards includes a full-blown documentation generator so that you can easily create a website for your app that has both user docs and developers docs (auto-generated).
Version 8.7 onwards, these will be generated in a target app.
When you are in application design mode and you want the changes in your DocTypes, Reports etc to affect the app repository, you must be in **Developer Mode**.
Sometimes you may not want a user request to be executed immediately but added to a queue that will be executed by a background worker. The advantage of doing this is that your web workers remain free to execute other requests and longer jobs do not eat up all of your resources.
From version 7, Frappe uses Python RQ to run background jobs.
From version 7, Frappé uses Python RQ to run background jobs.
Often while building javascript interfaces, there is a need to render DOM as an HTML template. Frappe Framework uses John Resig's Microtemplate script to render HTML templates in the Desk application.
Often while building javascript interfaces, there is a need to render DOM as an HTML template. Frappé Framework uses John Resig's Microtemplate script to render HTML templates in the Desk application.
> Note 1: In Frappe we use the Jinja-like `{% raw %}{%{% endraw %}` tags to embed code rather than the standard `<%`
> Note 1: In Frappé we use the Jinja-like `{% raw %}{%{% endraw %}` tags to embed code rather than the standard `<%`
> Note 2: Never use single quotes `'` inside the HTML template.
In Frappe Framework, you can manage ajax calls via frappe.call. The frappe.call works in asynchronous manner ie. send requests and handle response via callback mechanism.
In Frappé Framework, you can manage ajax calls via frappe.call. The frappe.call works in asynchronous manner ie. send requests and handle response via callback mechanism.
To connect to a remote database server using ssl, you must first configure the database host to accept SSL connections. An example of how to do this is available at https://www.digitalocean.com/community/tutorials/how-to-configure-ssl-tls-for-mysql-on-ubuntu-16-04. After you do the configuration, set the following three options. All options must be set for Frappe to attempt to connect using SSL.
To connect to a remote database server using ssl, you must first configure the database host to accept SSL connections. An example of how to do this is available at https://www.digitalocean.com/community/tutorials/how-to-configure-ssl-tls-for-mysql-on-ubuntu-16-04. After you do the configuration, set the following three options. All options must be set for Frappé to attempt to connect using SSL.
- `db_ssl_ca`: Full path to the ca.pem file used for connecting to a database host using ssl. Example value is `"/etc/mysql/ssl/ca.pem"`.
- `db_ssl_cert`: Full path to the cert.pem file used for connecting to a database host using ssl. Example value is `"/etc/mysql/ssl/client-cert.pem"`.
- `db_ssl_key`: Full path to the key.pem file used for connecting to a database host using ssl. Example value is `"/etc/mysql/ssl/client-key.pem"`.
<p>Frappe handles failure of jobs in the following way,</p><p>1) If a job fails, (raises exception), it's logged in Scheduler Log and <code>logs/worker.error.log</code>.<br>2) Keeps a lock file and would not run anymore if lock file is there.<br>3) Raises LockTimeoutError in case the lock file is more than 10 minutes old.</p>
<p>Frappé handles failure of jobs in the following way,</p><p>1) If a job fails, (raises exception), it's logged in Scheduler Log and <code>logs/worker.error.log</code>.<br>2) Keeps a lock file and would not run anymore if lock file is there.<br>3) Raises LockTimeoutError in case the lock file is more than 10 minutes old.</p>
<p>You can configure email notification for scheduler errors. By writing a file, <code>sites/common_site_config.json</code> with content<br></p>
Use Facebook, Google or GitHub authentication to login to Frappe, and your users will be spared from remembering another password.
Use Facebook, Google or GitHub authentication to login to Frappé, and your users will be spared from remembering another password.
The system uses the **Email Address** supplied by these services to **match with an existing user** in Frappe. If no such user is found, **a new user is created** of the default type **Website User**, if Signup is not disabled in Website Settings. Any System Manager can later change the user type from **Website User** to **System User**, so that the user can access the Desktop.
The system uses the **Email Address** supplied by these services to **match with an existing user** in Frappé. If no such user is found, **a new user is created** of the default type **Website User**, if Signup is not disabled in Website Settings. Any System Manager can later change the user type from **Website User** to **System User**, so that the user can access the Desktop.
#### Login screen with Social Logins enabled
<img class="screenshot" alt="Login screen with Social Logins enabled" src="/docs/assets/img/social-logins.png">
To enable these signups, you need to have **Client ID** and **Client Secret** from these authentication services for your Frappe site. The Client ID and Client Secret are to be set in Website > Setup > Social Login Keys. Here are the steps to obtain these credentials.
To enable these signups, you need to have **Client ID** and **Client Secret** from these authentication services for your Frappé site. The Client ID and Client Secret are to be set in Website > Setup > Social Login Keys. Here are the steps to obtain these credentials.
> Use **https://{{ yoursite }}** if your site is HTTPS enabled.
Frappe bundles the c3.js libary to make charts inside the app and provides a wrapper class so that you can start using charts out of the box. To use chart, you need the x and y data, make a wrapper block and then just make the chart object.
Frappé bundles the c3.js libary to make charts inside the app and provides a wrapper class so that you can start using charts out of the box. To use chart, you need the x and y data, make a wrapper block and then just make the chart object.
The Frappe UI **Graph** object enables you to render simple line, bar or percentage graphs for single or multiple discreet sets of data points. You can also set special checkpoint values and summary stats.
The Frappé UI **Graph** object enables you to render simple line, bar or percentage graphs for single or multiple discreet sets of data points. You can also set special checkpoint values and summary stats.
The Frappe Framework is a server side and client side framework and is built with the philosophy make it a "battries included" framework. It has libraries and API for everything from authentication to reports.
The Frappé Framework is a server side and client side framework and is built with the philosophy make it a "battries included" framework. It has libraries and API for everything from authentication to reports.
In this section we will try and cover the most commonly used API on client and server side that will be useful for app development.
<a href="https://tools.ietf.org/html/rfc6749">OAuth 2.0</a> provider based on <a href="https://github.com/idan/oauthlib">oauthlib</a> is built into frappe. Third party apps can now access resources of users based on Frappe Role and User permission system. To setup an app to access
<a href="https://tools.ietf.org/html/rfc6749">OAuth 2.0</a> provider based on <a href="https://github.com/idan/oauthlib">oauthlib</a> is built into frappe. Third party apps can now access resources of users based on Frappé Role and User permission system. To setup an app to access
## OAuth defines four roles
@@ -30,7 +30,7 @@ Go to
### Add Primary Server
This is the main server hosting all the users. e.g. `https://frappe.io`. To setup this as the main server, go to *Setup* > *Integrations* > *Social Login Keys* and enter `https://frappe.io` in the field `Frappe Server URL`. This URL repeats in all other Frappe servers who connect to this server to authenticate. Effectively, this is the main Identity Provider (IDP).
This is the main server hosting all the users. e.g. `https://frappe.io`. To setup this as the main server, go to *Setup* > *Integrations* > *Social Login Keys* and enter `https://frappe.io` in the field `Frappé Server URL`. This URL repeats in all other Frappé servers who connect to this server to authenticate. Effectively, this is the main Identity Provider (IDP).
Under this server add as many `OAuth Client`(s) as required.
Frappe also uses Open ID connect essential standard for authenticating users. To get `id_token` with `access_token`, pass `openid` as the value for the scope parameter during authorization request.
Frappé also uses Open ID connect essential standard for authenticating users. To get `id_token` with `access_token`, pass `openid` as the value for the scope parameter during authorization request.
If the scope is `openid` the JSON response with `access_token` will also include a JSON Web Token (`id_token`) signed with `HS256` and `Client Secret`. The decoded `id_token` includes the `at_hash`.
@@ -19,25 +19,25 @@ Example Bearer Token with scope `openid`
}
```
## Frappe social login setup
## Frappé social login setup
In this example there are 2 servers,
### Primary Server
This is the main server hosting all the users. e.g. `https://frappe.io`. To setup this as the main server, go to *Setup* > *Integrations* > *Social Login Keys* and enter `https://frappe.io` in the field `Frappe Server URL`. This URL repeats in all other Frappe servers who connect to this server to authenticate. Effectively, this is the main Identity Provider (IDP).
This is the main server hosting all the users. e.g. `https://frappe.io`. To setup this as the main server, go to *Setup* > *Integrations* > *Social Login Keys* and enter `https://frappe.io` in the field `Frappé Server URL`. This URL repeats in all other Frappé servers who connect to this server to authenticate. Effectively, this is the main Identity Provider (IDP).
Under this server add as many `OAuth Client`(s) as required. Because we are setting up one app server, add only one `OAuth Client`
### Frappe App Server
This is the client connecting to the IDP. Go to *Setup* > *Integrations* > *Social Login Keys* on this server and add appropriate values to `Frappe Client ID` and `Frappe Client Secret` (refer to client added in primary server). As mentioned before keep the `Frappe Server URL` as `https://frappe.io`
### Frappé App Server
This is the client connecting to the IDP. Go to *Setup* > *Integrations* > *Social Login Keys* on this server and add appropriate values to `Frappé Client ID` and `Frappé Client Secret` (refer to client added in primary server). As mentioned before keep the `Frappé Server URL` as `https://frappe.io`
Now you will see Frappe icon on the login page. Click on this icon to login with account created in primary server (IDP) `https://frappe.io`
Now you will see Frappé icon on the login page. Click on this icon to login with account created in primary server (IDP) `https://frappe.io`
**Note**: If `Skip Authorization` is checked while registering a client, page to allow or deny the granting access to resource is not shown. This can be used if the apps are internal to one organization and seamless user experience is needed.
An Application in Frappe is just a standard Python application. You can structure a Frappe Application the same way you structure a standard Python Application. For deployment, Frappe uses the standard Python Setuptools, so you can easily port and install the application on any machine.
An Application in Frappé is just a standard Python application. You can structure a Frappé Application the same way you structure a standard Python Application. For deployment, Frappé uses the standard Python Setuptools, so you can easily port and install the application on any machine.
Frappe Framework provides a WSGI interface and for development you can use the built-in Werkzeug server. For implementing in production, we recommend using nginx and gunicorn.
Frappé Framework provides a WSGI interface and for development you can use the built-in Werkzeug server. For implementing in production, we recommend using nginx and gunicorn.
Frappe also has a multi-tenant architecture, grounds up. This means that you can run multiple "sites" in your setup, each could be serving a different set of applications and users. The database for each site is separate.
Frappé also has a multi-tenant architecture, grounds up. This means that you can run multiple "sites" in your setup, each could be serving a different set of applications and users. The database for each site is separate.
<p class="lead">A list of resources to help you get started with building apps using Frappe</p>
<p class="lead">A list of resources to help you get started with building apps using Frappé</p>
---
#### 1. Python
Frappe uses Python (v2.7) for server-side programming. It is highly recommended to learn Python before you start building apps with Frappe.
Frappé uses Python (v2.7) for server-side programming. It is highly recommended to learn Python before you start building apps with Frappé.
To write quality server-side code, you must also include automated tests.
@@ -20,7 +20,7 @@ Resources:
#### 2. MariaDB / MySQL
To create database-driven apps with Frappe, you must understand the basics of database management, like how to install, login, create new databases, and basic SQL queries.
To create database-driven apps with Frappé, you must understand the basics of database management, like how to install, login, create new databases, and basic SQL queries.
Resources:
@@ -32,7 +32,7 @@ Resources:
#### 3. HTML / CSS
If you want to build user interfaces using Frappe, you will need to learn basic HTML / CSS and the Boostrap CSS Framework.
If you want to build user interfaces using Frappé, you will need to learn basic HTML / CSS and the Boostrap CSS Framework.
Resources:
@@ -74,5 +74,5 @@ Resources:
---
When you are ready, you can try [building a sample application](/docs/user/en/tutorial/app) using Frappe.
When you are ready, you can try [building a sample application](/docs/user/en/tutorial/app) using Frappé.
With Frappe Bench you will be able to setup and host multiple applications and sites and it will also setup a Python Virtualenv so that you can have an isolated environment to run your applications (and will not have version conflict with other development environments).
With Frappé Bench you will be able to setup and host multiple applications and sites and it will also setup a Python Virtualenv so that you can have an isolated environment to run your applications (and will not have version conflict with other development environments).
The `bench` command line tool will also be installed that will help you in development and management of the installation.
We hope this will give you an overview of how applications are developed in Frappe. The objective was to briefly touch on the various aspects of application development and give a broad overview. To get help on specific issues, look at the API.
We hope this will give you an overview of how applications are developed in Frappé. The objective was to briefly touch on the various aspects of application development and give a broad overview. To get help on specific issues, look at the API.
For help, join the community at the [chat channel on Gitter](https://gitter.im/frappe/erpnext) or the [developer forum](https://discuss.erpnext.com)
@@ -45,7 +45,7 @@ We can add the following fields:
#### Add Permissions
After adding the fields, hit done and add a new row in the Permission Rules section. For now, let us give Read, Write, Create, Delete and Report access to **Librarian**. Frappe has a finely grained Role based permission model. You can also change permissions later using the **Role Permissions Manager** from **Setup**.
After adding the fields, hit done and add a new row in the Permission Rules section. For now, let us give Read, Write, Create, Delete and Report access to **Librarian**. Frappé has a finely grained Role based permission model. You can also change permissions later using the **Role Permissions Manager** from **Setup**.
In this guide, we will show you how to create an application from scratch using **Frappe**. Using the example of a Library Management System, we will cover:
In this guide, we will show you how to create an application from scratch using **Frappé**. Using the example of a Library Management System, we will cover:
1. Installation
1. Making a New App
@@ -12,9 +12,9 @@ In this guide, we will show you how to create an application from scratch using
## Who is This For?
This guide is intended for software developers who are familiar with how the web applications are built and served. Frappe Framework is built on Python and uses MariaDB database and for creating web views, HTML/CSS/Javascript is used. So it would be great if you are familiar with all these technologies. At the minimum, if you have never used Python before, you should take a quick tutorial before your use this Guide.
This guide is intended for software developers who are familiar with how the web applications are built and served. Frappé Framework is built on Python and uses MariaDB database and for creating web views, HTML/CSS/Javascript is used. So it would be great if you are familiar with all these technologies. At the minimum, if you have never used Python before, you should take a quick tutorial before your use this Guide.
Frappe uses the git version control system on GitHub. It is also important that you are familiar with basic git and have an account on GitHub to manage your applications.
Frappé uses the git version control system on GitHub. It is also important that you are familiar with basic git and have an account on GitHub to manage your applications.
## Example
@@ -26,7 +26,7 @@ For this guide book, we will build a simple **Library Management** application.
1. Library Membership (A period in which a member is allowed to transact)
1. Library Management Setting (Global settings like period of loan)
The user interface (UI) for the librarian will be the **Frappe Desk**, a built-in browser based UI environment where forms are automatically generated from the models and roles and permissions are also applied.
The user interface (UI) for the librarian will be the **Frappé Desk**, a built-in browser based UI environment where forms are automatically generated from the models and roles and permissions are also applied.
We will also create web views for library where users can browse articles from a website.
The next step is to create the models as we discussed in the introduction. In Frappe, models are called **DocTypes**. You can create new DocTypes from the Desk UI. **DocTypes** are made of fields called **DocField** and role based permissions are integrated into the models, these are called **DocPerms**.
The next step is to create the models as we discussed in the introduction. In Frappé, models are called **DocTypes**. You can create new DocTypes from the Desk UI. **DocTypes** are made of fields called **DocField** and role based permissions are integrated into the models, these are called **DocPerms**.
When a DocType is saved, a new table is created in the database. This table is named as `tab[doctype]`.
@@ -44,11 +44,11 @@ The application will be created in a folder called `library_management` and will
1. `config` folder contains application configuration info
1. `desktop.py` is where desktop icons can be added to the Desk
1. `hooks.py` is where integrations with the environment and other applications is mentioned.
1. `library_management` (inner) is a **module** that is bootstrapped. In Frappe, a **module** is where model and controller files reside.
1. `library_management` (inner) is a **module** that is bootstrapped. In Frappé, a **module** is where model and controller files reside.
1. `modules.txt` contains list of **modules** in the app. When you create a new module, it is required that you update it in this file.
1. `patches.txt` is where migration patches are written. They are python module references using the dot notation.
1. `templates` is the folder where web view templates are maintained. Templates for **Login** and other standard pages are bootstrapped in frappe.
1. `generators` are where templates for models are maintained, where each model instance has a separte web route, for example a **Blog Post** where each post has its unique web url. In Frappe, the templating engine used is Jinja2
1. `generators` are where templates for models are maintained, where each model instance has a separte web route, for example a **Blog Post** where each post has its unique web url. In Frappé, the templating engine used is Jinja2
1. `pages` is where single route templates are maintained. For example for a "/blog" type of page.
@@ -18,7 +18,7 @@ Let us create a new site and call it `library`.
You can then install a new site, by the command `bench new-site library`.
This will create a new database and site folder and install `frappe` (which is also an application!) in the new site. The `frappe` application has two built-in modules **Core** and **Website**. The Core module contains the basic models for the application. Frappe is a batteries included framework and comes with a lot of built-in models. These models are called **DocTypes**. More on that later.
This will create a new database and site folder and install `frappe` (which is also an application!) in the new site. The `frappe` application has two built-in modules **Core** and **Website**. The Core module contains the basic models for the application. Frappé is a batteries included framework and comes with a lot of built-in models. These models are called **DocTypes**. More on that later.
A application will usually have a Settings page. In our application, we can define a page where we can set the loan period. We also need to save this property. In Frappe, this can be done using a **Single** type DocType. A Single DocType is like the Singleton pattern in Java. It is an object with only one instance. Let us call this as **Library Managment Settings**.
A application will usually have a Settings page. In our application, we can define a page where we can set the loan period. We also need to save this property. In Frappé, this can be done using a **Single** type DocType. A Single DocType is like the Singleton pattern in Java. It is an object with only one instance. Let us call this as **Library Managment Settings**.
To create an new Single DocType, mark the **Is Single** property as checked.
As you can see, the Frappe basic system comes with several pre-loaded applications like To Do, File Manager etc. These apps can integrated in your app workflow as we progress.
As you can see, the Frappé basic system comes with several pre-loaded applications like To Do, File Manager etc. These apps can integrated in your app workflow as we progress.
Finally, an application also has to send email notifications and do other kind of scheduled tasks. In Frappe, if you have setup the bench, the task / scheduler is setup via Celery using Redis Queue.
Finally, an application also has to send email notifications and do other kind of scheduled tasks. In Frappé, if you have setup the bench, the task / scheduler is setup via Celery using Redis Queue.
To add a new task handler, go to `hooks.py` and add a new handler. Default handlers are `all`, `daily`, `weekly`, `monthly`. The `all` handler is called every 3 minutes by default.
@@ -15,7 +15,7 @@ To add a new task handler, go to `hooks.py` and add a new handler. Default handl
Here we can point to a Python function and that function will be executed every day. Let us look what this function looks like:
Now that we have created the models, we can directly start making records using Frappe Desk UI. You do not have to create views! Views in Frappe are automatically made based on the DocType properties.
Now that we have created the models, we can directly start making records using Frappé Desk UI. You do not have to create views! Views in Frappé are automatically made based on the DocType properties.
Frappe has two main user environments, the Desk and Web. Desk is a controlled UI environment with a rich AJAX application and the web is more traditional HTML templates served for public consumption. Web views can also be generated to create more controlled views for users who may login but still do not have access to the Desk.
Frappé has two main user environments, the Desk and Web. Desk is a controlled UI environment with a rich AJAX application and the web is more traditional HTML templates served for public consumption. Web views can also be generated to create more controlled views for users who may login but still do not have access to the Desk.
In Frappe, Web Views are managed by templates and they are usually in the `templates` folder. There are 2 main types of templates.
In Frappé, Web Views are managed by templates and they are usually in the `templates` folder. There are 2 main types of templates.
1. Pages: These are Jinja templates where a single view exists for a single web route e.g. `/blog`.
2. Generators: These are templates where each instance of a DocType has a separate web route `/blog/a-blog`, `blog/b-blog` etc.
@@ -50,7 +50,7 @@ The updated list view looks like this!
#### Home Page
Frappe also has a built-in signup workflow which also includes 3rd party signups via Google, Facebook and GitHub. When a user signs up on the web, she does not have access to the desk interface by default.
Frappé also has a built-in signup workflow which also includes 3rd party signups via Google, Facebook and GitHub. When a user signs up on the web, she does not have access to the desk interface by default.
> To allow user access into the Desk, open set the user from Setup > User and set the User Type as "System User"
This 10-part video tutorial will teach you how to build complex apps in Frappe
This 10-part video tutorial will teach you how to build complex apps in Frappé
Pre-requisites: <a href="/docs/user/en/tutorial/before.html" target="_blank">You must have some understanding of Python, Javascript and MySQL before you start this tutorial.</a>
Una aplicación en Frappe es una aplicación estandar en Python. Puedes estructurar una aplicación hecha en Frappe de la misma forma que estructuras una aplicación en Python.
Para implementación, Frappe usa los Python Setuptools, lo que nos permite facilmente instalar la aplicación en cualquier computadora.
Una aplicación en Frappé es una aplicación estandar en Python. Puedes estructurar una aplicación hecha en Frappé de la misma forma que estructuras una aplicación en Python.
Para implementación, Frappé usa los Python Setuptools, lo que nos permite facilmente instalar la aplicación en cualquier computadora.
El Framework Frappe provee una interfaz WSGI y para el desarrollo puedes usar el servidor interno de frappe llamado Werkzeug. Para implementación en producción, recomendamos usar nginx y gunicorn.
El Framework Frappé provee una interfaz WSGI y para el desarrollo puedes usar el servidor interno de frappe llamado Werkzeug. Para implementación en producción, recomendamos usar nginx y gunicorn.
Frappe tambien soporta la architectura multi-tenant. Esto significa que puedes correr varios "sitios" en su instalación, cada uno de ellos estará poniendo a disposición un conjunto de aplicaciones y usuarios. La base de datos para cada sitio es separada.
Frappé tambien soporta la architectura multi-tenant. Esto significa que puedes correr varios "sitios" en su instalación, cada uno de ellos estará poniendo a disposición un conjunto de aplicaciones y usuarios. La base de datos para cada sitio es separada.
<p class="lead">Una lista de recursos que te ayudaran a inicar con el desarrollo de aplicaciones usando Frappe.</p>
<p class="lead">Una lista de recursos que te ayudaran a inicar con el desarrollo de aplicaciones usando Frappé.</p>
---
#### 1. Python
Frappe usa Python (v2.7) como lenguaje de parte del servidor. Es altamente recomendable aprender Python antes de iniciar a crear aplicaciones con Frappe.
Frappé usa Python (v2.7) como lenguaje de parte del servidor. Es altamente recomendable aprender Python antes de iniciar a crear aplicaciones con Frappé.
Para escribir código de calidad del lado del servidor, también debes incluir pruebas automatizadas.
@@ -30,7 +30,7 @@ Recursos:
#### 3. HTML / CSS
Si quieres construir interfaces de usuario usando Frappe, necesitas aprender los conceptops básicos de HTML / CSS y el framework de CSS Bootstrap.
Si quieres construir interfaces de usuario usando Frappé, necesitas aprender los conceptops básicos de HTML / CSS y el framework de CSS Bootstrap.
Recursos:
1. [Tutorial sobre HTML/CSS de Codecademy](https://www.codecademy.com/learn/learn-html-css)
@@ -68,4 +68,4 @@ Recursos:
---
Cuando estes listo, puedes intentar [crear una aplicación simple](/docs/user/es/tutorial/app) usando Frappe.
Cuando estes listo, puedes intentar [crear una aplicación simple](/docs/user/es/tutorial/app) usando Frappé.
La forma más facíl de configurar frappe en un computador usando sitemas basados en Unix es usando frappe-bench. Lee las instrucciones detalladas acerca de como instalarlo usando Frappe Bench.
La forma más facíl de configurar frappe en un computador usando sitemas basados en Unix es usando frappe-bench. Lee las instrucciones detalladas acerca de como instalarlo usando Frappé Bench.
Con Frappe Bench vas a poder configurar y hostear multiples aplicaciones y sitios, también va a configurar un entorno virtual de Python por lo que vas a tener un entorno apartado para correr sus aplicaciones (y no va a tener conflictos de versiones con otros entornos de desarrollo).
Con Frappé Bench vas a poder configurar y hostear multiples aplicaciones y sitios, también va a configurar un entorno virtual de Python por lo que vas a tener un entorno apartado para correr sus aplicaciones (y no va a tener conflictos de versiones con otros entornos de desarrollo).
El comando `bench` va a ser instalado en su sistema para ayudarlo en la fase de desarrollo y el manejo de la aplicación.
Esperamos que esto te haya dado una idea de como son desarrolladas las aplicaicones en Frappe. El objetivo era de que de manera breve se tocaran varios de los aspectos del desarrollo de aplicaciones. Para obtener ayuda en inconvenientes o temas específicos, favor revisar el API.
Esperamos que esto te haya dado una idea de como son desarrolladas las aplicaicones en Frappé. El objetivo era de que de manera breve se tocaran varios de los aspectos del desarrollo de aplicaciones. Para obtener ayuda en inconvenientes o temas específicos, favor revisar el API.
Para ayuda, únete a la comunidad en el [canal de chat en Gitter](https://gitter.im/frappe/erpnext) o el [foro de desarrollo](https://discuss.erpnext.com)
@@ -46,7 +46,7 @@ Podemos agregar los siguientes campos:
#### Agregar permisos
Despues de agregar los campos, dar click en hecho y agrega una nueva fila en la sección de Permission Roles. Por ahora, vamos a darle accesos Lectura, Escritura, Creación y Reportes al Role **Librarian**. Frappe cuenta con un sistema basados en el modelo de Roles finamente granulado. Puedes cambiar los permisos más adealante usando el **Role Permissions Manager** desde **Setup**.
Despues de agregar los campos, dar click en hecho y agrega una nueva fila en la sección de Permission Roles. Por ahora, vamos a darle accesos Lectura, Escritura, Creación y Reportes al Role **Librarian**. Frappé cuenta con un sistema basados en el modelo de Roles finamente granulado. Puedes cambiar los permisos más adealante usando el **Role Permissions Manager** desde **Setup**.
En esta guía, vamos a mostrarte como crear una aplicación desde cero usando **Frappe**. Usando el ejemplo de un Sistema de Gestión de Librería. Vamos a cubrir:
En esta guía, vamos a mostrarte como crear una aplicación desde cero usando **Frappé**. Usando el ejemplo de un Sistema de Gestión de Librería. Vamos a cubrir:
1. Instalación
1. Creando una nueva App
@@ -12,10 +12,10 @@ En esta guía, vamos a mostrarte como crear una aplicación desde cero usando **
## Para Quién es este tutorial?
Esta guía esta orientada para desarrolladores de software que estan familiarizados con el proceso de como son creadas y servidas las aplicaciones web. El Framework Frappe está escrito en Python y usa MariaDB como base de datos y para la creación de las vistas web usa HTML/CSS/Javascript. Por lo que sería excelente si estas familiarizado con estas tecnologías.
Esta guía esta orientada para desarrolladores de software que estan familiarizados con el proceso de como son creadas y servidas las aplicaciones web. El Framework Frappé está escrito en Python y usa MariaDB como base de datos y para la creación de las vistas web usa HTML/CSS/Javascript. Por lo que sería excelente si estas familiarizado con estas tecnologías.
Por lo menos, si nunca haz usado Python antes, deberías tomar un tutorial rápido antes de iniciar con este tutorial.
Frappe usa el sistema de gestión de versiones en GitHub. También, es importante estar familiarizado con los conceptos básicos de git y tener una cuenta en GitHub para manejar sus aplicaciones.
Frappé usa el sistema de gestión de versiones en GitHub. También, es importante estar familiarizado con los conceptos básicos de git y tener una cuenta en GitHub para manejar sus aplicaciones.
## Ejemplo
@@ -27,7 +27,7 @@ Para esta guía, vamos a crear una aplicación simple llamada **Library Manageme
1. Library Membership (Un período en el que un miembro esta permitido hacer una trasacción)
1. Library Management Setting (Configuraciones generales, como el tiempo que dura el prestamo de un artículo)
La interfaz de usuario (UI) para la aplicación va a ser el **Frappe Desk**, un entorno para UI basado en el navegador y viene integrado en Frappe donde los formularios son generados automáticamente desde los modelos y los roles y permisos son aplicados.
La interfaz de usuario (UI) para la aplicación va a ser el **Frappé Desk**, un entorno para UI basado en el navegador y viene integrado en Frappé donde los formularios son generados automáticamente desde los modelos y los roles y permisos son aplicados.
También, vamos a crear vistas webs para la librería donde los usuarios pueden buscar los artículos desde una página web.
El siguiente paso es crear los modelos que discutimos en la introducción. En Frappe, los modelos son llamados **DocTypes**. Puedes crear nuevos DocTypes desde el UI Escritorio de Frappe. **DocTypes** son creados de campos llamados **DocField** y los permisos basados en roles son integrados dentro de los modelos, estos son llamados **DocPerms**.
El siguiente paso es crear los modelos que discutimos en la introducción. En Frappé, los modelos son llamados **DocTypes**. Puedes crear nuevos DocTypes desde el UI Escritorio de Frappé. **DocTypes** son creados de campos llamados **DocField** y los permisos basados en roles son integrados dentro de los modelos, estos son llamados **DocPerms**.
Cuando un DocType es guardado, se crea una nueva tabla en la base de datos. Esta tabla se nombra `tab[doctype]`.
@@ -44,11 +44,11 @@ La aplicación va a ser creada en el directorio llamado `library_management` y v
1. `config` contiene la información de configuración de la aplicación.
1. `desktop.py` es donde los íconos del escritorio pueden ser agregados al mismo.
1. `hooks.py` es donde se configuran las integraciones con el entorno y otras aplicaciones.
1. `library_management` (dentro) es un **módulo** que está contenido. En Frappe, un **módulo** es donde los modelos y controladores se almacenan.
1. `library_management` (dentro) es un **módulo** que está contenido. En Frappé, un **módulo** es donde los modelos y controladores se almacenan.
1. `modules.txt` contiene la lista de **módulos** en la aplicación. Cuando creas un nuevo módulo, es obligatorio que lo agregues a este archivo.
1. `patches.txt` es donde los patches para migraciones son establecidos. Son módulos de Python referenciados usando la nomenclatura de punto.
1. `templates` es el directorio donde son mantenidos las plantillas de vistas web. Plantillas para **Login** y otras páginas estandar estan contenidas en Frappe.
1. `generators` son donde las plantillas para los modelos son almacenadas, donde cada instancia de modelo tiene una ruta web separada, por ejemplo un **Blog Post** donde cada post tiene una url única. En Frappe, el manejador de plantillas utilizado es Jinja2.
1. `templates` es el directorio donde son mantenidos las plantillas de vistas web. Plantillas para **Login** y otras páginas estandar estan contenidas en Frappé.
1. `generators` son donde las plantillas para los modelos son almacenadas, donde cada instancia de modelo tiene una ruta web separada, por ejemplo un **Blog Post** donde cada post tiene una url única. En Frappé, el manejador de plantillas utilizado es Jinja2.
1. `pages` es donde las rutas simples son almacenadas. Por ejemplo para un tipo de página "/blog".
@@ -19,7 +19,7 @@ Vamos a crear un nuevo Site llamado `library`.
Ahora puedes instalar un nuevo site, ejecutando el comando `bench new-site library`.
La ejecución del comando anterior va a generar una nueva base de datos, un directorio en la carpeta sites y va a instalar `frappe` (el cual también es una aplicación!) en el nuevo site.
La aplicación `frappe` tiene dos módulos integrados que son **Core** y **Website**. El módulo Core contiene los modelos básicos para la aplicación. Frappe es un Framework con muchas funcionalidades incluidas y viene con muchos modelos integrados. Estos modelos son llamados **DocTypes**. Vamos a ver más de esto en lo adelante.
La aplicación `frappe` tiene dos módulos integrados que son **Core** y **Website**. El módulo Core contiene los modelos básicos para la aplicación. Frappé es un Framework con muchas funcionalidades incluidas y viene con muchos modelos integrados. Estos modelos son llamados **DocTypes**. Vamos a ver más de esto en lo adelante.
Una aplicación normalmente va a tener una página de configuración. En nuestra aplicación, podemos definir una página donde específiquemos el período de prestamos. Necesitaremos almacenar esta propiedad. En Frappe, esto puede lograrse usando los DocType de tipo **Simple**. Un DocType Simple es como el patrón Singleton en Java. Es un objeto con tan solo una instancia. Vamos a llamarlo **Library Managment Settings**.
Una aplicación normalmente va a tener una página de configuración. En nuestra aplicación, podemos definir una página donde específiquemos el período de prestamos. Necesitaremos almacenar esta propiedad. En Frappé, esto puede lograrse usando los DocType de tipo **Simple**. Un DocType Simple es como el patrón Singleton en Java. Es un objeto con tan solo una instancia. Vamos a llamarlo **Library Managment Settings**.
Para crear un Single DocType, marca el checkbox **Is Single**.
Como puedes ver, el sistema básico de Frappe viene con algunas aplicaciones preinstaladas como To Do, File Manager etc. Estas aplicaciones pueden integrarse en el flujo de trabajo de su aplicació a medida que avancemos.
Como puedes ver, el sistema básico de Frappé viene con algunas aplicaciones preinstaladas como To Do, File Manager etc. Estas aplicaciones pueden integrarse en el flujo de trabajo de su aplicació a medida que avancemos.
Finalmente, una aplicación también tiene que mandar notificaciones de email y hacer otros tipos de tareas programadas. En Frappe, si tienes el bench configurado, el programador de tareas es configurado vía Celery usando Redis Queue.
Finalmente, una aplicación también tiene que mandar notificaciones de email y hacer otros tipos de tareas programadas. En Frappé, si tienes el bench configurado, el programador de tareas es configurado vía Celery usando Redis Queue.
Para agregar un nuevo manejador(Handler) de tareas, ir a `hooks.py` y agrega un nuevo manejador. Los manejadores (Handlers) por defecto son `all`, `daily`, `weekly`, `monthly`. El manejador `all` es llamado cada 3 minutos por defecto.
@@ -15,7 +15,7 @@ Para agregar un nuevo manejador(Handler) de tareas, ir a `hooks.py` y agrega un
Aquí hacemos referencia a una función Python que va a ser ejecutada diariamente. Vamos a ver como se ve esta función:
Teniendo los modelos creados, podemos empezar a crear registros usando la interfaz gráfica de usuario de Frappe. No necesitas crear vistas! Las vistas en Frappe son automáticamente creadas basadas en las propiedades del DocType.
Teniendo los modelos creados, podemos empezar a crear registros usando la interfaz gráfica de usuario de Frappé. No necesitas crear vistas! Las vistas en Frappé son automáticamente creadas basadas en las propiedades del DocType.
Frappe tiene dos entornos principales, El escritorio y la Web. El escritorio es una interfaz de usuario controlada con una excelente aplicación AJAX y la web es mas plantillas de HTML tradicionales dispuestas para consumo público. Vistas Web pueden también ser generadas para crear vistas controladas para los usuarios que puedes acceder al sistema pero aún así no tener acceso al escritorio.
Frappé tiene dos entornos principales, El escritorio y la Web. El escritorio es una interfaz de usuario controlada con una excelente aplicación AJAX y la web es mas plantillas de HTML tradicionales dispuestas para consumo público. Vistas Web pueden también ser generadas para crear vistas controladas para los usuarios que puedes acceder al sistema pero aún así no tener acceso al escritorio.
En Frappe, Las vistas web son manejadas por plantillas que estan usualmente en el directorio `templates`. Hay dos tipos principales de plantillas.
En Frappé, Las vistas web son manejadas por plantillas que estan usualmente en el directorio `templates`. Hay dos tipos principales de plantillas.
1. Pages: Estos son plantillas Jinja donde una vista existe solo para una ruta. ejemplo. `/blog`.
2. Generators: Estas son plantiallas donde cada instancia de un DocType tiene una ruta diferente `/blog/a-blog`, `blog/b-blog` etc.
@@ -49,7 +49,7 @@ La lista actualizada debe lucir de esta manera!
#### Página de Inicio
Frappe también tiene vistas para el registro de usuarios que incluye opciones de registro usando Google, Facebook y GitHub. Cuando un usuario se registra vía la web, no tiene acceso a la interfaz del Escritorio por defecto.
Frappé también tiene vistas para el registro de usuarios que incluye opciones de registro usando Google, Facebook y GitHub. Cuando un usuario se registra vía la web, no tiene acceso a la interfaz del Escritorio por defecto.
> Para permitirles a los usuarios acceso al Escritorio, debes especificar que el usuario es de tipo "System User" en Setup > User
Este video tutorial de 10 videos va a enseñarte como crear aplicaciones complejas en Frappe.
Este video tutorial de 10 videos va a enseñarte como crear aplicaciones complejas en Frappé.
Prerrequisitos: <a href="/docs/user/es/tutorial/before.html" target="_blank">Debes tener conocimientos básicos de Python, Javascript y MySQl antes de empezar este tutorial.</a>
<p class="lead">Liste des outils et technologies utiles dans le développement d'applications avec Frappe.</p>
<p class="lead">Liste des outils et technologies utiles dans le développement d'applications avec Frappé.</p>
Il y a un grand nombres de tutoriels en ligne et nous recommandons [CodeAcademy](http://www.codecademy.com/) ou vous trouverez beaucoup de ressources de qualité.
@@ -8,7 +8,7 @@ Il y a un grand nombres de tutoriels en ligne et nous recommandons [CodeAcademy]
#### 1. Python
La partie serveur de Frappe est codée en Python et c'est une bonne idée d'[apprendre rapidement Python](http://www.codecademy.com/tracks/python) avant de commencer à comprendre Frappe. [Le tutoriel sur docs.python.org](https://docs.python.org/2.7/tutorial/index.html) est aussi une excellente ressource pour apprendre Python. Notez que Frappe utilise Python 2.7.
La partie serveur de Frappé est codée en Python et c'est une bonne idée d'[apprendre rapidement Python](http://www.codecademy.com/tracks/python) avant de commencer à comprendre Frappé. [Le tutoriel sur docs.python.org](https://docs.python.org/2.7/tutorial/index.html) est aussi une excellente ressource pour apprendre Python. Notez que Frappé utilise Python 2.7.
Pour produire une application de qualité, vous devez inclure des tests automatiques. Vous pouvez comprendre les bases du développement par les tests [ici](http://code.tutsplus.com/tutorials/beginning-test-driven-development-in-python--net-30137).
@@ -45,5 +45,5 @@ Si vous voulez modifier les affichages, vous devez apprendre le [language de tem
---
Quand vous êtes prêts, [essayez de développer une application simple avec Frappe](/docs/user/fr/tutorial/app)
Quand vous êtes prêts, [essayez de développer une application simple avec Frappé](/docs/user/fr/tutorial/app)
La façon la plus rapide d'installer Frappe sur un système Unix est d'utiliser frappe-bench. Lisez les instructions détaillées sur l'installation et l'utilisation de Frappe Bench : [https://github.com/frappe/bench](https://github.com/frappe/bench)
La façon la plus rapide d'installer Frappé sur un système Unix est d'utiliser frappe-bench. Lisez les instructions détaillées sur l'installation et l'utilisation de Frappé Bench : [https://github.com/frappe/bench](https://github.com/frappe/bench)
Avec Frappe Bench vous pourrez configurer et héberger plusieurs sites et applications. Frappe Bench configure aussi un environnement virtuel Python (Virtualenv), vos applications seront donc isolées les unes des autres et vous n'aurez pas de conflits avec d'autres environnements de développement.
Avec Frappé Bench vous pourrez configurer et héberger plusieurs sites et applications. Frappé Bench configure aussi un environnement virtuel Python (Virtualenv), vos applications seront donc isolées les unes des autres et vous n'aurez pas de conflits avec d'autres environnements de développement.
La commande `bench` sera ajoutée pour vous aider dans le développement et la gestion de vos applications.
@@ -46,11 +46,11 @@ L'application sera créée dans un répertoire appelé `library_management` et a
1. `config` contient les configurations de l'application
1. `desktop.py` est l'endroit ou les icones peuvent être ajoutées au bureau
1. `hooks.py` contient les définitions de la facon dont l'intégration avec l'environnement et les autres applications est faite.
1. `library_management` (interne) est un **module** bootstrappé. Dans Frappe, un **module** est l'endroit où sont les controlleurs et les modeles.
1. `library_management` (interne) est un **module** bootstrappé. Dans Frappé, un **module** est l'endroit où sont les controlleurs et les modeles.
1. `modules.txt` contient la liste des **modules** dans l'application. Quand vous créez un nouveau module, c'est obligatoire de l'ajouter dans ce fichier.
1. `patches.txt` contient les patchs de migration. Ce sont des références Python utilisant la notation par point.
1. `templates` est le repertoire qui contient les templates des vues. Les templates pour **Login** et autres pages par défaut sont déjà contenus dans Frappe.
1. `generators` est l'endroit où sont stockés les templates des modèles. Chaque instance du modèle a une route web comme par exemple les **articles de blog** ou chaque article a une adresse unique. Dans Frappe, Jinj2 est utilisé pour les templates.
1. `templates` est le repertoire qui contient les templates des vues. Les templates pour **Login** et autres pages par défaut sont déjà contenus dans Frappé.
1. `generators` est l'endroit où sont stockés les templates des modèles. Chaque instance du modèle a une route web comme par exemple les **articles de blog** ou chaque article a une adresse unique. Dans Frappé, Jinj2 est utilisé pour les templates.
1. `pages` contient les routes uniques pour les templates. Par exemple "/blog" ou "/article"
Uma Aplicação em Frappe é apenas uma aplicação padrão em Python. Você pode estruturar uma aplicação Frappe da mesma forma que estrutura uma aplicação padrão do Python. Para fazer o deploy, Frappe usa o padrão Setuptools do Python, assim você pode facilmente portar e instalar o aplicativo em qualquer máquina.
Uma Aplicação em Frappé é apenas uma aplicação padrão em Python. Você pode estruturar uma aplicação Frappé da mesma forma que estrutura uma aplicação padrão do Python. Para fazer o deploy, Frappé usa o padrão Setuptools do Python, assim você pode facilmente portar e instalar o aplicativo em qualquer máquina.
Frappe Framework fornece uma interface WSGI e para o desenvolvimento você pode usar o servidor embutido Werkzeug. Para a implementação em produção, recomendamos o uso do nginx e gunicorn.
Frappé Framework fornece uma interface WSGI e para o desenvolvimento você pode usar o servidor embutido Werkzeug. Para a implementação em produção, recomendamos o uso do nginx e gunicorn.
Frappe também tem uma arquitetura multi-tenant, a partir da base. Isso significa que você pode executar vários "sites" em sua configuração, cada um poderia estar servindo um conjunto diferente de aplicativos e usuários. O banco de dados de cada site é separado.
Frappé também tem uma arquitetura multi-tenant, a partir da base. Isso significa que você pode executar vários "sites" em sua configuração, cada um poderia estar servindo um conjunto diferente de aplicativos e usuários. O banco de dados de cada site é separado.
<p class="lead">Uma lista de ferramentas, tecnologias que serão muito úteis para a construção de aplicativos com Frappe.</p>
<p class="lead">Uma lista de ferramentas, tecnologias que serão muito úteis para a construção de aplicativos com Frappé.</p>
Há uma série de bons tutoriais on-line e encontramos [Codecademy] (http://www.codecademy.com/) como um dos mais bonitos tutoriais, aqui há um monte de lições que você pode aprender com Codecademy
@@ -8,7 +8,7 @@ Há uma série de bons tutoriais on-line e encontramos [Codecademy] (http://www.
#### 1. Python
O lado do servidor do Frappe é escrito em Python e é uma boa idéia para [aprender rapidamente Python] (http://www.codecademy.com/tracks/python) antes de começar a se aprofundar em Frappe. Outro bom lugar para aprender Pytohn é o [tutorial no docs.python.org](https://docs.python.org/2.7/tutorial/index.html). Note-se que o Frappe usa Python 2.7
O lado do servidor do Frappé é escrito em Python e é uma boa idéia para [aprender rapidamente Python] (http://www.codecademy.com/tracks/python) antes de começar a se aprofundar em Frappé. Outro bom lugar para aprender Pytohn é o [tutorial no docs.python.org](https://docs.python.org/2.7/tutorial/index.html). Note-se que o Frappé usa Python 2.7
Para escrever código do lado do servidor de qualidade, você deve incluir testes automáticos. Você pode aprender as noções básicas de [test driven development (TDD) - aqui] (http://code.tutsplus.com/tutorials/beginning-test-driven-development-in-python--net-30137).
@@ -44,4 +44,4 @@ Se estiver personalizando modelos de impressão, você precisa aprender a [líng
---
Quando estiver pronto, [tente construir uma aplicação de exemplo em Frappe](/docs/user/pt/tutorial/app)
Quando estiver pronto, [tente construir uma aplicação de exemplo em Frappé](/docs/user/pt/tutorial/app)
A maneira mais fácil de instalar o frappe em um sistema baseado em Unix, é utilizando o frappe-bench. Leia as instruções detalhadas sobre como instalar usando o Frappe Bench.
A maneira mais fácil de instalar o frappe em um sistema baseado em Unix, é utilizando o frappe-bench. Leia as instruções detalhadas sobre como instalar usando o Frappé Bench.
Com Frappe Bench você será capaz de configurar e hospedar vários aplicativos e sites e vai também configurar um Virtualenv do Python de modo que você pode ter um ambiente isolado para executar seus aplicativos (e não terá conflito de versões com outros ambientes de desenvolvimento).
Com Frappé Bench você será capaz de configurar e hospedar vários aplicativos e sites e vai também configurar um Virtualenv do Python de modo que você pode ter um ambiente isolado para executar seus aplicativos (e não terá conflito de versões com outros ambientes de desenvolvimento).
O `bench` ferramenta de linha de comando também será instalado, o que irá ajudá-lo no desenvolvimento e na gestão da instalação.
Esperamos que este tutorial lhe de uma visão geral de como as aplicações são desenvolvidas em Frappe. O objetivo era abordar brevemente os vários aspectos do desenvolvimento de aplicações e dar uma visão ampla. Para obter ajuda em questões específicas, olhe nossa API.
Esperamos que este tutorial lhe de uma visão geral de como as aplicações são desenvolvidas em Frappé. O objetivo era abordar brevemente os vários aspectos do desenvolvimento de aplicações e dar uma visão ampla. Para obter ajuda em questões específicas, olhe nossa API.
Para obter ajuda, faça parte da comunidade no [canal de bate-papo no Gitter](https://gitter.im/frappe/erpnext) ou no [fórum de desenvolvedores](https://discuss.erpnext.com)
@@ -45,7 +45,7 @@ Nós podemos adicionar os seguintes campos:
#### Adicionando permissões
Depois de adicionar os campos, finalize e adicione uma nova linha na seção Regras de permissão. Por enquanto, vamos dar permissão de Read, Write, Create, Delete and Report, a **Librarian**. Frappe tem uma Role baseado nas permissões do modelo. Você também pode alterar as permissões posteriormente usando o **Role Permissions Manager** do **Setup**.
Depois de adicionar os campos, finalize e adicione uma nova linha na seção Regras de permissão. Por enquanto, vamos dar permissão de Read, Write, Create, Delete and Report, a **Librarian**. Frappé tem uma Role baseado nas permissões do modelo. Você também pode alterar as permissões posteriormente usando o **Role Permissions Manager** do **Setup**.