<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:media="http://search.yahoo.com/mrss/" >

<channel>
	<title>Fundamentals &#8211; Dakidarts® Hub</title>
	<atom:link href="https://hub.dakidarts.com/tag/fundamentals/feed/" rel="self" type="application/rss+xml" />
	<link>https://hub.dakidarts.com</link>
	<description>Where creativity meets innovation.</description>
	<lastBuildDate>Thu, 10 Oct 2024 09:39:51 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://cdn.dakidarts.com/image/dakidarts-dws.svg</url>
	<title>Fundamentals &#8211; Dakidarts® Hub</title>
	<link>https://hub.dakidarts.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Mastering Graphic Design: The 6 Essential Fundamentals</title>
		<link>https://hub.dakidarts.com/mastering-graphic-design-the-6-essential-fundamentals/</link>
					<comments>https://hub.dakidarts.com/mastering-graphic-design-the-6-essential-fundamentals/#respond</comments>
		
		<dc:creator><![CDATA[Dakidarts]]></dc:creator>
		<pubDate>Fri, 30 Aug 2024 08:59:31 +0000</pubDate>
				<category><![CDATA[Graphics Design ✍️]]></category>
		<category><![CDATA[Digital Marketing 📈]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Fundamentals]]></category>
		<category><![CDATA[Graphic]]></category>
		<category><![CDATA[Introduction]]></category>
		<guid isPermaLink="false">https://hub.dakidarts.com/?p=6856</guid>

					<description><![CDATA[Graphic design is the art of visual communication, blending creativity with strategic thinking to convey messages effectively.]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img  decoding="async"  src="https://res.cloudinary.com/ds64xs2lp/image/upload/v1725005791/Introduction_to_Graphic_Design-_The_4_Design_Fundamentals_rc9afz.jpg"  alt="Introduction to Graphic Design: The 4 Design Fundamentals"  title="Mastering Graphic Design: The 6 Essential Fundamentals" ><figcaption>Mastering Graphic Design: The 6 Essential Fundamentals</figcaption></figure>





<p class="wp-block-paragraph">Graphic design is extra than simply creating visually interesting content material; it is about successfully speaking concepts via design. Understanding the core rules of design is essential for each novice and skilled designers. These rules—distinction, alignment, repetition, and proximity—type the inspiration of compelling and impactful designs. On this article, we&#8217;ll delve into these 4 design fundamentals, explaining their significance and how one can apply them to raise your design tasks.</p>



<p class="wp-block-paragraph">On this complete information, we&#8217;ll discover six important design fundamentals:</p>



<ol class="wp-block-list">
<li>Stability</li>



<li>Distinction</li>



<li>Emphasis</li>



<li>Unity</li>



<li>Alignment</li>



<li>Proximity</li>
</ol>



<p class="wp-block-paragraph">By mastering these rules, you may be well-equipped to create compelling, efficient, and visually beautiful designs.</p>



<h2 id="1-stability-the-basis-of-concord" class="wp-block-heading">1. Stability: The Basis of Concord</h2>



<p class="wp-block-paragraph">Stability in graphic design refers back to the distribution of visible weight inside a composition. It is about creating a way of equilibrium that feels proper to the viewer.</p>



<h3 id="varieties-of-stability" class="wp-block-heading">Varieties of Stability:</h3>



<ul class="wp-block-list">
<li><strong>Symmetrical Stability</strong>: Achieved when parts are mirrored on both facet of a central axis.</li>



<li><strong>Asymmetrical Stability</strong>: Created through the use of unequal visible parts that also obtain equilibrium.</li>



<li><strong>Radial Stability</strong>: Organized round a central level, like spokes on a wheel.</li>
</ul>



<p class="wp-block-paragraph"><strong>Instance</strong>: Take into account the FedEx brand. The steadiness between the optimistic and destructive house creates a hidden arrow, demonstrating each symmetrical steadiness within the letterforms and asymmetrical steadiness within the total design.</p>



<figure class="wp-block-image size-large"><img  decoding="async"  src="https://res.cloudinary.com/ds64xs2lp/image/upload/v1725007026/Balance-in-Graphics-Design_sggaht.jpg"  alt="Balance in Graphics Design"  title="Mastering Graphic Design: The 6 Essential Fundamentals" ><figcaption>Mastering Graphic Design: The 6 Essential Fundamentals</figcaption></figure>



<p class="wp-block-paragraph"><strong>Sensible Tip</strong>: When designing, strive the squint take a look at. Blur your imaginative and prescient barely and observe if any space of your design feels heavier than others. Regulate parts till you obtain a delightful equilibrium.</p>



<h2 id="2-distinction-the-energy-of-distinction" class="wp-block-heading">2. Distinction: The Energy of Distinction</h2>



<p class="wp-block-paragraph">Distinction is the juxtaposition of opposing parts to create visible curiosity and information the viewer&#8217;s consideration. It isn&#8217;t nearly making parts stand out; it is about highlighting variations to speak successfully.</p>



<h3 id="parts-of-distinction" class="wp-block-heading">Parts of Distinction:</h3>



<ul class="wp-block-list">
<li>Coloration</li>



<li>Dimension</li>



<li>Form</li>



<li>Texture</li>



<li>Typography</li>
</ul>



<p class="wp-block-paragraph"><strong>Instance</strong>: Apple&#8217;s product pages typically use stark distinction between their glossy, often light-colored merchandise and darkish backgrounds. This not solely makes the merchandise pop but in addition conveys a way of sophistication and modernity.</p>



<p class="wp-block-paragraph">In one other instance, think about a poster for a music competition. By utilizing a darkish background and vibrant, daring textual content, you create a distinction that makes the occasion particulars pop. This ensures that the knowledge isn&#8217;t just readable, but in addition memorable.</p>



<figure class="wp-block-image size-large"><img  decoding="async"  src="https://res.cloudinary.com/ds64xs2lp/image/upload/v1725007024/Contrast-In-Graphics-Design_m2nesa.jpg"  alt="Mastering Graphic Design: The 6 Essential Fundamentals"  title="Mastering Graphic Design: The 6 Essential Fundamentals" ><figcaption>Mastering Graphic Design: The 6 Essential Fundamentals</figcaption></figure>



<p class="wp-block-paragraph"><strong>Sensible Tip</strong>: Use distinction to spotlight key info. In net design, guarantee enough distinction between textual content and background colours for readability, particularly for calls-to-action (CTAs).</p>



<h2 id="3-emphasis-guiding-the-eye" class="wp-block-heading">3. Emphasis: Guiding the Eye</h2>



<p class="wp-block-paragraph">Emphasis, often known as hierarchy, is about directing the viewer&#8217;s consideration to an important parts of your design.</p>



<h3 id="strategies-for-creating-emphasis" class="wp-block-heading">Strategies for Creating Emphasis:</h3>



<ul class="wp-block-list">
<li>Dimension variation</li>



<li>Coloration distinction</li>



<li>Placement</li>



<li>White house</li>



<li>Repetition</li>
</ul>



<p class="wp-block-paragraph"><strong>Instance</strong>: Journal covers are masters of emphasis. The principle headline is often the most important textual content, typically in a contrasting colour. Supporting textual content is smaller, guiding the reader&#8217;s eye in a deliberate sequence.</p>



<figure class="wp-block-image size-large"><img  decoding="async"  src="https://res.cloudinary.com/ds64xs2lp/image/upload/v1725007927/Emphasis-in-Graphics-Design_qqoq7a.jpg"  alt="Emphasis in Graphics Design"  title="Mastering Graphic Design: The 6 Essential Fundamentals" ><figcaption>Mastering Graphic Design: The 6 Essential Fundamentals</figcaption></figure>



<p class="wp-block-paragraph"><strong>Sensible Tip</strong>: In net design, use the F-pattern or Z-pattern to position necessary parts the place customers are more than likely to look first.</p>



<h2 id="4-unity-bringing-it-all-collectively" class="wp-block-heading">4. Unity: Bringing It All Collectively</h2>



<p class="wp-block-paragraph">Unity ensures that every one parts in a design work collectively cohesively, creating a way of completeness.</p>



<h3 id="rules-for-attaining-unity" class="wp-block-heading">Rules for Attaining Unity:</h3>



<ul class="wp-block-list">
<li>Proximity</li>



<li>Alignment</li>



<li>Repetition</li>



<li>Consistency</li>
</ul>



<p class="wp-block-paragraph"><strong>Instance</strong>: Airbnb&#8217;s web site and app exhibit unity via constant use of their model colours, typography, and rounded shapes throughout all platforms and advertising and marketing supplies.</p>



<figure class="wp-block-image size-large"><img  decoding="async"  src="https://res.cloudinary.com/ds64xs2lp/image/upload/v1725007930/Unity-in-Graphics-Design_eaxgpr.jpg"  alt="Unity in Graphics Design"  title="Mastering Graphic Design: The 6 Essential Fundamentals" ><figcaption>Mastering Graphic Design: The 6 Essential Fundamentals</figcaption></figure>



<p class="wp-block-paragraph"><strong>Sensible Tip</strong>: Create a mode information in your tasks to keep up consistency in colours, fonts, and graphic parts throughout all design items.</p>



<h2 id="5-alignment-creating-order-and-group" class="wp-block-heading">5. Alignment: Creating Order and Group</h2>



<p class="wp-block-paragraph">Alignment refers back to the association of parts in a design to create a cohesive visible connection. Correct alignment ensures that nothing in your design feels misplaced. It brings order to your layouts, making them simpler to navigate and extra aesthetically pleasing.</p>



<p class="wp-block-paragraph"><strong>Instance</strong>: Think about a web site&#8217;s homepage the place the textual content, pictures, and buttons are completely aligned. This not solely improves the consumer expertise but in addition conveys a way of professionalism and a spotlight to element.</p>



<p class="wp-block-paragraph"><strong>Sensible Tip</strong>: Use grid techniques in your designs to keep up constant alignment throughout completely different parts. This creates a clear, organized look that is pleasing to the attention.</p>



<h2 id="6-proximity-organizing-parts-for-readability" class="wp-block-heading">6. Proximity: Organizing Parts for Readability</h2>



<p class="wp-block-paragraph">Proximity is all about grouping associated gadgets collectively to create a relationship between them. It helps in organizing info, making it simpler for the viewer to know the content material. Correct use of proximity could make complicated info extra digestible and improve the general readability of the design.</p>



<p class="wp-block-paragraph"><strong>Instance</strong>: In an infographic about wholesome consuming, grouping associated meals (like fruits in a single part and greens in one other) helps the viewer shortly and simply perceive the content material.</p>



<p class="wp-block-paragraph"><strong>Sensible Tip</strong>: Use white house successfully to create clear distinctions between completely different teams of parts. This helps in creating a visible hierarchy and improves the general readability of your design.</p>



<h2 id="placing-it-all-collectively-the-synergy-of-the-six-fundamentals" class="wp-block-heading">Placing It All Collectively: The Synergy of the Six Fundamentals</h2>



<p class="wp-block-paragraph">Whereas every precept is highly effective by itself, the magic occurs once they work in live performance. Let&#8217;s discover a case research to see how these fundamentals come collectively in real-world design.</p>



<h3 id="case-examine-the-nike-air-jordan-emblem" class="wp-block-heading">Case Examine: The Nike Air Jordan Emblem</h3>



<p class="wp-block-paragraph">The enduring Air Jordan &#8220;Jumpman&#8221; brand is a masterclass in making use of a number of design fundamentals:</p>



<ol class="wp-block-list">
<li><strong>Stability</strong>: The silhouette creates a dynamic asymmetrical steadiness, capturing movement whereas sustaining stability.</li>



<li><strong>Distinction</strong>: The strong, easy form contrasts sharply with any background, making certain on the spot recognition.</li>



<li><strong>Emphasis</strong>: The distinctive pose of the determine instantly attracts the attention, making it the clear focus.</li>



<li><strong>Unity</strong>: The simplicity of the design permits it for use persistently throughout varied mediums, from footwear to attire to promoting.</li>



<li><strong>Alignment</strong>: The determine is fastidiously aligned to create a way of motion and course.</li>



<li><strong>Proximity</strong>: The compact nature of the emblem retains all parts in proximity, making a cohesive unit.</li>
</ol>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-large"><img  decoding="async"  src="https://res.cloudinary.com/ds64xs2lp/image/upload/v1725008680/Nike-Jumpman-logo_awinwa.jpg"  alt="Mastering Graphic Design: The 6 Essential Fundamentals"  title="Mastering Graphic Design: The 6 Essential Fundamentals" ><figcaption>Mastering Graphic Design: The 6 Essential Fundamentals</figcaption></figure>



<p class="wp-block-paragraph">This brand&#8217;s enduring success demonstrates how efficient utility of design fundamentals can create a timeless and versatile model asset.</p>



<h2 id="conclusion-your-journey-in-graphic-design" class="wp-block-heading">Conclusion: Your Journey in Graphic Design</h2>



<p class="wp-block-paragraph">Understanding these six elementary rules of graphic design—steadiness, distinction, emphasis, unity, alignment, and proximity—gives a strong basis for creating visually compelling and efficient designs. As you progress in your design journey, keep in mind that these rules aren&#8217;t inflexible guidelines however versatile pointers. The artwork of nice design lies in realizing when to stick to those rules and when to creatively break them for affect.</p>



<p class="wp-block-paragraph">At all times think about how one can apply these fundamentals to boost your message and interact your viewers. With observe and experimentation, you may develop an intuitive sense of find out how to use these rules to create designs that not solely look good, but in addition talk successfully.</p>



<p class="wp-block-paragraph">Keep in mind, graphic design is a strong software for visible communication. By mastering these fundamentals, you are effectively in your method to creating designs that inform, encourage, and depart a long-lasting impression. Nice design isn&#8217;t just about the way it seems to be—it is about the way it works and the way successfully it communicates its meant message.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://hub.dakidarts.com/mastering-graphic-design-the-6-essential-fundamentals/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<media:content url="https://i3.wp.com/res.cloudinary.com/ds64xs2lp/image/upload/v1725005791/Introduction_to_Graphic_Design-_The_4_Design_Fundamentals_rc9afz.jpg?ssl=1" medium="image"></media:content>
            	</item>
		<item>
		<title>Python for Web Development: Flask Framework Fundamentals</title>
		<link>https://hub.dakidarts.com/python-for-web-development-flask-framework-fundamentals/</link>
					<comments>https://hub.dakidarts.com/python-for-web-development-flask-framework-fundamentals/#respond</comments>
		
		<dc:creator><![CDATA[Dakidarts]]></dc:creator>
		<pubDate>Fri, 16 Aug 2024 08:41:21 +0000</pubDate>
				<category><![CDATA[Python 🪄]]></category>
		<category><![CDATA[Flask]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[Fundamentals]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Web Development]]></category>
		<guid isPermaLink="false">https://hub.dakidarts.com/?p=5466</guid>

					<description><![CDATA[Learn Python web development with Flask. This comprehensive guide covers Flask fundamentals, routing, templates, and database integration. Perfect for beginners building their first web application.]]></description>
										<content:encoded><![CDATA[
<div class="automaticx-video-container"><iframe src="https://www.youtube.com/embed/Z1RJmh_OqeA" width="100%" height="380" frameborder="0" allowfullscreen="allowfullscreen"></iframe></div>



<h2 class="wp-block-heading" id="unleashing-the-power-of-flask-an-introduction-to-python-web-development"><span id=""></span></h2>



<p class="wp-block-paragraph">Flask is a lightweight and flexible Python web framework that&#8217;s perfect for beginners and seasoned developers alike. In this tutorial, we&#8217;ll explore the fundamentals of Flask and build a simple web application from scratch. By the end, you&#8217;ll have a solid foundation in Flask web development.</p>



<h2 id="prerequisites" class="wp-block-heading">Prerequisites</h2>



<p class="wp-block-paragraph">Before we begin, make sure you have:</p>



<ul class="wp-block-list">
<li><a href="https://www.python.org/downloads/" target="_blank" rel="noreferrer noopener nofollow">Python 3.x installed</a></li>



<li>Basic knowledge of Python</li>



<li>A text editor or IDE of your choice</li>
</ul>



<h2 id="step-1-setting-up-your-environment" class="wp-block-heading">Step 1: Setting Up Your Environment</h2>



<p class="wp-block-paragraph">First, let&#8217;s create a virtual environment and install Flask:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># Create a new directory for your project
mkdir flask_tutorial
cd flask_tutorial

# Create and activate a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows, use `venv\Scripts\activate`

# Install Flask
pip install flask</pre>



<h2 id="step-2-creating-your-first-flask-application" class="wp-block-heading">Step 2: Creating Your First Flask Application</h2>



<p class="wp-block-paragraph">Let&#8217;s create a simple &#8220;Hello, World!&#8221; application. Create a new file called <code data-enlighter-language="generic" class="EnlighterJSRAW">app.py</code>:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="python" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">from flask import Flask

app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello, World!'

if __name__ == '__main__':
    app.run(debug=True)</pre>



<p class="wp-block-paragraph">Run your application:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">python app.py</pre>



<p class="wp-block-paragraph">Visit <code data-enlighter-language="bash" class="EnlighterJSRAW">http://127.0.0.1:5000/</code> in your browser, and you should see &#8220;Hello, World!&#8221;.</p>



<h2 id="step-3-understanding-routing" class="wp-block-heading">Step 3: Understanding Routing</h2>



<p class="wp-block-paragraph">Flask uses decorators to define routes. Let&#8217;s add more routes to our application:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="python" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">from flask import Flask

app = Flask(__name__)

@app.route('/')
def home():
    return 'Welcome to the Flask Tutorial!'

@app.route('/about')
def about():
    return 'This is the about page.'

@app.route('/user/&lt;username>')
def show_user_profile(username):
    return f'User: {username}'

if __name__ == '__main__':
    app.run(debug=True)</pre>



<p class="wp-block-paragraph">Now you have three routes:</p>



<ul class="wp-block-list">
<li><code data-enlighter-language="generic" class="EnlighterJSRAW">/</code>: The home page</li>



<li><code data-enlighter-language="bash" class="EnlighterJSRAW">/about</code>: An about page</li>



<li><code data-enlighter-language="bash" class="EnlighterJSRAW">/user/&lt;username></code>: A dynamic route that accepts a username</li>
</ul>



<h2 id="step-4-working-with-templates" class="wp-block-heading">Step 4: Working with Templates</h2>



<p class="wp-block-paragraph">Instead of returning plain text, let&#8217;s use HTML templates. First, create a <code data-enlighter-language="generic" class="EnlighterJSRAW">templates</code> folder in your project directory.</p>



<p class="wp-block-paragraph">Create <code data-enlighter-language="bash" class="EnlighterJSRAW">templates/base.html</code>:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="html" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">&lt;!DOCTYPE html>
&lt;html lang="en">
&lt;head>
    &lt;meta charset="UTF-8">
    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0">
    &lt;title>{% block title %}Flask Tutorial{% endblock %}&lt;/title>
&lt;/head>
&lt;body>
    &lt;nav>
        &lt;a href="{{ url_for('home') }}">Home&lt;/a>
        &lt;a href="{{ url_for('about') }}">About&lt;/a>
    &lt;/nav>
    &lt;main>
        {% block content %}{% endblock %}
    &lt;/main>
&lt;/body>
&lt;/html></pre>



<p class="wp-block-paragraph">Create <code data-enlighter-language="bash" class="EnlighterJSRAW">templates/home.html</code>:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="html" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">{% extends "base.html" %}

{% block content %}
&lt;h1>Welcome to the Flask Tutorial!&lt;/h1>
&lt;p>This is the home page.&lt;/p>
{% endblock %}</pre>



<p class="wp-block-paragraph">Create <code data-enlighter-language="bash" class="EnlighterJSRAW">templates/about.html</code>:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="html" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">{% extends "base.html" %}

{% block title %}About - {{ super() }}{% endblock %}

{% block content %}
&lt;h1>About&lt;/h1>
&lt;p>This is the about page of our Flask tutorial.&lt;/p>
{% endblock %}</pre>



<p class="wp-block-paragraph">Now, update <code data-enlighter-language="generic" class="EnlighterJSRAW">app.py</code> to use these templates:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="python" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">from flask import Flask, render_template

app = Flask(__name__)

@app.route('/')
def home():
    return render_template('home.html')

@app.route('/about')
def about():
    return render_template('about.html')

@app.route('/user/&lt;username>')
def show_user_profile(username):
    return render_template('user.html', username=username)

if __name__ == '__main__':
    app.run(debug=True)</pre>



<p class="wp-block-paragraph">Create <code data-enlighter-language="bash" class="EnlighterJSRAW">templates/user.html</code>:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="html" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">{% extends "base.html" %}

{% block title %}User: {{ username }} - {{ super() }}{% endblock %}

{% block content %}
&lt;h1>User Profile&lt;/h1>
&lt;p>Username: {{ username }}&lt;/p>
{% endblock %}</pre>



<h2 id="step-5-handling-forms" class="wp-block-heading">Step 5: Handling Forms</h2>



<p class="wp-block-paragraph">Let&#8217;s add a simple form to our application. Create <code data-enlighter-language="bash" class="EnlighterJSRAW">templates/form.html</code>:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="html" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">{% extends "base.html" %}

{% block title %}Form - {{ super() }}{% endblock %}

{% block content %}
&lt;h1>Sample Form&lt;/h1>
&lt;form method="POST">
    &lt;label for="name">Name:&lt;/label>
    &lt;input type="text" id="name" name="name" required>
    &lt;button type="submit">Submit&lt;/button>
&lt;/form>
{% if name %}
&lt;p>Hello, {{ name }}!&lt;/p>
{% endif %}
{% endblock %}</pre>



<p class="wp-block-paragraph">Update <code data-enlighter-language="generic" class="EnlighterJSRAW">app.py</code> to handle the form:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">from flask import Flask, render_template, request

app = Flask(__name__)

# ... (previous routes) ...

@app.route('/form', methods=['GET', 'POST'])
def form():
    name = None
    if request.method == 'POST':
        name = request.form['name']
    return render_template('form.html', name=name)

if __name__ == '__main__':
    app.run(debug=True)</pre>



<h2 id="step-6-database-integration" class="wp-block-heading">Step 6: Database Integration</h2>



<p class="wp-block-paragraph">For this example, we&#8217;ll use SQLite with SQLAlchemy. First, install the required packages:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">pip install flask-sqlalchemy</pre>



<p class="wp-block-paragraph">Update <code data-enlighter-language="generic" class="EnlighterJSRAW">app.py</code> to include database functionality:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="python" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">from flask import Flask, render_template, request, redirect, url_for
from flask_sqlalchemy import SQLAlchemy

app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///users.db'
db = SQLAlchemy(app)

class User(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    username = db.Column(db.String(80), unique=True, nullable=False)
    email = db.Column(db.String(120), unique=True, nullable=False)

    def __repr__(self):
        return f'&lt;User {self.username}>'

# Create the database tables
with app.app_context():
    db.create_all()

@app.route('/')
def home():
    users = User.query.all()
    return render_template('home.html', users=users)

@app.route('/add_user', methods=['GET', 'POST'])
def add_user():
    if request.method == 'POST':
        username = request.form['username']
        email = request.form['email']
        new_user = User(username=username, email=email)
        db.session.add(new_user)
        db.session.commit()
        return redirect(url_for('home'))
    return render_template('add_user.html')

# ... (other routes) ...

if __name__ == '__main__':
    app.run(debug=True)</pre>



<p class="wp-block-paragraph">Create <code data-enlighter-language="bash" class="EnlighterJSRAW">templates/add_user.html</code>:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="html" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">{% extends "base.html" %}

{% block title %}Add User - {{ super() }}{% endblock %}

{% block content %}
&lt;h1>Add User&lt;/h1>
&lt;form method="POST">
    &lt;label for="username">Username:&lt;/label>
    &lt;input type="text" id="username" name="username" required>
    &lt;label for="email">Email:&lt;/label>
    &lt;input type="email" id="email" name="email" required>
    &lt;button type="submit">Add User&lt;/button>
&lt;/form>
{% endblock %}</pre>



<p class="wp-block-paragraph">Update <code data-enlighter-language="bash" class="EnlighterJSRAW">templates/home.html</code> to display users:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="html" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">{% extends "base.html" %}

{% block content %}
&lt;h1>Welcome to the Flask Tutorial!&lt;/h1>
&lt;p>This is the home page.&lt;/p>
&lt;h2>Users:&lt;/h2>
&lt;ul>
    {% for user in users %}
    &lt;li>{{ user.username }} ({{ user.email }})&lt;/li>
    {% endfor %}
&lt;/ul>
&lt;a href="{{ url_for('add_user') }}">Add User&lt;/a>
{% endblock %}</pre>



<h2 id="conclusion" class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">Congratulations! You&#8217;ve now created a basic Flask web application with routing, templates, form handling, and database integration. This tutorial covered the fundamentals of Flask, but there&#8217;s much more to explore:</p>



<ul class="wp-block-list">
<li>User authentication and authorization</li>



<li>RESTful API development</li>



<li>Flask extensions for additional functionality</li>



<li>Deployment to production servers</li>
</ul>



<p class="wp-block-paragraph">As you continue your journey with Flask, remember to consult the official Flask documentation for more detailed information and advanced topics. Happy coding, and may your web development adventures with Flask be ever exciting!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://hub.dakidarts.com/python-for-web-development-flask-framework-fundamentals/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<media:content url="https://cdn.dakidarts.com/image/5466-python-for-web-development-flask-framework-fundamentals.jpg" medium="image"></media:content>
            <media:content url="https://www.youtube.com/embed/Z1RJmh_OqeA" medium="video">
			<media:player url="https://www.youtube.com/embed/Z1RJmh_OqeA" />
			<media:title type="plain">Read Insightful Fundamentals Articles - Dakidarts® Hub</media:title>
			<media:description type="html"><![CDATA[Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.]]></media:description>
			<media:thumbnail url="https://cdn.dakidarts.com/image/5466-python-for-web-development-flask-framework-fundamentals.jpg" />
			<media:rating scheme="urn:simple">nonadult</media:rating>
		</media:content>
	</item>
	</channel>
</rss>
