Coder Social home page Coder Social logo

flasketude's Introduction

FLASK Etude

This repository is my personal interpretation of Flask Rest API - Zero to Yoda Series' Articles

Requisites

In order to install (and execute) this repository, you require:

Install

Start a MongoDB instance

Create an .env file in this project directory in which define those variables:

MONGODB_ROOT_USER=root
MONGODB_ROOT_PASS=<password>
MONGOEXPRESS_USER=flask
MONGOEXPRESS_PASS=<password>
APP_USER=flask
APP_PASS=<password>
JWT_SECRET_KEY=<secret key>
MAIL_SERVER=localhost
MAIL_PORT=1025
[email protected]
MAIL_PASSWORD=

Next start MongoDB using docker-compose:

$ docker-compose up -d

In order to connect to your local MongoDB docker instance and create user:

$ docker-compose run --rm --user mongodb mongo sh -c 'mongo --host mongo --username="${MONGO_INITDB_ROOT_USERNAME}" --password="${MONGO_INITDB_ROOT_PASSWORD}"'

Create a user for movie-bag database with readWrite permissions:

use admin
db.createUser({user: "flask", pwd: "<password>", roles: [{role: "readWrite", db: "movie-bag"}]})
db.grantRolesToUser("flask", [{role: "readWrite", db: "movie-bag-test"}])

Install python requirements

You need to install required packages in a new conda environment:

$ conda env create -f environment.yml
$ conda activate FLASKetude
$ poetry install

Running

Start a test smptd service:

$ python -m smtpd -n -c DebuggingServer localhost:1025

Start the application with:

$ python app.py

flasketude's People

Contributors

bunop avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.