Commit 41e0ae64 authored by Kiste's avatar Kiste
Browse files

Proper FastCGI support

parent f5bd9cc0
{
"user": "username",
"password": "secretpassphrase"
}
......@@ -15,6 +15,9 @@ setup(
'feedgen',
'requests'
],
extras_require={
'FastCGI support': ['flipflop']
},
entry_points={
'console_scripts': [
'studfeed = studfeed.studfeed:main'
......
#!/path/to/python3
# -*- coding: utf-8 -*-
from .studfeed import generate_feed
import json
from studfeed.studfeed import generate_feed
from flipflop import WSGIServer
USER = ''
PASSWORD = ''
CONFIGPATH = '/path/to/config.json'
def application(environ, start_response):
try:
feed = generate_feed(USER, PASSWORD).atom_str()
feed = generate_feed(config['user'], config['password']).atom_str()
except:
start_response('500 Internal Server Error', [('Content-Type', 'text/plain')])
return []
start_response('200 OK', [('Content-Type', 'application/atom+xml'), ("Content-Length", str(len(feed)))])
return [feed]
with open(CONFIGPATH) as configfile:
config = json.load(configfile)
WSGIServer(application).run()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment