10/23/2020 Frappe – Programming and Coding Tutorials
Home HTML CSS PHP Python SQL JAVA Frappe Java Script
Programming and Coding Tutorials
Category Archives: Frappe
Scheduler
Posted on October 9, 2020 by barewabar
bench –site your_sitename enable-scheduler
bench doctor
https://frappeframework.com/docs/user/en/bench/guides/diagnosing-the-scheduler
bench –site gor.site.com show-pending-jobs
$ bench –site [site-name] trigger-scheduler-event all
Site backup
Posted on October 7, 2020 by barewabar
bench –site [sitename] backup –with-files
Workflow
Posted on April 5, 2018 by barewabar
code.fwrat.com/category/frappe/ 1/7
10/23/2020 Frappe – Programming and Coding Tutorials
Home HTML CSS PHP Python SQL JAVA Frappe Java Script
Codes
Posted on April 1, 2018 by barewabar
bench --site www.site.com uninstall-app meeting
BackUp
bench backup --with-files
bench --site backup --with-files
bench backup
bench backup-all-sites
bench --site [sitename] uninstall-app [app]
root@erp:/home/frappe/frappe-bench# bench –site xx.aaa.com –force restore
20171005_004314_883fdeba_database.sql
bench –site aa.site.com –force restore sites/aaaaa/private/backups/20180402_010035_29d7966e_database.sql
root@erp:/home/frappe/frappe-bench/apps# cd ..
root@erp:/home/frappe/frappe-bench# bench –help | grep uninstall
uninstall-app Remove app and linked modules from site
root@erp:/home/frappe/frappe-bench#
root@erp:/home/frappe/frappe-bench# bench –help | grep remove
remove-app completely remove app from bench
remove-from-installed-apps Remove app from site’s installed-apps list
Make a New App
code.fwrat.com/category/frappe/ 2/7
10/23/2020 Frappe – Programming and Coding Tutorials
Posted on March 19, 2018 by barewabar
Home HTML CSS PHP Python SQL JAVA Frappe Java Script
Once the bench is installed, you will see two main folders, apps and sites . All the applications will be
installed in apps.
To make a new application, go to your bench folder and run, bench new-app {app_name} and fill in details
about the application. This will create a boilerplate application for you.
$ bench new-app library_management
App Title (defaut: Lib Mgt): Library Management
App Description: App for managing Articles, Members, Memberships and Transactions
App Publisher: Frappé
App Email: info@frappe.io
App Icon (default 'octicon octicon-file-directory'): octicon octicon-book
App Color (default 'grey'): #589494
App License (default 'MIT'): GNU General Public License
App Structure
The application will be created in a folder called library_management and will have the following structure:
.
├── MANIFEST.in
├── README.md
├── library_management
│ ├── __init__.py
│ ├── config
│ │ ├── __init__.py
│ │ └── desktop.py
│ ├── hooks.py
│ ├── library_management
│ │ └── __init__.py
│ ├── modules.txt
│ ├── patches.txt
│ └── templates
│ ├── __init__.py
│ ├── generators
│ │ └── __init__.py
│ ├── pages
│ │ └── __init__.py
│ └── statics
├── license.txt
├── requirements.txt
└── setup.py
1. config folder contains application configuration info
2. desktop.py is where desktop icons can be added to the Desk
3. hooks.py is where integrations with the environment and other applications is mentioned.
4. library_management (inner) is a module that is bootstrapped. In Frappé, a module is where model
and controller files reside.
code.fwrat.com/category/frappe/ 3/7
10/23/2020 Frappe – Programming and Coding Tutorials
5. modules.txt contains list of modules
Home HTML inCSS
the app.PHP
When you create a SQL
Python new module,
JAVAit is required
Frappe thatJava
you Script
update it in this file.
6. patches.txt is where migration patches are written. They are python module references using the dot
notation.
7. templates is the folder where web view templates are maintained. Templates for Login and other
standard pages are bootstrapped in frappe.
8. 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
9. pages is where single route templates are maintained. For example for a “/blog” type of page.
How to setup
Posted on March 15, 2018 by barewabar
You can
Create New Site
Posted on March 11, 2018 by barewabar
Assuming that you’ve already got your first site running and you’ve performed the production deployment steps,
this section explains how to host your second site (and more). Your first site is automatically set as default site.
You can change it with the command,
bench use sitename
Port based multitenancy
You can create a new site and make run it on a different port (while the first one runs on port 80).
Create a new site
bench new-site site2name
Set port
bench set-nginx-port site2name 82
Re generate nginx config
bench setup nginx
Reload nginx
sudo service nginx reload
DNS based multitenancy
code.fwrat.com/category/frappe/ 4/7
10/23/2020 Frappe – Programming and Coding Tutorials
You can name your sites as the hostnames
Home HTML thatCSS
would resolve
PHP toPython
it. Thus, all SQL
the sitesJAVA
you add to the benchJava Script
Frappe
would run on the same port and will be automatically selected based on the hostname.
DNS based multitenancy mode is disabled by default, you can switch it on / off using the command,
bench config dns_multitenant on
To make a new site under DNS based multitenancy, perform the following steps.
Create a new site
bench new-site site2name
Re generate nginx config
bench setup nginx
Reload nginx
sudo service nginx reload
Note : For “DNS based multitenancy”, currentsite.txt in frappe-bench/sites/ should be empty.
Source: https://github.com/frappe/bench/wiki/Multitenant-Setup
Installation
Posted on March 11, 2018 by barewabar
Here are steps to install frappe
Resources
Posted on March 11, 2018 by barewabar
https://frappe.io/docs/user/en/bench/resources/bench-commands-cheatsheet
https://github.com/frappe/bench/wiki/Quick-Reference-Guide
https://github.com/frappe/bench/wiki/Quick-Reference-Guide
https://frappe.io/docs/user/en/bench/resources
Back Up SIte with all files: bench –site all backup –with-files
code.fwrat.com/category/frappe/ 5/7
10/23/2020 Frappe – Programming and Coding Tutorials
Home HTML CSS PHP Python SQL JAVA Frappe Java Script
Show current tasks of Ubuntu: netstat -punta |grep nginx |wc -l
MYSQL:
mysql -u root -p
Database:
select * from `tabPayment Entry` where base_total_allocated_amount=24;
Frappe and site:
bench version, gives you the verison of the bench and frappe and erpnext etc
bench drop-site [sitename] This will remove the site folder and the database as well.
Install cusjtom frappe apps by fra: bench get-app meeting https://github.com/frappe/meeting
https://frappe.io/docs/user/en/bench/resources
Cache
1. bench clear-cache
2. bench clear-website-cache …You can run these from your frappe-bench folder.
How to manage processes from the Ubuntu Linux terminal
The ps command is a traditional Ubuntu Linux command to lists running processes. The following command
shows all processes running on your system:
{vivek@ubuntu-box:~}$ ps -aux
{vivek@ubuntu-box:~}$ sudo ps -a
{vivek@ubuntu-box:~}$ sudo ps -U vivek
{vivek@ubuntu-box:~}$ ps -U tom
code.fwrat.com/category/frappe/ 6/7
10/23/2020 Frappe – Programming and Coding Tutorials
https://www.cyberciti.biz/faq/how-to-check-running-process-in-ubuntu-linux-using-command-line/
Home HTML CSS PHP Python SQL JAVA Frappe Java Script
Frappe Tutorial
Advance
Frappe Workflow
Frappe Codes
Frappe Create New Site
Frappe Installation
Frappe Resources
App
Frappe Make a New App
Basic
Frappe Scheduler
Frappe Site backup
Frappe How to setup
Designed by Fwrat.com
code.fwrat.com/category/frappe/ 7/7