I tried to make the question as simple as possible and at the same time so that it would reflect the desired result by 100%.

A person needs everything to be like with Apache: "put index.html, daddy css, js in htdocs (just landing page, by the way)" and it all worked right away, without having to make edits. Is it possible? python 2 (3 unfortunately not)

Closed due to the fact that off-topic participants dlarchikov , pavel , ermak0ff , user194374, Denis Bubnov 13 Feb '17 at 11:11 .

  • Most likely, this question does not correspond to the subject of Stack Overflow in Russian, according to the rules described in the certificate .
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • Why do you need Python for this functionality? What prevents to continue using apache? - jfs
  • Hi jfs The answer to your question is simple: that is the problem. - Noneme
  • Do you understand that web server and web framework are different concepts? - jfs
  • jfs Yes of course. - Noneme
  • 2
    This question should be closed, because the author received an answer to the question, but in the comments he asks, in fact, another question. This should be closed - dlarchikov

2 answers 2

If I understand you correctly - you need a web server that publishes a directory.

Take the standard http server module . To publish a directory you need to run:

cd $workdir python2.7 -m SimpleHTTPServer $port 

If you need to set up routes and templates, POST requests, authorization or work with the database - use Flask, CherryPy, or Django.

  • There just landing page. By the way, it is interesting how a person will then process the form. - Noneme
  • I would take Flask and use Flask-RESTful, but it's easier to describe the handler via if request.method == "POST": response for / index - Tihon

Did you look towards django ?

What Python version can I use with Django?

Django version> Python versions

1.8> 2.7, 3.2 (until the end of 2016), 3.3, 3.4, 3.5

1.9.1.10> 2.7, 3.4, 3.5

1.11> 2.7, 3.4, 3.5, 3.6

2.0> 3.5+

django contains an embedded web server. On the syllable above, you can not even read, just make two teams of blue blocks and it will work.

  • 1. Created a test project with the command: sudo django-admin startproject myproject 2. Started the server with the command: python manage.py runserver 8080 3. The test page opens, everything works, ok. Question: how can I slip the index.html file and css, js folders to the server now? :) - Noneme
  • @Noneme, this is essentially another matter that needs to be arranged separately. - dlarchikov