Since that we have successfully installed Masonite, we are ready to proceed further with authentication scaffolding. Masonite is offering this functionality out of the box.
python craft auth
In order to take this effect we must add
from masonite.routes import Route from masonite.authentication import Auth ROUTES = [Route.get("/", "WelcomeController@show"), Auth.routes() ]
Now, we can visit
Let's prepare the DB in order to run the migrations. I use mysql DB so we need to install the following package for this connection.
pip install pymysql
Now let's create a new DB with name
masonite. I am using Tableplus for Mac.
Now let's finish the configuration in
.env for Masonite connection to Mysql.
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=masonite DB_USERNAME=root DB_PASSWORD=password DB_LOG=True
Now everything is ready to run migration and create user table in mysql.
python craft migrate
That's it! We are ready to register in our application!