Skip to content

Commit

Permalink
模板构建完成
Browse files Browse the repository at this point in the history
  • Loading branch information
Rempage committed Jan 18, 2019
1 parent 56e6ba9 commit f097b0d
Show file tree
Hide file tree
Showing 1,155 changed files with 184,312 additions and 23 deletions.
6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

406 changes: 395 additions & 11 deletions .idea/workspace.xml

Large diffs are not rendered by default.

Binary file added __pycache__/config.cpython-36.pyc
Binary file not shown.
12 changes: 0 additions & 12 deletions app.py

This file was deleted.

32 changes: 32 additions & 0 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_wtf import CSRFProtect
from flask_uploads import UploadSet, configure_uploads, ALL
from config import config

db = SQLAlchemy()
login_manager = LoginManager()
login_manager.login_view = 'wap.login'
login_manager.login_message = "账号登录失效"
csrf = CSRFProtect()

fileUpload = UploadSet('files', ALL)

def create_app(config_name):
app = Flask(__name__)
app.config.from_object(config[config_name])

config[config_name].init_app(app)
db.init_app(app)
login_manager.init_app(app)
csrf.init_app(app)
configure_uploads(app, fileUpload)

from .wap import wap as wap_blueprint
app.register_blueprint(wap_blueprint)

from .www import www as www_blueprint
app.register_blueprint(www_blueprint, url_prefix='/www')

return app
Binary file added app/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Empty file added app/static/css/wap.css
Empty file.
Empty file added app/static/js/wap.js
Empty file.
9 changes: 9 additions & 0 deletions app/static/third/cropper/cropper.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions app/static/third/cropper/cropper.min.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions app/static/third/jquery.js

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions app/templates/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>

</body>
</html>
10 changes: 10 additions & 0 deletions app/templates/500.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>

</body>
</html>
5 changes: 5 additions & 0 deletions app/wap/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from flask import Blueprint

wap = Blueprint('wap', __name__)

from . import views
Binary file added app/wap/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file added app/wap/__pycache__/views.cpython-36.pyc
Binary file not shown.
Empty file added app/wap/forms.py
Empty file.
5 changes: 5 additions & 0 deletions app/wap/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from . import wap

@wap.route('/')
def index():
return '1'
5 changes: 5 additions & 0 deletions app/www/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from flask import Blueprint

www = Blueprint('www', __name__)

from . import views
Binary file added app/www/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file added app/www/__pycache__/views.cpython-36.pyc
Binary file not shown.
Empty file added app/www/forms.py
Empty file.
Empty file added app/www/views.py
Empty file.
39 changes: 39 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import os
basedir = os.path.abspath(os.path.dirname(__file__))

class Config:
SQLALCHEMY_TRACK_MODIFICATIONS = True
SECRET_KEY = '1234567890123456789012345678901234567890'
UPLOADS_DEFAULT_DEST = basedir + '/app/static'
FLASKY_ADMIN = '13167288970'
SERVER_NAME = '192.168.0.147:5000'
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:19920720@127.0.0.1/smart'
DEBUG = True
if not os.path.exists(UPLOADS_DEFAULT_DEST):
os.mkdir(UPLOADS_DEFAULT_DEST)

@staticmethod
def init_app(app):
pass


class Release:
SQLALCHEMY_TRACK_MODIFICATIONS = True
SECRET_KEY = '\xc3m\x0e\xae\x1c\xcbs\x06pF\xa8\xe1\x84o\xaf\xe90\x00R=j\xce\x93&'
UPLOADS_DEFAULT_DEST = basedir + '/app/static'
FLASKY_ADMIN = '13167288970'
SERVER_NAME = 'm.antporters.com'
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:lYp926233@127.0.0.1/share'
DEBUG = False
TESTING = False
if not os.path.exists(UPLOADS_DEFAULT_DEST):
os.mkdir(UPLOADS_DEFAULT_DEST)

@staticmethod
def init_app(app):
pass

config = {
'default': Config,
'release': Release
}
27 changes: 27 additions & 0 deletions manage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from app import create_app, db
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager, Shell
from flask import render_template

# 测试
app = create_app('default')

manager = Manager(app)
migrate = Migrate(app, db)

def make_shell():
return {'app': app, 'db': db}

manager.add_command('shell', Shell(make_context=make_shell))
manager.add_command('db', MigrateCommand)

@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__':
manager.run()
16 changes: 16 additions & 0 deletions release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from app import create_app
from flask import render_template


app = create_app('release')

@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()
19 changes: 19 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
alembic==1.0.6
Click==7.0
Flask==1.0.2
Flask-Login==0.4.1
Flask-Migrate==2.3.1
Flask-Script==2.0.6
Flask-SQLAlchemy==2.3.2
Flask-Uploads==0.2.1
Flask-WTF==0.14.2
itsdangerous==1.1.0
Jinja2==2.10
Mako==1.0.7
MarkupSafe==1.1.0
python-dateutil==2.7.5
python-editor==1.0.3
six==1.12.0
SQLAlchemy==1.2.16
Werkzeug==0.14.1
WTForms==2.2.1
12 changes: 12 additions & 0 deletions venv/bin/alembic
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/Users/lihao/Documents/Python/smart/venv/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'alembic==1.0.6','console_scripts','alembic'
__requires__ = 'alembic==1.0.6'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('alembic==1.0.6', 'console_scripts', 'alembic')()
)
12 changes: 12 additions & 0 deletions venv/bin/mako-render
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/Users/lihao/Documents/Python/smart/venv/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'Mako==1.0.7','console_scripts','mako-render'
__requires__ = 'Mako==1.0.7'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('Mako==1.0.7', 'console_scripts', 'mako-render')()
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Metadata-Version: 1.1
Name: Flask-Login
Version: 0.4.1
Summary: User session management for Flask
Home-page: https://github.com/maxcountryman/flask-login
Author: Matthew Frazier
Author-email: leafstormrush@gmail.com
License: MIT
Description:
Flask-Login
-----------

Flask-Login provides user session management for Flask. It handles the common
tasks of logging in, logging out, and remembering your users'
sessions over extended periods of time.

Flask-Login is not bound to any particular database system or permissions
model. The only requirement is that your user objects implement a few
methods, and that you provide a callback to the extension capable of
loading users from their ID.

Links
`````
* `documentation <https://flask-login.readthedocs.io/en/latest/>`_
* `development version <https://github.com/maxcountryman/flask-login>`_

Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
LICENSE
MANIFEST.in
README.md
setup.cfg
setup.py
Flask_Login.egg-info/PKG-INFO
Flask_Login.egg-info/SOURCES.txt
Flask_Login.egg-info/dependency_links.txt
Flask_Login.egg-info/not-zip-safe
Flask_Login.egg-info/requires.txt
Flask_Login.egg-info/top_level.txt
Flask_Login.egg-info/version_info.json
flask_login/__about__.py
flask_login/__init__.py
flask_login/_compat.py
flask_login/config.py
flask_login/login_manager.py
flask_login/mixins.py
flask_login/signals.py
flask_login/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
../flask_login/__about__.py
../flask_login/__init__.py
../flask_login/__pycache__/__about__.cpython-36.pyc
../flask_login/__pycache__/__init__.cpython-36.pyc
../flask_login/__pycache__/_compat.cpython-36.pyc
../flask_login/__pycache__/config.cpython-36.pyc
../flask_login/__pycache__/login_manager.cpython-36.pyc
../flask_login/__pycache__/mixins.cpython-36.pyc
../flask_login/__pycache__/signals.cpython-36.pyc
../flask_login/__pycache__/utils.cpython-36.pyc
../flask_login/_compat.py
../flask_login/config.py
../flask_login/login_manager.py
../flask_login/mixins.py
../flask_login/signals.py
../flask_login/utils.py
PKG-INFO
SOURCES.txt
dependency_links.txt
not-zip-safe
requires.txt
top_level.txt
version_info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Flask
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
flask_login
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"release_date": null,
"version": "0.4.0",
"maintainer": "",
"body": ""
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pip
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Metadata-Version: 2.1
Name: Flask-Migrate
Version: 2.3.1
Summary: SQLAlchemy database migrations for Flask applications using Alembic
Home-page: http://github.com/miguelgrinberg/flask-migrate/
Author: Miguel Grinberg
Author-email: miguelgrinberg50@gmail.com
License: MIT
Platform: any
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: Flask (>=0.9)
Requires-Dist: Flask-SQLAlchemy (>=1.0)
Requires-Dist: alembic (>=0.7)

Flask-Migrate
--------------

SQLAlchemy database migrations for Flask applications using Alembic.


Loading

0 comments on commit f097b0d

Please sign in to comment.