<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dilan Tsasi</title>
    <description>The latest articles on DEV Community by Dilan Tsasi (@dilantsasi).</description>
    <link>https://dev.to/dilantsasi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F183220%2Ff9d03de3-2b6b-4425-b863-6abfb1f03559.jpg</url>
      <title>DEV Community: Dilan Tsasi</title>
      <link>https://dev.to/dilantsasi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dilantsasi"/>
    <language>en</language>
    <item>
      <title>How to Install Bootstrap 5 in Masonite 3</title>
      <dc:creator>Dilan Tsasi</dc:creator>
      <pubDate>Fri, 28 Oct 2022 15:51:12 +0000</pubDate>
      <link>https://dev.to/dilantsasi/how-to-install-bootstrap-5-in-masonite-3-2d6b</link>
      <guid>https://dev.to/dilantsasi/how-to-install-bootstrap-5-in-masonite-3-2d6b</guid>
      <description>&lt;p&gt;In This tutorial, We Will learn how to install Boostrap 5 in Masonite 3.&lt;/p&gt;

&lt;p&gt;Masonite uses Laravel Mix, which provides an effortless way to handle asset compiling like SASS, LESS and more.&lt;/p&gt;

&lt;p&gt;You can begin by cloning or downloading and unzipping this demo project I created on Github. It is a simple bootstrap project that I created with masonite which contains the bootstrap classes, but it doesn't contain any bootstrap files.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--566lAguM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/DilanTsasi"&gt;
        DilanTsasi
      &lt;/a&gt; / &lt;a href="https://github.com/DilanTsasi/masonite-bootstrap-demo"&gt;
        masonite-bootstrap-demo
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A demo project with masonite 3 and Boostrap 4
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
masonite-bootstrap-demo&lt;/h1&gt;
&lt;p&gt;A demo project with masonite 3 and Boostrap 5&lt;/p&gt;
&lt;h2&gt;
Follow Me&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://twitter.com/dilantsasi" rel="nofollow"&gt;Twitter&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/DilanTsasi/masonite-bootstrap-demo"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;if you download and install the demo project above, run craft serve And you will see a page that looks like the one below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---J0bMJxj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6mz89k9j2pptgntnyfy7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---J0bMJxj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6mz89k9j2pptgntnyfy7.png" alt="masonite demo" width="880" height="414"&gt;&lt;/a&gt;&lt;br&gt;
In your Terminal, ensure you are in your project directory and run the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Installing Bootstrap css
&lt;/h2&gt;

&lt;p&gt;The command above will install everything you need to start compiling assets with masonite.&lt;br&gt;
Once installation is done, you will see a new folder in our application called &lt;code&gt;node_modules&lt;/code&gt;. This is where all assets that you include in your application through the package manager will live.&lt;br&gt;
You can just run the following command to install bootstrap in your application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install bootstrap
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the bootstrap is installed, you will find a new bootstrap folder in the node_modules folder. We can now go ahead to configure and use bootstrap in our application.&lt;/p&gt;

&lt;p&gt;Open up the &lt;code&gt;storage/static/sass/style.scss&lt;/code&gt; file in your application, and you will find some default code. You can choose to delete it or leave it the way it is. I will delete a huge code section and only leave the section that defines the default style on the application body. So my code will look like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$font-stack:    'Raleway', sans-serif;
$text-color: #636b6f;
$background-color: #fff;
html, body {
   background-color: $background-color;
   color: $text-color;
   font-family: $font-stack;
   font-weight: 100;
   height: 100vh;
   margin: 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At the top of the code above, I will add a new Line to install bootstrap. It will look something like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/* importing bootstrap */
@import '../../../node_modules/bootstrap/scss/bootstrap.scss';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Adding the Javascript.
&lt;/h2&gt;

&lt;p&gt;You Should only add the Javascript in case you need it. to add the Javascript, add the following line in your storage/static/js/app.js file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// importing boostrap JS
import "bootstrap";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Boostrap Javascript Depends on Popper Js so We will need to install popper js if we have to use Bootstrap JS., so all we will have to do is run the following command in our terminal&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i @popperjs/core
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After it Installs, we add it before the import bootstrap command in the app.js file. so the new file should look like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//importing popperjs
import "@popperjs/core";
// importing boostrap JS
import "bootstrap";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Head over to the webpack,mix.js file in the root folder, and make sure you find code that looks like the one below. If you don't find it, make sure to add it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mix.js('storage/static/js/app.js', 'storage/compiled/js')
  .sass('storage/static/sass/style.scss', 'storage/compiled/css');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once we compile our assets(Boostrap and any other library you wish to use), the code that will we added in &lt;code&gt;storage/static/js/app.js&lt;/code&gt; will be compiled and saved in &lt;code&gt;storage/compiled/js/app.js&lt;/code&gt; And that wich we added in &lt;code&gt;storage/static/sass/style.scss&lt;/code&gt; will be compiled and saved in &lt;code&gt;storage/compiled/css/style.css.&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Compiling Assets.
&lt;/h2&gt;

&lt;p&gt;To compile our assets, all we have to do is run the following command. it will build&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;after the command runs successfully, you will notice that it adds some lines of code in the following files&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;storage\compiled\css\style.css
storage\compiled\js\app.js.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;in our resources\templates\app\base.html file, we can make changes so that our new HTML file is loaded. so change the following line in your code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;link href="/static/style.css" rel="stylesheet" type="text/css"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;link href="/compiled/css/style.css" rel="stylesheet" type="text/css"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bootstrap is now installed, configured, and ready to use. So if we run craft serve and head to our browser, we should see something like what we have below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_bIBPYhk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2downi9lnto0k2bd2edh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_bIBPYhk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2downi9lnto0k2bd2edh.png" alt="masonite and bootstrap demo" width="880" height="414"&gt;&lt;/a&gt;&lt;br&gt;
You will notice that we haven’t added Javascript because our application does not need Javascript.&lt;/p&gt;

&lt;p&gt;That is it. We have learned how to install bootstrap 5 in our masonite project. You can go ahead to try things like compiling out assets to direct subfolders or files in the storage folder or even installing and using other frameworks.&lt;/p&gt;

</description>
      <category>python</category>
      <category>masonite</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to install Masonite On Windows</title>
      <dc:creator>Dilan Tsasi</dc:creator>
      <pubDate>Fri, 28 Oct 2022 15:27:35 +0000</pubDate>
      <link>https://dev.to/dilantsasi/how-to-install-masonite-on-windows-2llj</link>
      <guid>https://dev.to/dilantsasi/how-to-install-masonite-on-windows-2llj</guid>
      <description>&lt;p&gt;The &lt;a href="https://masoniteproject.com/"&gt;Masonite&lt;/a&gt; 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.&lt;/p&gt;

&lt;p&gt;In this tutorial, I will show you how to install masonite 3.0 and set up a masonite project on a Windows computer&lt;br&gt;
This tutorial assumes that you understand the basics of python and pip commands&lt;/p&gt;
&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Python 3.6+&lt;/li&gt;
&lt;li&gt;The latest version of OpenSSL&lt;/li&gt;
&lt;li&gt;Pip3&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  How to install masonite
&lt;/h2&gt;

&lt;p&gt;The first thing to do is to open your command prompt and navigate to the directory where you want to get it installed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd c:\my\masonite\directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once in this folder, create a new folder for your masonite project. and change directory to it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir my_app
cd my_app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;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.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python -m venv venv
.\venv\Scripts\activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Installing Masonite
&lt;/h2&gt;

&lt;p&gt;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:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install masonite
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once Masonite installs you will now have access to the &lt;code&gt;craft&lt;/code&gt; command-line tool. The craft command will become your best friend during your development.&lt;/p&gt;

&lt;p&gt;You can ensure Masonite and craft are installed correctly by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;craft
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see a list of a few commands like &lt;code&gt;install&lt;/code&gt; and &lt;code&gt;new&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Creating our Project&lt;br&gt;
From the commands you saw above, we will be using &lt;code&gt;new&lt;/code&gt; command to create our project. To create a new project, just run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;craft new
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will also run &lt;code&gt;craft install&lt;/code&gt; which will install our dependencies.&lt;/p&gt;

&lt;p&gt;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 &lt;code&gt;requirements.txt&lt;/code&gt; file&lt;/p&gt;

&lt;p&gt;Now that Masonite has been successfully installed, there will be more commands available in the craft. You can check it out by running&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;craft
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Running The Server
&lt;/h2&gt;

&lt;p&gt;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:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;craft serve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The command will prepare everything for us and provide an address we can use to view our new website in the browser.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note!&lt;/strong&gt;&lt;br&gt;
When coming to your address in the command prompt, do not use &lt;code&gt;CTR + c&lt;/code&gt; as it will stop the server that is currently running. Instead, highlight, right-click, and copy the address.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wiu3C_nX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i3dejtbuor3ocudsb6bp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wiu3C_nX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i3dejtbuor3ocudsb6bp.png" alt="masonite demo project" width="880" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That is it. You have set up your first website with masonite. Feel free to add your comments for further discussion.&lt;/p&gt;

</description>
      <category>python</category>
      <category>masonite</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
