This repository has been archived by the owner on Nov 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #263 from gratipay/startapp
Upgrading Aspen to 0.37+
- Loading branch information
Showing
15 changed files
with
69 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
web: aspen --network_address :$PORT --www_root=./www/ --project_root=./ | ||
web: python startapp.py --port=$PORT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env python | ||
""" | ||
The main script to start website for development, | ||
which also exports WSGI application for production. | ||
""" | ||
|
||
HOST = '' # by default run on all interfaces | ||
PORT = 8537 # default/devserver port | ||
|
||
import sys | ||
from aspen.website import Website | ||
|
||
aspen_config = [ | ||
'--www_root=www/', | ||
'--project_root=.' | ||
] | ||
|
||
for param in sys.argv: | ||
if param.startswith('--port'): | ||
_, PORT = param.split('=') | ||
PORT = int(PORT) | ||
|
||
|
||
# by WSGI convention, we need to create webapp object | ||
# and by default most WSGI servers look for 'application' | ||
application = Website(aspen_config) | ||
|
||
if __name__ == '__main__': | ||
from wsgiref.simple_server import make_server | ||
print("* Running development server on http://%s:%s" % (HOST, PORT)) | ||
make_server(HOST, PORT, application).serve_forever() | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters