Best Flask open-source libraries and packages

Updated 1 year ago

Dictionary-App

My first full stack CRUD web application built with Python, PostgreSQL, and Flask framework.
CSS3 HTML5 Flask Postgres

Table of contents

Overview

The challenge

Users should be able to:

  • Check for the meaning of words.
  • Add a new word with it's meaning to the dictionary.
  • Update the a and its meaning.
  • Delete a word from the dictionary
  • View the optimal layout for the site depending on their device's screen size

Screenshot

Links

My process

Built with

  • HTML
  • CSS
  • Javascript
  • Flask - A web development microframework built with python
  • PostgreSQL

What I learned

  • How to connect to a database
  • How to use the Jinja template
$("#logo-form").submit(function() {
        let data = new FormData();
        data.append('file', $('#logo')[0].files[0]);

        $.ajax({
            url: '/add_logo',
            type: 'POST',
            data: data,
            enctype: 'multipart/form-data',
            processData: false,
            contentType: false,
            success: function(data) {
                location.reload();
            },
            error: function(err) {
                console.log(err);
            }
        })
    });
@app.route('/add_logo', methods=['POST'])
def add_logo():
    image = request.files['file']

    if image:
        filepath = os.path.join(current_app.root_path, 'static/images/logo.png')
        image.save(filepath)
        flash('image successfully added!')
    else:
        flash('error adding image!')

    return 'success'
        <div class="modal-body text-center">
          {% for message in messages %}
              <p>{{ message }}</p>
          {% endfor %}
        </div>

Useful resources

  • Flask - A web development microframework built with python
  • MySQL - The world's most popular open source database
Tags mysql