The Masonite Framework is a modern and developer-centric Python web framework. This framework works hard to be fast and easy from install to deployment so developers can go from concept to creation as quickly and efficiently as possible.
In this tutorial, I will show you how to install masonite 3.0 and set up a masonite project on a Windows computer
This tutorial assumes that you understand the basics of python and pip commands
- Python 3.6+
- The latest version of OpenSSL
How to install masonite
The first thing to do is to open your command prompt and navigate to the directory where you want to get it installed.
Once in this folder, create a new folder for your masonite project. and change directory to it
One optional step you can go through is activating your virtual environment. You can use a virtual environment if you don’t want to install all of masonite’s dependencies on your systems Python.
python -m venv venv
Now we can install Masonite using the pip command. This will give us access to masonite’s
craft command which we can use to finish the install steps for us. you can do so by running:
pip install masonite
Once Masonite installs you will now have access to the
craft command-line tool. The craft command will become your best friend during your development.
You can ensure Masonite and craft installed correctly by running:
You should see a list of a few commands like
Creating our Project
From the commands you saw above, we will be using
newcommand to create our project. To create a new project just run:
This will also run
craft install which will install our dependencies.
This will get the latest Masonite project template and unzip it for you. We just need to go into our new project directory and install the dependencies in our
Now that Masonite has been successful installed, there will be more commands available in the
craft . You can check it out by running
Running The Server
Our setup is now complete, all that is left to do is to run our server and view our new masonite-powered Website in the Browser. So we get that done by running:
The command will get everything ready for us and provide an address that we can use to view our new website in the browser.
When coming your address in command prompt, do not use
CTR + cas it will stop the server that is currently running. Instead, highlight, right click, and copy the address.
That is it, you have set up your first website with masonite. Feel free to add your comments for further discussion.