How to create a website with the server pc using only Python?

Asked

Viewed 58 times

-4

summary explanation

think of the site as an app. I need to create a mobile app that accesses functions on the pc via commands. when it comes to handling the commands and the function call I even understand how to do, the problem is that I can’t work the web data transfer to pc. Unfortunately my area is not web, so I would really appreciate the help. ''whether or not to use python, my only real constraint is not to use javascript and html... css, xhtml, Django, or other languages are allowed'''

ps: no need to be online, a local server is enough

long explanation

I have a friend who is the famous javascript fanboy, and I didn’t even know that this existed, he basically proposes that js should be used at all, including in place of low-level languages. I understand the value of js, also like those of other languages, and as such I could not simply refrain from going against this thesis. The choice of python was not arbitrary, it is my mother language and the one that I most dominate, as well as the system that I set out to do because it will be really useful for me. so I decided to develop a tool within the predominant field of js, the web, that would make my life easier as a python developer.

  • 1

    Your question is too broad and there are many concepts behind it that you will need to learn to do what you want. You’ll need to set up an HTTP server on your local machine, you’ll need to set up your entire network to allow external access to it, configure your server to communicate with the Python interface, then run the code you need. See this question: How to configure apache2 for python 3.5.2 to get an initial sense. And study HTTP, it is very important to know the protocol you are using.

1 answer

0

To respond to small calls via HTTP with arbitrary Python functions, the simplest is to use a microframework like Flask - take a look at Flask’s own hello world - http://flask.pocoo.org/docs/1.0/tutorial/

Django is a good one, but he’ll already create a project where it’s more boring to set up view urls, and assumes you’ll use a database with ORM, which may not even be your case.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.