I have simply created a python server with :
python -m SimpleHTTPServer
I had a .htaccess (I don\'t know if it is usefull with python serve
Have you tried using Flask? It's a lightweight server library that makes this really easy.
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World '
if __name__ == '__main__':
app.run(debug=True)
The return value, in this case , is rendered has HTML. You can also use HTML template files for more complex pages.
Here's a good, short, youtube tutorial that explains it better.