We will be setting up a Masonite development environment on Ubuntu. We’ll use Ubuntu because on ubuntu (or UNIX*) your development environment will match your production server.
Python is a widely used general-purpose, high level programming language. There are two major Python versions:
Python 2 and
Python 3. In this tutorial, we’ll use
Python 3.7 because Masonite requires
Python 3.4 and above. You can install any version greater than 3.4.
sudo apt update sudo apt install python3.7
pip is a package manager for
Python. The main goal of pip is automated dependency management.
sudo apt install python3-pip
Virutalenv is a tool to create isolated Python environments.
pip to install
virtualenv and its dependencies:
pip3 install virtualenv
virtualenv in a bash. If you have nothing as errors, you are ready for the next steps.
python-dev which is the package that contains the header files for the
Python C API for high performance. This package is part of the
OpenSSL project’s implementation of the
TLS cryptographic protocols for secure communication over the Internet.
sudo apt-get install python3.6-dev libssl-dev
Create a new folder and a virtual environment
mkdir helloworld cd helloworld virtualenv --python=python3.7 venv source venv/bin/activate
pip install masonite
Creating new project
craft new helloworld . # Don't forget the dot at the end of this line. craft serve
You can now visit http://localhost:8000 to view your new website!