Coder Social home page Coder Social logo

python-with-flask's Introduction

Python with Flask

๐Ÿ”ง Pre-requisites

Before running the project, you must have the following tool installed on your machine:

Also, you will need to clone the repository:

## Cloning the repository
git clone https://github.com/mateuseap/python-with-flask
## Entering the directory
cd python-with-flask

๐Ÿš€ Project setup

> Setting the environment variables

Create a file named .env and copy and past in it what is inside the .env.example file (create the .env file in the same place that .env.example file is localized). After that, you'll need to change de DATABASE_URL variable value and put in it the URL of your own database, following the given structure:

## Database URL
postgresql://username:password@host:port/database_name

You can also change the API_KEY variable value, but if you leave the default value, the project will still work properly.

> Running the app

You'll need to run the commands below:

## Creating a virtual environment
python -m venv env
.\env\Scripts\activate
## Upgrading the pip 
python -m pip install --upgrade pip
## Installing dependencies
pip install -r .\requirements.txt
## Running the app
python -m flask run

Open http://127.0.0.1:5000 to view it in the browser.

> Creating the database

First, you'll need to open up a Python interactive shell:

flask shell

The special shell above runs commands in the context of the Flask application, so that the Flask-SQLAlchemy functions called are connected to the application. After openning this shell, you'll just need write this in it to create the database:

from app import db, User
db.create_all()
exit()

python-with-flask's People

Contributors

mateuseap avatar

Stargazers

 avatar  avatar

Watchers

 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.