If you only used MAMP not MAMP Pro, below is the files you will dealing with. If you curious where the MAMP PRO store the virtual host file, you can browse to here tail -fn1000 ~/Library/Application\ Support/appsolute/MAMP\ PRO/nf Finally, go the the browser type your domains name, e.g.: Select the Apache Tab and Insert the WSGIScriptAliasĥ. Configure port and double check your configurationĤ. Give a host name, and select your document root. From the MAMP PRO UI, Select Hosts and click the plus sign Ģ. # To include the application's path in the Python search path Print(' * Loading configuration ""'.format(config_name))Īctivate_this = os.path.join(os.path.dirname(_file_), 'venv/bin', 'activate_this.py')Įxecfile(activate_this, dict(_file_=activate_this)) # Set environment variable FLASK_PROFILE to production, or default to local mode #Ĭonfig_name = os.environ.get('FLASK_PROFILE') or 'local' release import release as release_blueprint # Import a module / component using its blueprint handlerįrom. LogHandler = RotatingFileHandler(log_file, maxBytes=1000, backupCount=1) Log_file = os.path.abspath(os.path.join(os.path.dirname(_file_),".", "logs", "error.log"))
structure + įrom logging.handlers import RotatingFileHandlerĬfg = os.path.join(os.path.dirname(_file_), '.', 'config', config_name + '.py')Īpp.config = '\xc9\x1c\xda\xce'
#Mamp pro deploy how to#
This tutorial show how to use MAMP or MAMP PRO configure vhost running python flask with virtual environment.īelow I’ll only show you the important file that you’d need to know, if you’d like to know more about flask application, you can learn from other website.