So basically this is a client server communication application which is been written in python and been successfully executed.For the same code i need to built a client separate and a server separately. My client Server program communicate on an self written algorithm which is included separately in the code already.. So i just need a help on how to add client and server separately in a project or should i create a separate project for client and server. Please help me out . I have tried different some method but that do not work.
Thank you for advance for the help
Related
I've been trying making websites recently and I am trying to make a python code to check some vulnerabilities and bugs that might occur on the website.
Issue is that I currently don't have a domain and can't test it with a real server so I was wondering, in the meantime, if I could send "requests" to the index.html file as if it were a real server somehow.
Anything would be greatly appreciated, thanks!
You could just make a real web server on your pc. Using Flask, docker, etc.
Then just point your python tests at that new web server.
I have been working on a project which involves multiple raspberry pi computers controlled using MQTT on a server computer.
The system is working well but at the moment I am manually publishing using the mosquitto command line interface to control the computers. I would like to set up a web interface on the local server so that I can control the computers using my phone/ipad etc.
I would like to have buttons that publish to a specific topics and also a control that will accept text and publish to a topic with the text as the payload.
I don’t have a lot of experience in web programming and I would like use python if possible as I am already familiar with it.
does anyone have any suggestions as to how i would implement it and where i can find a tutorial?
thanks for your help.
You could use something like SimpleHTTPServer to build a web interface to forward messages to MQTT
Or you could use the Paho MQTT js library and a MQTT server that supports websockets (e.g. mosquitto 1.4) and send MQTT messages directly from the webpage.
Currently in my code, there are a few client machines doing processing and one server machine with a database. After an individual client machine finishes processing some data, it saves the data to a .txt file and sftp's it over to the server.
The server has a job that just waits for these txt files and stores the data into a database.
I wanted to know of any other efficient processes for this, kinda a python beginner. Is there a way to remotely save data into the database of the server? How to do so securely, etc?
To be more specific, this project is a webapp hosted in django. I know how to use django's standalone scripts to save data into a db, just preferably need to know how to do so remotely.
Thank you.
Django databases can be remote - there is no requirement they be on the same host at the django server. Just set an appropriate HOST and PORT. See: https://docs.djangoproject.com/en/dev/ref/databases/#id10
Update: Based on your comment, I understand that you want to write python/django code that will run in the browser, and connect to a remote database. There is no practical way of doing this. Have the data sent back to your server, and forward it on from there.
Update 2: If you are able to distribute software outside of the browser, you could have a small django deployment on each client computer, which the user connects to through their browser, which could connect directly to the database. Obviously, security considerations apply.
I am quite new to heroku and I reached a bump in my dev...
I am trying to write a server/client kind of application...on the server side I will have a DB(I installed postgresql for python) and I was hoping I could reach the server, for now, via a python client(for test purposes) and send data/queries and perform basic tasks on the DB.
I am using python with Heroku, I manage to install the DB and it seems to be working(i.e i can query, insert, delete, etc...)
now all i want is to write a server(in python) that would be my app and would listen on a port and receive messages and then perform whatever tasks it is asked to do...I tought about using sockets for this and have managed to write a basic server/client locally...however when I deploy the app on heroku i cannot connect to the server and my code is basically worthless
can somebody plz advise on the basic framework for this sort of requirements...surely I am not the first guy to want to write a client/server app...if you could point to a tutorial/doc i would be much obliged.
Thx
Heroku is for developing Web (HTTP, HTTPS) applications. You can't deploy code that uses socket to Heroku.
If you want to run your app on Heroku, the easier way is to use a web framework (Flask, CherryPy, Django...). They usually also come with useful libraries and abstractions for you to talk to your database.
I'm new to 'network' programming. I've done throughout the Google app engine tutorial and I'm trying to make my own application which is guestbook. It has a server script on Google app engine and client app is running on iPhone.
But how do I check if the server is received my message from iPhone?
or How do I debug the script I wrote on server side? (it's an python script)
I want to make sure the data is in right format and other stuff.
Please somebody give me a link if there's good tutorial or good place to start. thanks.
In your code you should be using tons of logging calls. In the app engine dashboard for your app there is an option to view logs, and all of your logging calls will show up in there (and can be filtered in various ways).
There are also ways to run dev_appserver.py and debug locally using software like PyDev, but you'd have to make your iPhone app send its messages to the address of your local server.