##// END OF EJS Templates
core: use common bootstrap for pyramid app
marcink -
r2189:bf1dfb34 default
parent child Browse files
Show More
@@ -20,8 +20,7 b''
20
20
21 import click
21 import click
22
22
23 from pyramid.paster import bootstrap
23 from rhodecode.lib.pyramid_utils import bootstrap
24 from pyramid.request import Request
25 import pyramid.paster
24 import pyramid.paster
26
25
27 # imports, used in ipython shell
26 # imports, used in ipython shell
@@ -45,8 +44,7 b' or reset some user/system settings.'
45 def main(ini_path):
44 def main(ini_path):
46 pyramid.paster.setup_logging(ini_path)
45 pyramid.paster.setup_logging(ini_path)
47
46
48 request = Request.blank('/', base_url='https://rhodecode-app.com/')
47 with bootstrap(ini_path) as env:
49 with bootstrap(ini_path, request=request) as env:
50
48
51 try:
49 try:
52 from IPython import embed
50 from IPython import embed
@@ -20,8 +20,7 b''
20
20
21 import click
21 import click
22
22
23 from pyramid.paster import bootstrap
23 from rhodecode.lib.pyramid_utils import bootstrap
24 from pyramid.request import Request
25 import pyramid.paster
24 import pyramid.paster
26
25
27
26
@@ -30,6 +29,5 b' import pyramid.paster'
30 def main(ini_path):
29 def main(ini_path):
31 pyramid.paster.setup_logging(ini_path)
30 pyramid.paster.setup_logging(ini_path)
32
31
33 request = Request.blank('/', base_url='https://rhodecode-app.com/')
32 with bootstrap(ini_path) as env:
34 with bootstrap(ini_path, request=request) as env:
35 print(env['request'].application_url) No newline at end of file
33 print(env['request'].application_url)
@@ -20,8 +20,7 b''
20
20
21 import click
21 import click
22
22
23 from pyramid.paster import bootstrap
23 from rhodecode.lib.pyramid_utils import bootstrap
24 from pyramid.request import Request
25 import pyramid.paster
24 import pyramid.paster
26
25
27
26
@@ -30,8 +29,7 b' import pyramid.paster'
30 def main(ini_path):
29 def main(ini_path):
31 pyramid.paster.setup_logging(ini_path)
30 pyramid.paster.setup_logging(ini_path)
32
31
33 request = Request.blank('/', base_url='https://rhodecode-app.com/')
32 with bootstrap(ini_path) as env:
34 with bootstrap(ini_path, request=request) as env:
35 print(env['request'].application_url)
33 print(env['request'].application_url)
36
34
37
35
General Comments 0
You need to be logged in to leave comments. Login now