-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 19af778
Showing
11 changed files
with
223 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,117 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
|
||
{ | ||
"name": "Python: Current File", | ||
"type": "python", | ||
"request": "launch", | ||
"program": "${file}" | ||
}, | ||
{ | ||
"name": "Python: Attach", | ||
"type": "python", | ||
"request": "attach", | ||
"localRoot": "${workspaceFolder}", | ||
"remoteRoot": "${workspaceFolder}", | ||
"port": 3000, | ||
"secret": "my_secret", | ||
"host": "localhost" | ||
}, | ||
{ | ||
"name": "Python: Terminal (integrated)", | ||
"type": "python", | ||
"request": "launch", | ||
"program": "${file}", | ||
"console": "integratedTerminal" | ||
}, | ||
{ | ||
"name": "Python: Terminal (external)", | ||
"type": "python", | ||
"request": "launch", | ||
"program": "${file}", | ||
"console": "externalTerminal" | ||
}, | ||
{ | ||
"name": "Python: Django", | ||
"type": "python", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/manage.py", | ||
"args": [ | ||
"runserver", | ||
"--noreload", | ||
"--nothreading" | ||
], | ||
"debugOptions": [ | ||
"RedirectOutput", | ||
"Django" | ||
] | ||
}, | ||
{ | ||
"name": "Python: Flask (0.11.x or later)", | ||
"type": "python", | ||
"request": "launch", | ||
"module": "flask", | ||
"env": { | ||
"FLASK_APP": "app.py" | ||
}, | ||
"args": [ | ||
"run", | ||
"--no-debugger", | ||
"--no-reload" | ||
] | ||
}, | ||
{ | ||
"name": "Python: Module", | ||
"type": "python", | ||
"request": "launch", | ||
"module": "module.name" | ||
}, | ||
{ | ||
"name": "Python: Pyramid", | ||
"type": "python", | ||
"request": "launch", | ||
"args": [ | ||
"${workspaceFolder}/development.ini" | ||
], | ||
"debugOptions": [ | ||
"RedirectOutput", | ||
"Pyramid" | ||
] | ||
}, | ||
{ | ||
"name": "Python: Watson", | ||
"type": "python", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/console.py", | ||
"args": [ | ||
"dev", | ||
"runserver", | ||
"--noreload=True" | ||
] | ||
}, | ||
{ | ||
"name": "Python: All debug Options", | ||
"type": "python", | ||
"request": "launch", | ||
"pythonPath": "${config:python.pythonPath}", | ||
"program": "${file}", | ||
"module": "module.name", | ||
"env": { | ||
"VAR1": "1", | ||
"VAR2": "2" | ||
}, | ||
"envFile": "${workspaceFolder}/.env", | ||
"args": [ | ||
"arg1", | ||
"arg2" | ||
], | ||
"debugOptions": [ | ||
"RedirectOutput" | ||
] | ||
} | ||
] | ||
} |
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,3 @@ | ||
{ | ||
"python.pythonPath": "/home/leslie/Desktop/python3_config/bin/python", | ||
} |
Binary file not shown.
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,37 @@ | ||
#!/usr/bin/env python3 | ||
# coding:utf-8 | ||
from flask import Flask, render_template, request | ||
from flask_bootstrap import Bootstrap | ||
from flask_moment import Moment | ||
app = Flask(__name__) | ||
bootstrap = Bootstrap(app=app) | ||
moment = Moment(app=app) | ||
|
||
@app.route("/") | ||
def index(): | ||
return render_template("index.html") | ||
|
||
|
||
@app.route('/user/<name>') | ||
def user(name): | ||
age = request.args.get("age") | ||
return render_template('user.html', name=name, age=age) | ||
|
||
|
||
@app.route('/inheritance') | ||
def inheritance(): | ||
return render_template('inheritance.html') | ||
|
||
|
||
@app.errorhandler(404) | ||
def page_not_found(e): | ||
return render_template('404.html'), 404 | ||
|
||
|
||
@app.errorhandler(500) | ||
def internal_server_error(e): | ||
return render_template('500.html'), 500 | ||
|
||
|
||
if __name__ == "__main__": | ||
app.run(host='0.0.0.0', port=8080, debug=True) |
Binary file not shown.
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,6 @@ | ||
{% extends "base.html" %} {% block title %} Flasky - Page Not Found {% endblock title | ||
%} {% block page_content %} | ||
<div class="page-header"> | ||
<h1>Not Found</h1> | ||
</div> | ||
{% endblock page_content %} |
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,6 @@ | ||
{% extends "base.html" %} {% block title %} Flasky - Server Internal Error {% endblock | ||
title %} {% block page_content %} | ||
<div class="page-header"> | ||
<h1>Server Internal error</h1> | ||
</div> | ||
{% endblock page_content %} |
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,23 @@ | ||
{% extends "bootstrap/base.html" %} {% block title %} Flasky {% endblock title %} | ||
{% block head %} {{super()}} {{moment.include_moment()}} | ||
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}" | ||
type="image/x-icon"> | ||
<link rel="icon" href="{{ url_for('static', filename='favicon.ico') }}" type="image/x-icon"> {% endblock head %} {% block navbar %} | ||
<div class="navbar navbar-inverse" role="navigation"> | ||
<div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
<span class=></span> | ||
</button> | ||
<a href="/" class="navbar-brand">Flasky</a> | ||
</div> | ||
<div class="navbar-collapse collapse"> | ||
<ul class="nav navbar-nav"> | ||
<li><a href="/">Home</a></li> | ||
</ul> | ||
</div> | ||
</div> | ||
{% endblock navbar %} {% block content %} | ||
<div class="container"> | ||
{% block page_content %} {% endblock page_content %} | ||
</div> | ||
{% endblock content %} |
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,13 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>My first awesome Flask</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="stylesheet" type="text/css" media="screen" href="main.css" /> | ||
</head> | ||
<body> | ||
<h1>Hello Flask!</h1> | ||
</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,11 @@ | ||
{%extends "base.html" %} | ||
{%block title%} | ||
Base | ||
{%endblock%} | ||
{%block head%} | ||
{{super()}} | ||
<style></style> | ||
{%endblock%} | ||
{%block body%} | ||
<h1>Just to see the fucking jinja.</h1> | ||
{%endblock%} |
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,7 @@ | ||
{% extends "base.html" %} {% block title %} Flasky {% endblock title %} {% block | ||
page_content %} | ||
<h1> | ||
Hello,{{name}} | ||
You age is {{age}}!! | ||
</h1> | ||
{% endblock page_content %} |