The Masonite Framework is a modern and developer-centric Python web framework. This framework works hard to be fast and easy from installation 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
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
mkdir my_app cd my_app
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 .\venv\Scripts\activate
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 installation 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 are 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
new command 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 need to go into our new project directory and install the dependencies in our
Now that Masonite has been successfully installed, there will be more commands available in the craft. You can check it out by running
Our setup is 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 prepare everything for us and provide an address we can use to view our new website in the browser.
When coming to your address in the 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.