Linux hosting
This commit is contained in:
parent
f43818315e
commit
89ff1621f8
|
@ -19,7 +19,7 @@ oid = OpenID(app, os.path.join(basedir, 'tmp'))
|
||||||
mail = Mail(app)
|
mail = Mail(app)
|
||||||
babel = Babel(app)
|
babel = Babel(app)
|
||||||
|
|
||||||
if not app.debug:
|
if not app.debug and MAIL_SERVER != '':
|
||||||
import logging
|
import logging
|
||||||
from logging.handlers import SMTPHandler
|
from logging.handlers import SMTPHandler
|
||||||
credentials = None
|
credentials = None
|
||||||
|
|
|
@ -6,13 +6,13 @@
|
||||||
{% else %}
|
{% else %}
|
||||||
<title>microblog</title>
|
<title>microblog</title>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<link href="/static/css/bootstrap.min.css" rel="stylesheet" media="screen">
|
<link href="{{ url_for('.static', filename = 'css/bootstrap.min.css') }}" rel="stylesheet" media="screen">
|
||||||
<link href="/static/css/bootstrap-responsive.min.css" rel="stylesheet">
|
<link href="{{ url_for('.static', filename = 'css/bootstrap-responsive.min.css') }}" rel="stylesheet">
|
||||||
<script src="http://code.jquery.com/jquery-latest.js"></script>
|
<script src="http://code.jquery.com/jquery-latest.js"></script>
|
||||||
<script src="/static/js/bootstrap.min.js"></script>
|
<script src="{{ url_for('.static', filename = 'js/bootstrap.min.js') }}"></script>
|
||||||
<script src="/static/js/moment.min.js"></script>
|
<script src="{{ url_for('.static', filename = 'js/moment.min.js') }}"></script>
|
||||||
{% if g.locale != 'en' %}
|
{% if g.locale != 'en' %}
|
||||||
<script src="/static/js/moment-{{g.locale}}.min.js"></script>
|
<script src="{{ url_for('.static', filename = 'js/moment-' + g.locale + '.min.js') }}"></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<script>
|
<script>
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
</a>
|
</a>
|
||||||
<a class="brand" href="/">microblog</a>
|
<a class="brand" href="{{ url_for('index') }}">microblog</a>
|
||||||
<ul class="nav">
|
<ul class="nav">
|
||||||
<li><a href="{{ url_for('index') }}">{{ _('Home') }}</a></li>
|
<li><a href="{{ url_for('index') }}">{{ _('Home') }}</a></li>
|
||||||
{% if g.user.is_authenticated() %}
|
{% if g.user.is_authenticated() %}
|
||||||
|
|
|
@ -12,7 +12,10 @@ OPENID_PROVIDERS = [
|
||||||
{ 'name': 'Flickr', 'url': 'http://www.flickr.com/<username>' },
|
{ 'name': 'Flickr', 'url': 'http://www.flickr.com/<username>' },
|
||||||
{ 'name': 'MyOpenID', 'url': 'https://www.myopenid.com' }]
|
{ 'name': 'MyOpenID', 'url': 'https://www.myopenid.com' }]
|
||||||
|
|
||||||
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db')
|
if os.environ.get('SQLALCHEMY_DATABASE_URI') is None:
|
||||||
|
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db') + '?check_same_thread=False'
|
||||||
|
else:
|
||||||
|
SQLALCHEMY_DATABASE_URI = os.environ['SQLALCHEMY_DATABASE_URI']
|
||||||
SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
|
SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
|
||||||
SQLALCHEMY_RECORD_QUERIES = True
|
SQLALCHEMY_RECORD_QUERIES = True
|
||||||
WHOOSH_BASE = os.path.join(basedir, 'search.db')
|
WHOOSH_BASE = os.path.join(basedir, 'search.db')
|
||||||
|
@ -21,7 +24,7 @@ WHOOSH_BASE = os.path.join(basedir, 'search.db')
|
||||||
DATABASE_QUERY_TIMEOUT = 0.5
|
DATABASE_QUERY_TIMEOUT = 0.5
|
||||||
|
|
||||||
# email server
|
# email server
|
||||||
MAIL_SERVER = 'your.mailserver.com'
|
MAIL_SERVER = '' # your mailserver
|
||||||
MAIL_PORT = 25
|
MAIL_PORT = 25
|
||||||
MAIL_USE_TLS = False
|
MAIL_USE_TLS = False
|
||||||
MAIL_USE_SSL = False
|
MAIL_USE_SSL = False
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
killall /home/apps/microblog/flask/bin/python
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!flask/bin/python
|
||||||
|
|
||||||
|
# use mysql
|
||||||
|
os.environ['SQLALCHEMY_DATABASE_URI'] = 'mysql://apps:apps@localhost/apps'
|
||||||
|
|
||||||
|
from flup.server.fcgi import WSGIServer
|
||||||
|
from app import app
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
WSGIServer(app).run()
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!flask/bin/python
|
||||||
|
from flup.server.fcgi import WSGIServer
|
||||||
|
from app import app
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
WSGIServer(app).run()
|
2
setup.py
2
setup.py
|
@ -15,6 +15,8 @@ else:
|
||||||
subprocess.call([os.path.join('flask', bin, 'pip'), 'install', 'sqlalchemy==0.7.9'])
|
subprocess.call([os.path.join('flask', bin, 'pip'), 'install', 'sqlalchemy==0.7.9'])
|
||||||
subprocess.call([os.path.join('flask', bin, 'pip'), 'install', 'flask-sqlalchemy'])
|
subprocess.call([os.path.join('flask', bin, 'pip'), 'install', 'flask-sqlalchemy'])
|
||||||
subprocess.call([os.path.join('flask', bin, 'pip'), 'install', 'sqlalchemy-migrate'])
|
subprocess.call([os.path.join('flask', bin, 'pip'), 'install', 'sqlalchemy-migrate'])
|
||||||
|
if sys.platform != 'win32':
|
||||||
|
subprocess.call([os.path.join('flask', bin, 'pip'), 'install', 'mysql-python'])
|
||||||
subprocess.call([os.path.join('flask', bin, 'pip'), 'install', 'flask-whooshalchemy'])
|
subprocess.call([os.path.join('flask', bin, 'pip'), 'install', 'flask-whooshalchemy'])
|
||||||
subprocess.call([os.path.join('flask', bin, 'pip'), 'install', 'flask-wtf'])
|
subprocess.call([os.path.join('flask', bin, 'pip'), 'install', 'flask-wtf'])
|
||||||
subprocess.call([os.path.join('flask', bin, 'pip'), 'install', 'flask-babel'])
|
subprocess.call([os.path.join('flask', bin, 'pip'), 'install', 'flask-babel'])
|
||||||
|
|
Loading…
Reference in New Issue