IDU-IFP / ifp-flask-study

📖 IFP's Flask Framework study repository
0 stars 6 forks source link

Ep03 : 블로그 웹 애플리케이션 개발(0) - 프로젝트 생성, 패키지 설치, 기본 작업 #3

Open TGoddessana opened 2 years ago

TGoddessana commented 2 years ago

Ep03에서는 본격적으로 블로그 웹 애플리케이션을 개발합니다.

(과제1) 결론적으로, 위의 실습을 마치고 나면 아래의 화면이 보여야 합니다. 애플리케이션을 실행하고, 아래와 같은 창이 나오도록 코드를 작성하여 스크린샷과 만드는 과정을 블로그에 정리한 후 링크를 제출해 주세요. 블로그에서 정적 파일을 다루는 방법을 설명했으므로, 이미지를 화면에 띄우는 것은 어려운 일이 아닐 것입니다. 디자인이나 이미지 등은 마음껏 바꾸어도 됩니다.

/blog/ 일 때:

스크린샷 2022-06-24 오후 10 50 54

/blog/about 일 때:

스크린샷 2022-06-24 오후 10 54 11

/blog/categories-list 일 때:

스크린샷 2022-06-24 오후 10 56 30

/blog/contact 일 때:

image

/auth/sign-up 일 때:

image

/auth/login 일 때:

스크린샷 2022-06-24 오후 10 58 51

로그인, 회원가입 폼 코드를 첨부해 두겠습니다.

{% extends 'base.html' %}

{% block title %}Login{% endblock %}

{% block header %}
    <header class="masthead" style="background-image: url('{{ url_for('static', filename='assets/img/login-bg.jpg') }}')">
        <div class="container position-relative px-4 px-lg-5">
            <div class="row gx-4 gx-lg-5 justify-content-center">
                <div class="col-md-10 col-lg-8 col-xl-7">
                    <div class="site-heading">
                        <h1>Login</h1>
                    </div>
                </div>
            </div>
        </div>
    </header>
{% endblock %}

{% block content %}

    <!-- Main Content-->
    <main class="mb-4">
        <div class="container px-4 px-lg-5">
            <div class="row gx-4 gx-lg-5 justify-content-center">
                <div class="col-md-10 col-lg-8 col-xl-7">
                    <div class="my-5">
                        <form id="contactForm" method="POST">
                            <div class="form-floating">
                                <input class="form-control" id="email" type="text" placeholder="Enter your email..." name="email"
                                       data-sb-validations="required"/>
                                <label for="email">Email</label>
                                <div class="invalid-feedback" data-sb-feedback="email:required">A Email is required.</div>
                            </div>
                            <div class="form-floating">
                                <input class="form-control" id="password" type="password" placeholder="Enter your password..." name="password"
                                       data-sb-validations="required,email"/>
                                <label for="password">Password</label>
                                <div class="invalid-feedback" data-sb-feedback="password:required">An password is required.
                                </div>
                                <div class="invalid-feedback" data-sb-feedback="password:required">Email is not valid.</div>
                            </div>
                            <br/>
                            <!-- Submit success message-->
                            <!---->
                            <!-- This is what your users will see when the form-->
                            <!-- has successfully submitted-->
{#                            <div class="d-none" id="submitSuccessMessage">#}
{#                                <div class="text-center mb-3">#}
{#                                    <div class="fw-bolder">Form submission successful!</div>#}
{#                                    To activate this form, sign up at#}
{#                                    <br/>#}
{#                                    <a href="https://startbootstrap.com/solution/contact-forms">https://startbootstrap.com/solution/contact-forms</a>#}
{#                                </div>#}
{#                            </div>#}
                            <!-- Submit error message-->
                            <!---->
                            <!-- This is what your users will see when there is-->
                            <!-- an error submitting the form-->
{#                            <div class="d-none" id="submitErrorMessage">#}
{#                                <div class="text-center text-danger mb-3">Error sending message!</div>#}
{#                            </div>#}
                            <!-- Submit Button-->
                            <button class="btn btn-primary text-uppercase" id="submitButton" type="submit">
                                LOGIN
                            </button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </main>

{% endblock %}

회원가입 코드

{% extends 'base.html' %}

{% block title %}Signup{% endblock %}

{% block header %}
    <header class="masthead" style="background-image: url('{{ url_for('static', filename='assets/img/signup-bg.jpg') }}')">
        <div class="container position-relative px-4 px-lg-5">
            <div class="row gx-4 gx-lg-5 justify-content-center">
                <div class="col-md-10 col-lg-8 col-xl-7">
                    <div class="site-heading">
                        <h1>Sign Up</h1>
                    </div>
                </div>
            </div>
        </div>
    </header>
{% endblock %}

{% block content %}

    <!-- Main Content-->
    <main class="mb-4">
        <div class="container px-4 px-lg-5">
            <div class="row gx-4 gx-lg-5 justify-content-center">
                <div class="col-md-10 col-lg-8 col-xl-7">
                    <div class="my-5">
                        <form id="contactForm" method="POST">
                            <div class="form-floating">
                                <input class="form-control" id="email" type="text" placeholder="Enter your email..." name="email"
                                       data-sb-validations="required"/>
                                <label for="email">Email</label>
                                <div class="invalid-feedback" data-sb-feedback="email:required">A Email is required.
                                </div>
                            </div>
                            <div class="form-floating">
                                <input class="form-control" id="username" type="text" placeholder="Enter username..." name="username"
                                       data-sb-validations="required"/>
                                <label for="email">Username</label>
                                <div class="invalid-feedback" data-sb-feedback="username:required">A Username is
                                    required.
                                </div>
                            </div>
                            <div class="form-floating">
                                <input class="form-control" id="password1" type="password" name="password1" name="password1"
                                       placeholder="Enter your password..."
                                       data-sb-validations="required,email"/>
                                <label for="password1">Password</label>
                                <div class="invalid-feedback" data-sb-feedback="password:required">An password is
                                    required.
                                </div>
                                <div class="invalid-feedback" data-sb-feedback="password:required">Password is not valid.
                                </div>
                            </div>
                            <div class="form-floating">
                                <input class="form-control" id="password2" type="password" name="password2" name="password2"
                                       placeholder="Enter your password..."
                                       data-sb-validations="required,email"/>
                                <label for="password2">Password Again</label>
                                <div class="invalid-feedback" data-sb-feedback="password:required">Enter your password again!
                                </div>
                                <div class="invalid-feedback" data-sb-feedback="password:required">Password again is not valid.
                                </div>
                            </div>
                            <br/>
                            <!-- Submit success message-->
                            <!---->
                            <!-- This is what your users will see when the form-->
                            <!-- has successfully submitted-->
                            {#                            <div class="d-none" id="submitSuccessMessage">#}
                            {#                                <div class="text-center mb-3">#}
                            {#                                    <div class="fw-bolder">Form submission successful!</div>#}
                            {#                                    To activate this form, sign up at#}
                            {#                                    <br/>#}
                            {#                                    <a href="https://startbootstrap.com/solution/contact-forms">https://startbootstrap.com/solution/contact-forms</a>#}
                            {#                                </div>#}
                            {#                            </div>#}
                            <!-- Submit error message-->
                            <!---->
                            <!-- This is what your users will see when there is-->
                            <!-- an error submitting the form-->
                            {#                            <div class="d-none" id="submitErrorMessage">#}
                            {#                                <div class="text-center text-danger mb-3">Error sending message!</div>#}
                            {#                            </div>#}
                            <!-- Submit Button-->
                            <button class="btn btn-primary text-uppercase" id="submitButton" type="submit">
                                Sign Up
                            </button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </main>

{% endblock %}
D-Sup commented 2 years ago

https://substory.tistory.com/43

overtae commented 2 years ago

내용이 길어 나눴습니다.. 1 : https://overtae.github.io/blog/python%20flask/flask-blog-practice/ 2 : https://overtae.github.io/blog/python%20flask/flask-blog-bootstrap/

ryukyung commented 2 years ago

https://ryu-ddo.tistory.com/380

hyoeunla commented 2 years ago

https://sophia02.tistory.com/120 https://sophia02.tistory.com/121

2gang commented 2 years ago

https://rud0503.tistory.com/6

leesunuk commented 2 years ago

https://leesunuk.tistory.com/102

ji1210h commented 2 years ago

https://ji1210h.tistory.com/263 https://ji1210h.tistory.com/264

youngjoo00 commented 2 years ago

https://youngjoo-com.tistory.com/6