Skip to content

Commit

Permalink
because migration
Browse files Browse the repository at this point in the history
  • Loading branch information
User Paste committed Jan 18, 2018
1 parent e3068fc commit a51ea94
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
5 changes: 5 additions & 0 deletions buildout.cfg
@@ -1,9 +1,12 @@
[buildout] [buildout]
extends = versions.cfg
parts = parts =
paulla.paste paulla.paste


develop = develop =
. .

versions = versions
[paulla.paste] [paulla.paste]
recipe = zc.recipe.egg recipe = zc.recipe.egg
eggs = eggs =
Expand All @@ -14,5 +17,7 @@ eggs =
paulla.paste paulla.paste
nose nose
coverage coverage
gunicorn
interpreter = python interpreter = python



14 changes: 12 additions & 2 deletions paulla/paste/__init__.py
Expand Up @@ -12,12 +12,22 @@ def main(global_config, **settings):
set_cache_regions_from_settings(settings) set_cache_regions_from_settings(settings)


config = Configurator(settings=settings) config = Configurator(settings=settings)


config.include('pyramid_fanstatic')
config.include('pyramid_beaker')
config.include('rebecca.fanstatic')
# config.include('pyramid_rpc.xmlrpc')


config.set_session_factory(sessionFactory) config.set_session_factory(sessionFactory)



get_current_registry().settings = settings get_current_registry().settings = settings


config.add_static_view('static', 'static', cache_max_age=3600) config.add_static_view('static', 'static', cache_max_age=3600)



config.add_route('home', '/') config.add_route('home', '/')
config.add_route('addContent', '/add') config.add_route('addContent', '/add')
config.add_route('oneContent', '/{idContent}') config.add_route('oneContent', '/{idContent}')
Expand All @@ -28,9 +38,9 @@ def main(global_config, **settings):
config.add_route('delete', '/{idContent}/delete') config.add_route('delete', '/{idContent}/delete')


config.add_route('rss2', '/feeds/rss2') config.add_route('rss2', '/feeds/rss2')

#import pdb; pdb.set_trace()
config.add_fanstatic_resources([resource.strip() for resource in settings['resources'].split(',')] config.add_fanstatic_resources([resource.strip() for resource in settings['resources'].split(',')]
, r'.*\.pt') , r'.*\.pt')


config.scan() config.scan()
return config.make_wsgi_app() return config.make_wsgi_app()
5 changes: 4 additions & 1 deletion paulla/paste/views.py
Expand Up @@ -130,7 +130,10 @@ def previous():
""" """
Return the list of the 10 previous paste. Return the list of the 10 previous paste.
""" """
previousPastes = Paste.view('paste/all', limit=10).all() try:
previousPastes = Paste.view('paste/all', limit=10).all()
except:
previousPastes = []
return previousPastes return previousPastes


@cache_region('long_term', 'lexers') @cache_region('long_term', 'lexers')
Expand Down
5 changes: 4 additions & 1 deletion production.ini
Expand Up @@ -7,9 +7,12 @@ pyramid.debug_notfound = false
pyramid.debug_routematch = false pyramid.debug_routematch = false
pyramid.default_locale_name = en pyramid.default_locale_name = en


couchdb.url = http://couchdb.paulla.asso.fr:5984
couchdb.db = paste

[server:main] [server:main]
use = egg:waitress#main use = egg:waitress#main
host = 192.168.42.180 host = 10.13.1.101
port = 6543 port = 6543


# Begin logging configuration # Begin logging configuration
Expand Down

0 comments on commit a51ea94

Please sign in to comment.