-
Notifications
You must be signed in to change notification settings - Fork 1
/
manage.py
33 lines (26 loc) · 838 Bytes
/
manage.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python
""" Teste Técnico
Criar uma página única (Single page application) de cadastro
de pessoas (nome, sobrenome e endereço) utilizando HTML,
Javascript, CSS, MySQL e PHP (ou Python).
Todo:
None
"""
from src.wsgi import router
import src.settings as conf
class Server():
"""
Server class:
Habilita o servidor na porta definida nas configurações e com a função "router"
para definir as rotas.
"""
def __init__(self):
try:
from wsgiref.simple_server import make_server
httpd = make_server('', conf.PORT, router)
print('Serving on port {}'.format(conf.PORT))
httpd.serve_forever()
except KeyboardInterrupt:
print('Shutdown Server via Keyboard.')
if __name__ == '__main__':
Server()