Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
flask-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
flask-admin
Commits
d7a620e1
Unverified
Commit
d7a620e1
authored
Jun 27, 2018
by
Nidhal Selmi
Committed by
GitHub
Jun 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update app.py
Fix imports to conform to new flask_login convention
parent
7fa26ab2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
app.py
examples/menu-external-links/app.py
+4
-5
No files found.
examples/menu-external-links/app.py
View file @
d7a620e1
from
flask
import
Flask
,
redirect
,
url_for
from
flask
import
Flask
,
redirect
,
url_for
from
flask.ext
import
login
from
flask_login
import
current_user
,
UserMixin
,
login_user
,
logout_user
,
LoginManager
from
flask_login
import
current_user
,
UserMixin
from
flask_admin.base
import
MenuLink
,
Admin
,
BaseView
,
expose
from
flask_admin.base
import
MenuLink
,
Admin
,
BaseView
,
expose
...
@@ -52,17 +51,17 @@ def index():
...
@@ -52,17 +51,17 @@ def index():
@
app
.
route
(
'/login/'
)
@
app
.
route
(
'/login/'
)
def
login_view
():
def
login_view
():
login
.
login
_user
(
User
())
login_user
(
User
())
return
redirect
(
url_for
(
'admin.index'
))
return
redirect
(
url_for
(
'admin.index'
))
@
app
.
route
(
'/logout/'
)
@
app
.
route
(
'/logout/'
)
def
logout_view
():
def
logout_view
():
log
in
.
log
out_user
()
logout_user
()
return
redirect
(
url_for
(
'admin.index'
))
return
redirect
(
url_for
(
'admin.index'
))
login_manager
=
login
.
LoginManager
()
login_manager
=
LoginManager
()
login_manager
.
init_app
(
app
)
login_manager
.
init_app
(
app
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment