Skip to content

Commit bd4b181

Browse files
committed
Added new pa_reload_webapp.py helper script. by: Giles
1 parent cdac401 commit bd4b181

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

scripts/pa_reload_webapp.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/python3.5
2+
"""Reloads the given site
3+
4+
Usage:
5+
pa_reload_webapp.py <domain>
6+
7+
Options:
8+
<domain> Domain name, eg www.mydomain.com
9+
"""
10+
11+
from docopt import docopt
12+
import os
13+
import sys
14+
15+
from pythonanywhere.api import Webapp
16+
from pythonanywhere.snakesay import snakesay
17+
18+
19+
def main(domain_name):
20+
webapp = Webapp(domain_name)
21+
webapp.reload()
22+
print(snakesay(
23+
"{} has been reloaded".format(domain_name)
24+
))
25+
26+
27+
if __name__ == '__main__':
28+
arguments = docopt(__doc__)
29+
main(arguments['<domain>'])

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
setup(
1111
name='pythonanywhere',
12-
version='0.7.4',
12+
version='0.8.1',
1313
description='PythonAnywhere helper tools for users',
1414
long_description=long_description,
1515
long_description_content_type="text/markdown",
@@ -43,6 +43,7 @@
4343
scripts=[
4444
'scripts/pa_install_webapp_letsencrypt_ssl.py',
4545
'scripts/pa_install_webapp_ssl.py',
46+
'scripts/pa_reload_webapp.py',
4647
'scripts/pa_start_django_webapp_with_virtualenv.py',
4748
'scripts/pa_autoconfigure_django.py',
4849
'pythonanywhere/snakesay.py',

0 commit comments

Comments
 (0)