Git Product home page Git Product logo

flask-blog-tutorial's Introduction

flask-blog-tutorial

Flask tutorial

Flaskr Tutorial

Flaskr is a simple blog application that allows users to register, log in, create posts, and edit or delete their own posts. It is based on the official Flask tutorial², but with some modifications and improvements. This README will guide you through setting up and running Flaskr on your local machine.

Prerequisites

Before you start, make sure you have the following installed:

  • Python 3.11.2 or higher
  • pip
  • git

Installation

To install Flaskr, follow these steps:

  • Clone this repository to your local machine:
git clone https://github.com/shahbaz42/flask-blog-tutorial.git
  • move to the project directory
cd flask-blog-tutorial
  • Create a virtual environment and install dependencies:
python -m venv venv
  • Activate the virtual environment:
source venv/Source/activate
  • Install required dependencies
pip install -r requirements.txt

Initialization

To initialize Flaskr, you need to create the database schema and some initial data. Run this command:

flask init-db

This will create a file called flaskr.sqlite in the instance folder, which is where Flask stores files that are not meant to be shared with others.

Running

  • To run Flaskr, use this command:
flask --app flaskr run 
  • To run Flasker in debug mode
flask --app flaskr run --debug

This will start a development server on http://localhost:5000. You can visit this URL in your browser and see the Flaskr homepage.

You can log in or register a new user.

You can create new posts by clicking on "New" in the navigation bar.

You can edit or delete your own posts by clicking on "Edit" or "Delete" below each post.

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.