コード例 #1
0
ファイル: run.py プロジェクト: cc-d/flask-microblog
def main(port=80):
    from sys import argv

    from website import app as app

    try:
        app.run(host='0.0.0.0', port=argv[1])
    except IndexError:
        stars = '\n' + (20 * '*') + '\n'
        print(stars + 'No port found, using default port %s' % port + stars)
        app.run(host='0.0.0.0', port=port)
コード例 #2
0
ファイル: bolts.py プロジェクト: jreinhardt/BOLTS
def test(args):
	exec_dir = os.path.join(args.repo,"output",args.target)
	if args.target == "freecad":
		freecad_process = Popen(["freecad","-M","."],cwd=exec_dir)
		freecad_process.wait()
	elif args.target == "openscad":
		freecad_process = Popen(["openscad"],cwd=exec_dir)
		freecad_process.wait()
	elif args.target == "website":
		import website
		from website import app
		extra_files = []
		blog_path = os.path.join(args.repo,"website","blog","posts")
		for filename in listdir(blog_path):
			if filename.startswith('.'):
				continue
			extra_files.append(os.path.join(blog_path,filename))

		doc_path = os.path.join(args.repo,"website","docs","sources")
		for dirpath,_,filenames in walk(doc_path):
			for filename in filenames:
				if filename.startswith('.'):
					continue
				extra_files.append(os.path.join(dirpath,filename))

		trans_path = os.path.join(args.repo,"translations")
		for dirpath,_,filenames in walk(trans_path):
			for filename in filenames:
				if filename.endswith('.mo'):
					extra_files.append(os.path.join(dirpath,filename))

		#templates
		for dirpath,_,filenames in walk(args.repo):
			if os.path.basename(dirpath) == "templates":
				for filename in filenames:
					extra_files.append(os.path.join(dirpath,filename))



		app.run(debug=True,extra_files=extra_files)
コード例 #3
0
ファイル: bolts.py プロジェクト: revilor/BOLTS
def test(args):
    exec_dir = os.path.join(args.repo, "output", args.target)
    if args.target == "freecad":
        freecad_process = Popen(["freecad", "-M", "."], cwd=exec_dir)
        freecad_process.wait()
    elif args.target == "openscad":
        freecad_process = Popen(["openscad"], cwd=exec_dir)
        freecad_process.wait()
    elif args.target == "website":
        import website
        from website import app
        extra_files = []
        blog_path = os.path.join(args.repo, "website", "blog", "posts")
        for filename in listdir(blog_path):
            if filename.startswith('.'):
                continue
            extra_files.append(os.path.join(blog_path, filename))

        doc_path = os.path.join(args.repo, "website", "docs", "sources")
        for dirpath, _, filenames in walk(doc_path):
            for filename in filenames:
                if filename.startswith('.'):
                    continue
                extra_files.append(os.path.join(dirpath, filename))

        trans_path = os.path.join(args.repo, "translations")
        for dirpath, _, filenames in walk(trans_path):
            for filename in filenames:
                if filename.endswith('.mo'):
                    extra_files.append(os.path.join(dirpath, filename))

        #templates
        for dirpath, _, filenames in walk(args.repo):
            if os.path.basename(dirpath) == "templates":
                for filename in filenames:
                    extra_files.append(os.path.join(dirpath, filename))

        app.run(debug=True, extra_files=extra_files)
コード例 #4
0
import website.app as a

if __name__ == '__main__':

    a.run()
コード例 #5
0
import sys

from flask import render_template, request
from website import app, views
from flask_frozen import Freezer

if __name__ == '__main__':
    if len(sys.argv) > 1 and sys.argv[1] == "build":
        freezer = Freezer(app)
        freezer.freeze()
    else:
        app.run(debug=True, host="192.168.178.14", port=8000)
コード例 #6
0
ファイル: main.py プロジェクト: timlyo/EvergreenScouts
import argparse

from website import app
from website import routes

if __name__ == "__main__":
	parser = argparse.ArgumentParser()
	parser.add_argument("-d", dest="debug", type=bool)
	args = parser.parse_args()

	if args.debug:
		app.debug = True

	app.run(threaded=True)
コード例 #7
0
ファイル: run.py プロジェクト: dbzer0/flask-project
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from website import app

if __name__ == '__main__':
    app.run(host=app.config['SERVER_ADDRESS'],
            debug=app.config['DEBUG'],
            port=app.config['SERVER_PORT'])
コード例 #8
0
ファイル: views.py プロジェクト: salilsub/website
  response = urllib2.urlopen(req)

  return get_facebook_data()

@app.route("/facebook_redirect",methods=['GET','POST'])
def redir():
  print request.args.items()
  print request.form.itmes()
  return "HELLO"

@app.route("/", methods=['GET', 'POST'])
def combined_all():

  mobile = False
  browser = request.user_agent.browser
  version = request.user_agent.version and int(request.user_agent.version.split('.')[0])
  platform = request.user_agent.platform
  uas = request.user_agent.string

  if platform:
    if platform in ['iphone','android'] \
    or (platform == 'windows' and re.search('Windows Phone OS', uas)) \
    or (re.search('BlackBerry', uas)):
       mobile = True
     

  return render_template('combined_pages.html', data=get_user_data(),github_data=get_github_data(),user_data=dict(parser.items('user')),facebook_data=get_facebook_data(),mobile=mobile,gvoice_widget = parser.get('user','gvoice_widget_id'))

if __name__ == '__main__':
  app.run(debug=True,host='0.0.0.0')
コード例 #9
0
ファイル: run.py プロジェクト: mansishah20/website
# this file runs the application and allows you to view the application from the web browser 

from website import app
import os

if __name__ == '__main__':
    app.run(debug=True, port=8000)   
コード例 #10
0
ファイル: run.py プロジェクト: evansolomon/remindergram
"""
Start the Flask app
"""

from website import app

if __name__ == '__main__':
    app.run(debug=True)
コード例 #11
0
ファイル: fabfile.py プロジェクト: nfletton/froid
def run():
    app.run(debug=True)
コード例 #12
0
"""
This script runs the website application using a development server.
"""

from os import environ
from website import app

if __name__ == '__main__':
    HOST = environ.get('SERVER_HOST', 'localhost')
    try:
        PORT = int(environ.get('SERVER_PORT', '5555'))
    except ValueError:
        PORT = 5555
    app.run(HOST, PORT,debug=True)
コード例 #13
0
ファイル: runserver.py プロジェクト: ooda/website
import os

from website import app

#os.environ["FLASK_DEV_SERVER"] = "true"

# Bind to PORT if defined, otherwise default to 5000.
port = int(os.environ.get('PORT', 5000))
app.run(debug=False, host='0.0.0.0', port=port)
コード例 #14
0
ファイル: run.py プロジェクト: Plommonsorbet/cool-cat
__author__ = 'Plommonsorbet'

from website import app
app.run(

    debug=True,
    port=1111

)
コード例 #15
0
from website import app

if __name__=='__main__':
    app.run(host='0.0.0.0', port=3000)
コード例 #16
0
ファイル: run.py プロジェクト: jonathanchu/fpo
from website import app
import os

if __name__ == "__main__":
    port = int(os.environ.get("PORT", 5000))
    app.run(host='0.0.0.0', port=port)
コード例 #17
0
### File to run a local debug server
from website import app
app.run(host='0.0.0.0', port=8005, debug=True)
コード例 #18
0
        own_plants[p['id']] = AutomaticWateringSystem(uuid=p['id'],
                                                      name=p[Database.TABLE_OWN_PLANT_NAME],
                                                      temperature_pin=p[Database.TABLE_OWN_PLANT_TEMPERATURE_PIN],
                                                      magnetic_valve_pin=p[Database.TABLE_OWN_PLANT_MAGNETIC_VALVE_PIN],
                                                      moisture_pin=p[Database.TABLE_OWN_PLANT_MOISTURE_PIN],
                                                      gpio_debug=False,
                                                      debug=True)

    ValveQueue = WateringQueue(True)

    reload_flask = False
    # if environ.get('RELOAD_FLASK') is not None:
    #     reload_flask = True

    app = app.create_app(DevelopmentConfig)
    app.run(host='0.0.0.0', use_reloader=reload_flask)

    for a in own_plants:
        a.cleanup()

    print 'CLEEEEEANUP'
    # gpio.digitalWrite(pump_pin, gpio.LOW)
    # gpio.cleanup()

    # # # NOTE: There will exist one class PER temperature sensor
    # # temperature_pin = 0
    # # GetTemperature = Temperature(analogPins.get(temperature_pin), 30)
    # #
    # # # NOTE: There will exist one class PER magnetic valve
    # # magnetic_valve_pin = 6
    # # ChiliMagneticValve = MagneticValve(digitalPins.get(magnetic_valve_pin), 'CHILI #1', True)
コード例 #19
0
__author__ = 'isak.johansson'


from website import app

app.run(debug=True, host='0.0.0.0', port=3333
)

コード例 #20
0
ファイル: server.py プロジェクト: sousic/flask.huny.kr
from website import app
if __name__ == '__main__':
    app.run(debug=True, use_reloader=True)
コード例 #21
0
ファイル: run.py プロジェクト: matt-cart/website
from website import app

app.run('0.0.0.0', debug=True)
コード例 #22
0
ファイル: run.py プロジェクト: SShiva/online-trial
#!/usr/bin/env python
#
# Copyright 2014 Ravello Systems, Inc.
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#    http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from website import app
app.run(host='0.0.0.0', port=8080)
コード例 #23
0
from website import app, db

if __name__ == '__main__':
    db.create_all()
    app.run(host='0.0.0.0', port=80)
コード例 #24
0
    HOST = environ.get('SERVER_HOST', 'localhost')
    #   HOST = environ.get('SERVER_HOST', '0.0.0.0')
    #   HOST = environ.get('SERVER_HOST', '')
    PORT = int(environ.get('SERVER_PORT', '5000'))

    if (enableLiveReload):
        app.debug = True
        liveReloadServer = Server(app.wsgi_app)
        #  certLocation = "website/certs/"

        # server.watch
        liveReloadServer.watch('website/')
        liveReloadServer.watch('website/templates/')
        liveReloadServer.serve(port=PORT, host=HOST)
    else:
        app.run(HOST, PORT, debug=False)

#   socketio.run(app, port=9090)

#  server = Server(app.wsgi_app)
#  certLocation = "website/certs/"
#  app.debug = True

# server.watch
#  server.watch('website/')
#  server.watch('website/templates/')

# server.serve(port=PORT, ssl_ctx=ssl_ctx)

# https://localhost:50603
# pass in debug=false since debugging with Visual Studio code.
コード例 #25
0
import sys
from website import app, models, init_for
init_for('dev')
models.db.create_all()

try:
    port = int(sys.argv[1])
except (IndexError, ValueError):
    port = 3000
app.run('0.0.0.0', port=port, debug=True)
コード例 #26
0
from website import app

app.config['DEBUG'] = True

app.run(port=5002)
コード例 #27
0
ファイル: run.py プロジェクト: zhangjiangqige/auto-annotate
# coding: utf8

__author__ = 'neodooth'

import logging
logging.getLogger('requests').setLevel(logging.WARNING)
logging.getLogger('werkzeug').setLevel(logging.WARNING)

from config import ROLE

logging.basicConfig(
    filename=ROLE + '.log',
    level=logging.INFO,
    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')

if ROLE == 'website':
    from website import app
else:
    from downloader import app

logging.info('starting %s' % ROLE)
app.run(debug=True,
        use_reloader=False,
        threaded=True,
        host='0.0.0.0',
        port=2938)
コード例 #28
0
ファイル: wsgi.py プロジェクト: SanderHendrix/webcontrol
from website import app as application

if __name__ == "__main__":
    application.run()
コード例 #29
0
ファイル: manage.py プロジェクト: barcai/StirHack2016
from website import app

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=6969, debug=True)
コード例 #30
0
ファイル: wsgi.py プロジェクト: snroeust/FPV_website
from website import app

if __name__ == "__main__":
    print("schwierig")
    app.run(host='0.0.0.0')
コード例 #31
0
from website import app

if __name__ == "__main__":
    app.run(debug=True, port=5001, use_reloader=False)
コード例 #32
0
from website import app

app.run(host='0.0.0.0', port=5000, debug=False)
コード例 #33
0
# -*- coding: utf-8 -*-
from flask.ext.scss import Scss
from website import app

if __name__ == '__main__':
    app.debug = True
    Scss(app, static_dir='static', asset_dir='assets')
    app.run(port=4002, debug=True)
コード例 #34
0
from website import app

if __name__ == '__main__':
    app.run(port=80, debug=True)
コード例 #35
0
from website import app
from flask import Flask

app.run(port=5000, host='0.0.0.0', debug=True)
コード例 #36
0
ファイル: app.py プロジェクト: Red54/Sophia
    return send_from_directory(UPLOAD_FOLDER, filename)


@app.route('/avatar/<filename>')
def uploaded_avatar(filename):
    if filename == 'default_avatar.jpg':
        return send_from_directory(STATIC_FOLDER, 'img/default_avatar.jpg')
    size = request.args.get('size')
    if size:
        (base_name, ext_name) = filename.rsplit('.', 1)
        if ext_name in PIC_EXTENSIONS:
            ori_file = os.path.join(AVATAR_FOLDER, filename)
            thumb_filename = "{0:s}_{1:s}.jpg".format(base_name, size)
            thumb_dir = os.path.join(UPLOAD_FOLDER, "thumb")
            file_path = os.path.join(UPLOAD_FOLDER, "thumb/{0:s}".format(thumb_filename))
            if not os.path.exists(file_path):
                if not os.path.exists(thumb_dir):
                    os.mkdir(thumb_dir)
                im = Image.open(ori_file)
                (x, y) = im.size
                y_s = int(size)
                x_s = x * y_s / y
                out = im.resize((x_s, y_s), Image.ANTIALIAS)
                out.save(file_path, "JPEG")
            return send_from_directory(thumb_dir, thumb_filename)
    return send_from_directory(AVATAR_FOLDER, filename)


if __name__ == '__main__':
    app.run(host='0.0.0.0', port=5001, debug=DEBUG)
コード例 #37
0
ファイル: run.py プロジェクト: tedw4rd/personal-website
from website import app
import os

app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 5000)))
コード例 #38
0
from website import app

if __name__ == "__main__":
    app.run(threaded=True)
コード例 #39
0
def run():
    app.run(debug=True)
コード例 #40
0
ファイル: app.py プロジェクト: lithekod/site-v2
from website import app

if __name__ == "__main__":
    app.run(debug=True, host='0.0.0.0')
コード例 #41
0
ファイル: runserver.py プロジェクト: Elemnir/cs560
from website import app
app.run(host='0.0.0.0', port=8000, debug=True)
コード例 #42
0
        db.session.add(t)
        db.session.add(p)
        t.tags.append(p)

        db.session.commit()

    for a in request.form.keys():
        print(a, request.form[a])
        return render_template("contact.html",
                               title='form sent!',
                               usercomment=p)
    else:
        title = 'contact form'
        return render_template("contact.html", title=title)


def initdb():
    """ Create database """
    db.create_all()
    # posts = buildPosts()
    print('Successful')


@login_manager.user_loader
def load_user(userid):
    return User.query.get(int(userid))


if __name__ == '__main__':
    app.run(port=8080)
コード例 #43
0
"""
This script runs the website application using a development server.
"""

from os import environ
from website import app

if __name__ == '__main__':
    HOST = environ.get('SERVER_HOST', 'localhost')
    try:
        PORT = int(environ.get('SERVER_PORT', '5555'))
    except ValueError:
        PORT = 5555
    app.run(HOST, PORT)
コード例 #44
0
from website import app

if __name__ == "__main__":
    app.run(debug=False)

# python
# from website import db
# db.create_all()
# exit()

# .\env\Scripts\activate
# python run.py
コード例 #45
0
from website import app

if __name__ == '__main__':
    app.debug = True
    app.run(port=3000)
コード例 #46
0
ファイル: main.py プロジェクト: Taptaplit/youtubeGoogle
from website import app

if __name__ == '__main__':
    app.run(port="3000", debug=True)  #f
コード例 #47
0
ファイル: wsgi.py プロジェクト: bopopescu/personal-website
from website import app

if __name__=="__main__":
    app.run()
コード例 #48
0
ファイル: run.py プロジェクト: yuanxili23/Thread_website
from website import app

app.run(host='0.0.0.0', port=5000)
コード例 #49
0
from website import app

if __name__ == '__main__':
    # app.run(port=5000, host='0.0.0.0', debug=True, )
    # static_files just define a new set of paths for the application. you can use any of them later. it is good if your
    # static files are split in multiple places
    app.run(
        port=5000,
        host='0.0.0.0',
        debug=True,
        # static_files={'/demo/static': '/home/disooqi/projects/dial-diac/website/demo/static'},
    )
コード例 #50
0
from website import app
#from settings import Development

app.config.from_object('settings.Development')

if __name__ == '__main__':
    app.run()
else:
    raise RuntimeError('This script should be run directly. DO NOT USE FOR WSGI')
コード例 #51
0
from website import app

if __name__ == "__main__":
    # reminder to turn off Debug at the end
    app.run(debug=True)
コード例 #52
0
ファイル: run.py プロジェクト: matt-cart/personal-website
from website import app

app.run('0.0.0.0', debug=True)