Skip to content

Commit

Permalink
flask-login
Browse files Browse the repository at this point in the history
  • Loading branch information
sherifrad committed Jun 9, 2018
1 parent bd24516 commit a37575f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/routes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from . import app, db
from .models import Post
from flask import render_template, redirect, url_for, request
from flask_login import login_required


@app.route('/')
Expand All @@ -17,6 +18,7 @@ def detail(post_id):


@app.route('/new', methods=['GET', 'POST'])
@login_required
def new():
if request.method == 'POST':
title = request.form.get('title')
Expand All @@ -30,6 +32,7 @@ def new():


@app.route('/edit/<int:post_id>', methods=['GET', 'POST'])
@login_required
def edit(post_id):
post = Post.query.get(post_id)
if request.method == 'POST':
Expand Down
Binary file modified blog.db
Binary file not shown.

0 comments on commit a37575f

Please sign in to comment.