mirror of
				https://github.com/ets-labs/python-dependency-injector.git
				synced 2025-10-30 23:47:40 +03:00 
			
		
		
		
	Add Flask extension
This commit is contained in:
		
							parent
							
								
									8466e2801e
								
							
						
					
					
						commit
						afffc07a38
					
				|  | @ -1,9 +1,10 @@ | |||
| """Application module.""" | ||||
| 
 | ||||
| from dependency_injector import containers, providers | ||||
| from dependency_injector.ext.flask import create_app, Route | ||||
| from github import Github | ||||
| 
 | ||||
| from . import services, views, webapp | ||||
| from . import services, views | ||||
| 
 | ||||
| 
 | ||||
| class Application(containers.DeclarativeContainer): | ||||
|  | @ -30,9 +31,9 @@ class Application(containers.DeclarativeContainer): | |||
|     ) | ||||
| 
 | ||||
|     app = providers.Factory( | ||||
|         webapp.create_app, | ||||
|         create_app, | ||||
|         name=__name__, | ||||
|         routes=[ | ||||
|             webapp.Route('/', 'index', index_view, methods=['GET']), | ||||
|             Route('/', 'index', index_view, methods=['GET']), | ||||
|         ], | ||||
|     ) | ||||
|  |  | |||
							
								
								
									
										1
									
								
								src/dependency_injector/ext/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								src/dependency_injector/ext/__init__.py
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1 @@ | |||
| """Extensions package.""" | ||||
|  | @ -1,4 +1,4 @@ | |||
| """Web application module.""" | ||||
| """Flask extension module.""" | ||||
| 
 | ||||
| from flask import Flask | ||||
| 
 | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user