All Questions

Tagged with
Filter by
Sorted by
Tagged with
129 votes
2 answers
154k views

How to measure server response time for Python requests POST-request

I create POST requests with requests as follows, with a specified timeout threshold: response = requests.post(url, data=post_fields, timeout=timeout) However, to determine a "good" threshold,...
Shuzheng's user avatar
  • 12.3k
70 votes
5 answers
53k views

ipython server can't launch: No module named notebook.notebookapp

I've been trying to setup an ipython server following several tutorials (since none was exactly my case). A couple days ago, I did manage to get it to the point where it was launching but then was not ...
LudoC's user avatar
  • 919
61 votes
11 answers
158k views

django development server, how to stop it when it run in background?

I use a Cloud server to test my django small project, I type in manage.py runserver and then I log out my cloud server, I can visit my site normally, but when I reload my cloud server, I don't know ...
bricks's user avatar
  • 727
58 votes
1 answer
165k views

What does "app.run(host='0.0.0.0') " mean in Flask [duplicate]

I am reading the Flask documentation. I was told that with app.run(host='0.0.0.0'), I could make the server publicly available. What does it mean ? How can I visit the server in another computer (...
Ding's user avatar
  • 589
42 votes
8 answers
71k views

Install Anaconda on Ubuntu (or Linux) via command line

I would like to install Anaconda on a remote server. The server is running Ubuntu 12.04. I only have access to this server via SSH. How can I install Anaconda via the command line?
JNevens's user avatar
  • 11.6k
27 votes
10 answers
59k views

cannot quit jupyter notebook server running

I am using Jupyter Notebook for a project. Since I ssh into a linux cluster at work I use ssh -Y -L 8000:localhost:8888 user@host Then I start the notebook with jupyter notebook --no-browser & ...
Joalito's user avatar
  • 655
26 votes
4 answers
29k views

How to increase message size in grpc using python

I am using grpc for message passing and am testing a simple server and client. When my message size goes over the limit, I get this error. grpc._channel._Rendezvous: <_Rendezvous of RPC that ...
Dumbo's user avatar
  • 1,088
26 votes
1 answer
3k views

Locust.io Load Testing getting "Connection aborted BadStatusLine" Errors

I'm using Locust.io to load test an application. I will get a random error that I am unable to pinpoint the problem: 1) ConnectionError(ProtocolError(\'Connection aborted.\', BadStatusLine("\'\'&...
arcane's user avatar
  • 457
25 votes
9 answers
34k views

Extract domain name from URL in Python

I am tring to extract the domain names out of a list of URLs. Just like in https://stackoverflow.com/questions/18331948/extract-domain-name-from-the-url My problem is that the URLs can be about ...
kobibo's user avatar
  • 403
25 votes
5 answers
33k views

What is the easiest way to run python scripts in a cloud server?

I have a web crawling python script that takes hours to complete, and is infeasible to run in its entirety on my local machine. Is there a convenient way to deploy this to a simple web server? The ...
user1330691's user avatar
  • 1,017
22 votes
3 answers
63k views

ModuleNotFoundError: No module named 'fcntl' [duplicate]

for flask application run using gunicorn $ pip install gunicorn $ gunicorn --bind 0.0.0.0:8000 app:app getting error Traceback (most recent call last): File "C:\Users\shubham\AppData\Local\...
Shubham Singh's user avatar
21 votes
1 answer
2k views

Bokeh server callback initiated from Flask application

I am building an app using the Flask-AppBuilder framework, and have successfully embedded a bokeh plot using autoload_server to insert the script src into my html template. At the moment, I have a ...
GratefulGuest's user avatar
20 votes
2 answers
45k views

Run Spyder /Python on remote server

So there are variants of this question - but none quite hit the nail on the head. I want to run spyder and do interactive analysis on a server. I have two servers , neither have spyder. They both have ...
pythOnometrist's user avatar
19 votes
3 answers
142k views

Python, How to Send data over TCP

I need to create a simple server that listens for TCP connections. If it receives text on<EOF> or off<EOF> then it sends (echo) back success. The receiving part is working, but now i need ...
Ingmar05's user avatar
  • 631
16 votes
2 answers
38k views

How to run a server in python

How to run a server in python? I already have tried: python -m SimpleHTTPServer python -m HTTPServer but its says to me: invalid syntax Can someone help me? Thanks!
CALISVALIS1010's user avatar
16 votes
3 answers
9k views

Gunicorn + nginx - Ignoring EPIPE

I have an nginx-gunicorn-flask setup running on google compute and I keep getting the following from gunicorn: [2019-04-19 20:50:49 +0000] [3345] [DEBUG] POST / [2019-04-19 20:50:49 +0000] [3345] [...
K41F4r's user avatar
  • 1,503
15 votes
2 answers
24k views

How to close socket connection on Ctrl-C in a python programme

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((HOST, PORT)) s.listen(1) any_connection = False while True: try: conn, addr = s.accept() data = conn.recv(1024) ...
David Gomes's user avatar
  • 5,855
15 votes
3 answers
39k views

Error with gunicorn server start

On an external server, I tried to run the command: gunicorn --bind 0.0.0.0:8000 jeremiesblog.wsgi:application I got this error: [2017-01-29 15:08:02 +0000] [19640] [INFO] Starting gunicorn 19.4.5 [...
user avatar
15 votes
2 answers
568 views

Robust endless loop for server written in Python

I write a server which handles events and uncaught exceptions during handling the event must not terminate the server. The server is a single non-threaded python process. I want to terminate on ...
guettli's user avatar
  • 27.2k
14 votes
3 answers
28k views

Cannot connect to python -m SimpleHTTPServer server

this this probably a very simple question, but I haven't been able to find an answer anywhere. On the online articles about it, they didn't show the exact process to share a directory using ...
Student Loans's user avatar
14 votes
2 answers
74k views

The requested address is not valid in its context error

I was following a tutorial called "Black Hat Python" and got a "the requested address is not valid in its context" error. I'm Python IDE version: 2.7.12 This is my code: import socket import ...
MountainSide Studios's user avatar
14 votes
2 answers
28k views

Reload python flask server by function

I'm writing a python/flask application and would like to add the functionality of reloading the server. I'm currently running the server with the following option app.run(debug=True) which results ...
mohrphium's user avatar
  • 353
13 votes
2 answers
18k views

SimpleHTTPServer not found python3

I'm trying to write a simple server in python. So after watching tutorial, I'm trying to import a few modules. from http.server import HTTPServer from http.server import SimpleHTTPServer As the doc ...
Danial's user avatar
  • 582
13 votes
4 answers
28k views

ImportError: No module named 'appdirs'

I'm trying to get a program called hangoutsbot to work on my linux server. I'm currently using a digital ocean server. However, every time I try to run the script it gives me an error that says: ...
Alex's user avatar
  • 528
12 votes
4 answers
20k views

Serve directory in Python 3

I've got this basic python3 server but can't figure out how to serve a directory. class SimpleHTTPRequestHandler(BaseHTTPRequestHandler): def do_GET(self): print(self.path) ...
Wayneio's user avatar
  • 3,496
12 votes
3 answers
59k views

Simple Python server to process GET and POST requests with JSON

I'm trying to create a simple Python server in order to test my frontend. It should be able to handle GET and POST requests. The data should be always in JSON format until they are translated to HTTP ...
Peter G.'s user avatar
  • 7,914
12 votes
3 answers
19k views

Python -m http.server 443 -- with SSL?

Is it possible to create a temporary Python3 HTTP server with an SSL certificate? For example: $ python3 -m http.server 443 --certificate /path/to/cert
vskbdvds's user avatar
  • 203
12 votes
3 answers
15k views

Static files not found with webpack and django

The problem is that I can get access to the app on the browser but not static assets (js, jsx and images). Technologies I am using: django-webpack-loader 0.2.4 React 0.14 Django 1.8.5 Python 2.7 ...
ChesterL's user avatar
  • 347
11 votes
3 answers
78k views

flask - Display database from python to html

I have code like this to retrieve data from database and I want to display it in html. This is app.py @app.route('/news') def news(): import pymysql import re host='localhost' user =...
David Herlianto's user avatar
11 votes
1 answer
16k views

Django is synchronous or asynchronous?

Django is synchronous or asynchronous? I want to know that the Django Framework is Synchronous or Asynchronous. I have heard about the interview problems they ask about the framework you are using is ...
SUMIT KUMAR's user avatar
11 votes
5 answers
33k views

How to shut down python server

Used this code to run a python server: import os from http.server import SimpleHTTPRequestHandler, HTTPServer ...
Tom Bar-Gal's user avatar
10 votes
1 answer
3k views

NGINX + Flask, without Gunicorn?

I am new to this, but by comparing the code of gunicorn with flask/werkzeug, I fail to understand the real benefit of inserting gunicorn between nginx and flask. Would like to get some expert opinions ...
QnA's user avatar
  • 1,073
10 votes
1 answer
1k views

How does distributed tensorflow work ? (Issue with tf.train.Server)

I have some troubles with the new option of tensorflow that allows us to run distributed tensorflow. I just would like to run 2 tf.constant with 2 tasks but my code never ends. it looks like that : ...
Maxence Queyrel's user avatar
8 votes
2 answers
3k views

Start http web server then open browser

I'm trying to start a simple HTTP server then open it in the default browser. I don't know what I'm doing wrong, it's either not starting the server at all, or it's stopping as soon as it gets to the ...
fadelm0's user avatar
  • 293
8 votes
1 answer
9k views

ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting

I try to install reddit on a 12.04 ubuntu server but I get an error Please see the lines from terminal below. Please help me to fix it. I get this error after the ff line "sudo python setup.py ...
Esembled INTL's user avatar
8 votes
4 answers
51k views

How do I make a list of all members in a discord server using discord.py?

I am writing a discord bot and I came across this error when trying to pull all the members from a server with the command !members in on_message event: elif message.content.startswith('!members'): ...
Dragomir Aki's user avatar
8 votes
4 answers
30k views

Reading from asyncio StreamReader

I am trying to extend the python asyncio HTTP server example that uses a streaming reader/writer (code). If I understand it correctly, the example handler read 100 bytes from the reader and echoes it ...
jdowner's user avatar
  • 727
8 votes
4 answers
21k views

HTTP Server Not Working (Python)

This is my first time trying to get HTTP servers working on my computer, so I have run into a few technical difficulties. I am using Python to develop the server, and I can access it on my localhost. ...
user avatar
8 votes
3 answers
563 views

How to write an array tag in a VARIANT structure on an OpenOPC server

I'm trying to communicate with an OPC DA server and need to write in a tag which is in an array format. We can connect with a simulation server, read tags (int, real, array) and write tags (int, real, ...
Simon F.-Smith's user avatar
8 votes
2 answers
7k views

PyCUDA context error when using Flask

I am using the PyCUDA to implement the smooth_local_affine as shown here. It works well when I simply run the program on linux. But when I tried to import it under Flask context: from ...
cloudwayx's user avatar
8 votes
2 answers
3k views

How to make centralized Login server with Django?

Where I work currently there are many Django projects, each running on their own VPS, and each is running under their own subdomain (foo.example.com, bar.example.com, ...) as shown in the following ...
c0x6a's user avatar
  • 427
8 votes
0 answers
6k views

How to start Gunicorn server from python script

I've built a Django project that works, even after I freeze it using Cx_Freeze and Py2exe. Now I'm trying to set up the project for distribution, which requires a real webserver. I'm going for ...
mrj's user avatar
  • 619
7 votes
1 answer
7k views

@method_decorator(csrf_exempt) NameError: name 'method_decorator' is not defined

I was following the following guide (https://abhaykashyap.com/blog/post/tutorial-how-build-facebook-messenger-bot-using-django-ngrok) on how to create a chatbot, until the part where I updated the ...
iteong's user avatar
  • 725
7 votes
2 answers
40k views

How to send a message from client to server in python

I'm reading two programs in Python 2.7.10 with client and server. How can I modify these programs in order to send a message from client to server? server.py: #!/usr/bin/python # This is ...
Stamatis Papadopoulos's user avatar
7 votes
1 answer
20k views

How to create a very simple DNS server using Python?

I just want to create a DNS Server who listen to requests and always return the same specific ip. I'm using Python....
Larry Valdes's user avatar
7 votes
2 answers
6k views

Python 3; Websockets Server & HTTP Server - run_forever & serve_forever

I am trying to run a websockets server and an http server in the same python application. It looks like I'm trying to run two forever loops and the 2nd loop is not getting activated. Any advice on how ...
user1898041's user avatar
7 votes
1 answer
5k views

What is "Application startup file" option on Cpanel python application?

I'm trying to deploy my django project to my host using cpanel, but there are some new options in Create python applications tab. What should i set for the following items: "Application startup file" ...
Overlord's user avatar
  • 152
7 votes
1 answer
14k views

How does python's SimpleHTTPServer do_GET and do_POST functions work?

I've created the following little HTTP server for learning purposes: import SimpleHTTPServer import SocketServer class ServerHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_GET(self):...
MarkMark's user avatar
  • 185
7 votes
2 answers
22k views

How to set a global variable in python flask? [duplicate]

I would like to set a global variable and use it as a trigger of various functions. Each user has a separate global variable. This is used to keep track of previous message data and proceed a ...
Julianna Lee's user avatar
7 votes
3 answers
2k views

How to run the Python program in the background in Ubuntu server

I have a python script. Script have selenium with Chrome and go to a website, take data and put in CSV file. This is a very long work. I put the script on the server. And run. All work. But I need ...
Serhii's user avatar
  • 1,487

1
2 3 4 5
48