Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Dilan Tsasi
Dilan Tsasi

Posted on

     

How to install Masonite On Windows

TheMasonite 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

Requirements

  1. Python 3.6+
  2. The latest version of OpenSSL
  3. Pip3

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.

cd c:\my\masonite\directory
Enter fullscreen modeExit fullscreen mode

Once in this folder, create a new folder for your masonite project. and change directory to it

mkdir my_appcd my_app
Enter fullscreen modeExit fullscreen mode

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
Enter fullscreen modeExit fullscreen mode

Installing Masonite

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
Enter fullscreen modeExit fullscreen mode

Once Masonite installs you will now have access to thecraft 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:

craft
Enter fullscreen modeExit fullscreen mode

You should see a list of a few commands likeinstall andnew

Creating our Project
From the commands you saw above, we will be usingnew command to create our project. To create a new project, just run:

craft new
Enter fullscreen modeExit fullscreen mode

This will also runcraft 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 ourrequirements.txt file

Now that Masonite has been successfully installed, there will be more commands available in the craft. You can check it out by running

craft
Enter fullscreen modeExit fullscreen mode

Running The Server

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:

craft serve
Enter fullscreen modeExit fullscreen mode

The command will prepare everything for us and provide an address we can use to view our new website in the browser.

Note!
When coming to your address in the command prompt, do not useCTR + c as it will stop the server that is currently running. Instead, highlight, right-click, and copy the address.

masonite demo project

That is it. You have set up your first website with masonite. Feel free to add your comments for further discussion.

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Computer Programmer, Web Developer
  • Location
    Bamenda
  • Work
    Computer Programmer
  • Joined

More fromDilan Tsasi

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp