Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Basic Flask app - 3 views Home, Login, Secret using ui.router
- Loading branch information
1 parent
00b4de3
commit 602924e
Showing
10 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# pycharm | ||
.idea/ | ||
|
||
# database | ||
*.sqlite | ||
|
||
# bower dependencies | ||
bower_components/ | ||
|
||
# virtualenv | ||
venv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
This webapp requires these programs: | ||
|
||
- Python 2.7.* | ||
- pip | ||
- virtualenv | ||
- bower | ||
|
||
Activate virtualenv | ||
|
||
> virtualenv venv | ||
> source venv/bin/activate | ||
Install all required Python libraries | ||
|
||
> pip install -r requirements.txt | ||
Install all required JS libraries | ||
|
||
> cd static/ | ||
> bower install | ||
Enjoy! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import flask | ||
from flask import Flask | ||
|
||
app = Flask(__name__) | ||
|
||
|
||
@app.route('/islive') | ||
def islive(): | ||
return "it's live" | ||
|
||
|
||
@app.route('/') | ||
def index(): | ||
return flask.redirect('/static/index.html') | ||
|
||
|
||
if __name__ == '__main__': | ||
app.run(debug=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Flask==0.10.1 | ||
PyJWT==1.4.0 | ||
Flask-SQLAlchemy==1.0 | ||
requests==2.7.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "demo satellizer", | ||
"version": "0.0.0", | ||
"homepage": "https://github.com/nguyenkims/satellizer-demo", | ||
"authors": [ | ||
"Son Nguyen Kim" | ||
], | ||
"description": "a simple webapp with regular and facebook login", | ||
"keywords": [ | ||
"satellizer", | ||
"angularjs" | ||
], | ||
"license": "MIT", | ||
"ignore": [ | ||
"**/.*", | ||
"node_modules", | ||
"bower_components", | ||
"test", | ||
"tests" | ||
], | ||
"dependencies": { | ||
"angular": "angularjs#~1.4.8", | ||
"angular-ui-router": "~0.2.15" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Demo Satellizer</title> | ||
</head> | ||
<body ng-app="DemoApp"> | ||
|
||
<a ui-sref="home">Home</a> | ||
<a ui-sref="login">Login</a> | ||
<a ui-sref="secret">Secret</a> | ||
|
||
<div ui-view></div> | ||
|
||
<script src="bower_components/angular/angular.min.js"></script> | ||
<script src="bower_components/angular-ui-router/release/angular-ui-router.min.js"></script> | ||
<script src="main.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
var app = angular.module('DemoApp', ['ui.router']); | ||
|
||
app.config(function ($stateProvider, $urlRouterProvider) { | ||
|
||
$stateProvider | ||
.state('home', { | ||
url: '/home', | ||
templateUrl: 'partials/home.tpl.html' | ||
}) | ||
.state('secret', { | ||
url: '/secret', | ||
templateUrl: 'partials/secret.tpl.html', | ||
}) | ||
.state('login', { | ||
url: '/login', | ||
templateUrl: 'partials/login.tpl.html' | ||
}); | ||
|
||
$urlRouterProvider.otherwise('/home'); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Home |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Login |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Secret |