-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Turning a Mac into a Frappe Framework Developer Machine
This short instruction explains how to get your Mac OS X machine to be a development platform for Frappe and ERPNext as well as showing how to install Frappe in Developer Mode.
Attention, this gives you more control about what is happening but is harder than the installer. However this is setting up a development framework rather than a quick test of frappe framework. So if you want to try out ERPNext development maybe consider the vagrantfile or the automated setup, if you want a real development machine, consider this tutorial. You are highly recommended to start with a fresh machine here unless you are a mac wizz in which case you won't need this instruction to begin with.
This works best with a clean setup / install.
Any development on a Mac starts with a Homebrew install.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
(check the brew.sh homepage for the latest script). Homebrew will also install XCode Command Line Tools
. If you are unable to install it via the homebrew script, you can download command line tools from the Apple Developer Website
https://developer.apple.com/download/more/
MacOS (upto 10.4) comes with Python 2 as the default, so its best to install Python 3, which is the latest and greatest python
brew install python3
Frappe requires MariaDB as the default database backend and Redis for caching.
brew install mariadb redis
Start MySQL by
mysql.server start
Setup your default MariaDB passwords using the mysql_secure_installation
utility. Just follow the prompts to set your default root password
mysql_secure_installation
Frappe (version 11) uses Node v10 so you can manage your node installs using the awesome Node Version Manager (nvm)
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
Then install Node v10
nvm install v10
mkdir frappe
cd frappe
git clone https://github.com/frappe/bench bench-repo
Create a virtual environment for Bench (Python 3) so that it does not interfere with the default Python install that comes with MacOS
virtualenv bench-env --python /usr/local/bin/python3
source bench-env/bin/activate
Note: You will have to activate
bench-env
everytime you want to use thebench
command.
Install bench in the environment:
pip install -e bench-repo
bench init frappe-bench --python /usr/local/bin/python3
cd frappe-bench
bench get-app erpnext https://github.com/frappe/erpnext.git
please add:
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
[mysql]
default-character-set = utf8mb4
Start Bench on a terminal with:
bench start
If all goes well, open another Terminal tab and create a new site.
bench new-site site1.local`
Update the site to your /etc/hosts
so you can run it locally. Add the following line to your /etc/hosts
127.0.0.1 site1.local
bench install-app erpnext
Add "developer_mode": 1
in your sites/site1.local/site_config.json
like this, the rest stays:
{
"db_name": "1bd3e0294d",
"db_password": "jfhgsdfjgh35h34j",
"developer_mode": 1
}
bench update
Navigate to URL: http://site1.local:8000/#login
Custom Footer Page