Add port to config file.
This commit is contained in:
		
							
								
								
									
										2
									
								
								config.ini
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								config.ini
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
				
			|||||||
 | 
					[DEFAULT]
 | 
				
			||||||
 | 
					PORT = 8080
 | 
				
			||||||
@@ -51,8 +51,13 @@ import arrow
 | 
				
			|||||||
import json
 | 
					import json
 | 
				
			||||||
import plotly
 | 
					import plotly
 | 
				
			||||||
import sqlite3
 | 
					import sqlite3
 | 
				
			||||||
 | 
					import ConfigParser
 | 
				
			||||||
from plotly.graph_objs import *
 | 
					from plotly.graph_objs import *
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					config = ConfigParser.ConfigParser()
 | 
				
			||||||
 | 
					config.read("config.ini")
 | 
				
			||||||
 | 
					port = config.getint('DEFAULT', 'PORT') 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
app = Flask(__name__)
 | 
					app = Flask(__name__)
 | 
				
			||||||
app.debug = True # Make this False if you are no longer debugging
 | 
					app.debug = True # Make this False if you are no longer debugging
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -217,4 +222,4 @@ def validate_date(d):
 | 
				
			|||||||
        return False
 | 
					        return False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if __name__ == "__main__":
 | 
					if __name__ == "__main__":
 | 
				
			||||||
    app.run(host='0.0.0.0', port=8080)
 | 
					    app.run(host='0.0.0.0', port=port)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user