mirror of
https://github.com/Tygs/0bin.git
synced 2023-08-10 21:13:00 +03:00
404 error are now in red with a more explicit message. Local settings support have been added, and debug default value set to false
This commit is contained in:
parent
4b1697e794
commit
2e537cd22b
1
.gitignore
vendored
1
.gitignore
vendored
@ -28,3 +28,4 @@ dist
|
||||
content
|
||||
*.sublime-project
|
||||
*.sublime-workspace
|
||||
settings_local.py
|
||||
|
10
settings.py
10
settings.py
@ -11,7 +11,7 @@ STATIC_FILES_ROOT = os.path.join(ROOT_DIR, 'static')
|
||||
|
||||
# debug will get you error message and auto reload
|
||||
# don't set this to True in production
|
||||
DEBUG = True
|
||||
DEBUG = False
|
||||
|
||||
# absolute path where the paste files should be store
|
||||
# default in projectdirectory/static/content/
|
||||
@ -31,3 +31,11 @@ GROUP = None
|
||||
# browser
|
||||
MAX_SIZE = 1024 * 500
|
||||
MAX_SIZE_KB = int(math.ceil(MAX_SIZE / 1024.0))
|
||||
|
||||
# this import a file named settings_local.py if it exists
|
||||
# you may want to create such a file to have different settings
|
||||
# on each machine
|
||||
try:
|
||||
from settings_local import *
|
||||
except ImportError:
|
||||
pass
|
4
start.py
4
start.py
@ -93,7 +93,9 @@ def display_paste(paste_id):
|
||||
#abort(404, u"This paste doesn't exist or has expired")
|
||||
return error404(ValueError)
|
||||
|
||||
return {'paste': paste, 'keep_alive': keep_alive, 'max_size': settings.MAX_SIZE, 'max_size_kb': settings.MAX_SIZE_KB}
|
||||
return {'paste': paste, 'keep_alive': keep_alive,
|
||||
'max_size': settings.MAX_SIZE,
|
||||
'max_size_kb': settings.MAX_SIZE_KB}
|
||||
|
||||
|
||||
@app.error(404)
|
||||
|
@ -1,8 +1,8 @@
|
||||
<p class="alert">
|
||||
<p class="alert alert-error">
|
||||
<a class="close" data-dismiss="alert" href="#">×</a>
|
||||
<strong class="title">Error!</strong>
|
||||
<strong class="title">404 Error!</strong>
|
||||
<span class="message">
|
||||
This paste has expired or wrong url, please check again.
|
||||
Either this paste has expired or this page never existed.
|
||||
</span>
|
||||
</p>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user