Newest python Questions

Q&A for system and network administrators

Python on Passenger: 500 Internal Server Error logging [migrated]

I'm writing a Flask web application using Passenger on a Dreamhost virtual (shared) host. This means I don't have access to the global Apache error log which, apparently, is where stderr gets sent. ...

How Uninstall pip and python

I wanted to install version 3 of python and pip but instead issued sudo apt-get install python-pip python-dev how do I uninstall python and pip, I tried sudo apt-get uninstall but did not work, what ...

Make Pythonanywhere web server act like Django's built in server

Django's built in server updates apps in real time. In PythonAnywhere one has to reload manually. Is there a way to make PythonAnywhere web server act like the built in feature of Django?

Interprocess communication with uWSGI

I have a uWSGI application that accepts data over the internet and another process that responds to that data in a queue-like fashion. I send want to send data from the uWSGI application to the second ...

rsync-path: No such file or directory when used with subprocess.Popen

I use rsync to deploy code from one server to another. On a staging directory I build the application by placing all files (e.g. php scripts) like they should appear on the remote application server (...

uWSGI scripts - not writing to file

I've recently installed uWSGI on a Ubuntu/nginx server (which I found quite challenging, but that's by the way). I've taken a simple hello world script and verified that it works as expected. I've ...

How upgrade version pip by proxy?

for my task need install pywin32 pack. Python can install new pack only by proxy. pip --proxy http://<username>:<password>@<hostname>:<port> install pywin32 But installing ...

why yum could not find the python-pip packages on some PCs

I got a very strange problem and cannot figure out why. When I run yum info python-pip command on some CentOS 7 machines, it returns Error: No matching Packages to list. But, I used to install python-...

SaltStack: How to implement custom Jinja Filter?

I want to extend the jinja filters which are avaiable in SaltStack I want to create a simple filter called rpm_to_debian_name { package-name | rpm_to_debian_name } I only found docs about the salt ...

QGIS-Server Plugin Process per client (WMS, Apache2, FCGI)

I have a working infrastructure containing Apache2 with FCGI and QGIS-Server bundled in a Docker Container to deliver a WMS. My written Plugin (Python) for QGIS-Server is working like expected. It ...

Python GUI with paramiko [migrated]

I am trying to write a Python CGI script where user can enter Name(hostname) and Choose Memory from form and then via using paramiko module it will execute free -m command to the given node import ...

ImportError: No module named site. On CentOS 7 + python3.5

I'm trying to setup server few days in a row with no luck, I checked all the related topics and didn't find solution for the problem. I'm using CentOS 7, mod_wsgi, apache, python3.5 under ...

Error connecting to mysql fabric via python script [duplicate]

I have three VMs running on Windows Azure. Two VMs running mysql database, the third VM running mysql fabric node. When I tried to use python connector to connect to fabric node, this problem happens: ...

Django 1.10.3 Apache wsgi - ImportError: cannot import name signals

Overnight django stopped working, possibly because of an automatic package upgrade on the server. Its wsgi script now fails to load in production, but running the development server works fine. What ...

Why is my Windows BuildBot service failing immediately with error 7000?

I'm setting up a BuildBot worker in a Windows Server 2016 Datacenter Edition VM running on Azure. This is going build our product for Windows, using the Visual Studio C++ compiler. I've got to the ...

deploy Django 1.10 project with Python 3.5 to Azure

just wanna know if I can deploy Django 1.10 project with Python 3.5 to Azure Cloud? I mean, I do not develop it using Visual Studio but only text editor (Atom or Sublime),,thank you

Mask URL for a Django + Ember Web Application

Background: I have a web-app running on my server with Django (for the backend) and Ember (for the frontend). I recently bought a domain (for example... newdomain.com) on godaddy and I am trying to ...

How to create a background service on linux with chef?

I have a Python script that I'm executing using screen on an ubuntu host, and I want to turn that into a proper background service using a Chef recipe. The python script just starts up an SMTP server ...

Systemd : Run a Python Script At Startup (virtualenv)

I have a python script that I normally run it with this command: (environment) python run.py I want to run this script at start. (I'm using ubuntu) Here is my service: [Unit] Description=My Script ...

selenium python script working half the time [migrated]

I wrote a selenium based test in Python which authenticates to a web page and if the page loads up with 3 html canvas, then the web page is working fine but on the 5th or 6th time, it starts to fail. ...

I am trying to use python bcrypt to create a password for useradd

I am on ubuntu and would like to use bcrypt (for now) to create an encrypted password for useradd. I'm not exactly sure how to. I've noticed some people use crypt for hashing, what's the difference ...

Syslog-ng Sending to Python Program

I have the need to send specific syslog messages to a Python script to do LDAP lookups. The script works fine with I do "cat /tmp/input.log | python /usr/local/bin/ldap_lookup.py" but it's not working ...

Unable to reach a python flask-enabled web server on gce

I am running a very simple http server on a VM in GCE. The code is very simple from flask import Flask, render_template, request, json, abort app = Flask(__name__) @app.route('/', methods=['GET']) ...

Lambda: Create a Lambda Function to Start EC2 / Join ELB [migrated]

I have written a Lambda function via Python 2.7 (using boto3) to Start an EC2 Instance and then Join the EC2 instance to a standing ELB (for simple failover). When the lambda goes off, it starts the ...

Python hangs while importing module under Lustre filesystem

I am noticing that my python script is getting stuck while importing simple modules within lustre filesystem of the cluster that I run on. This is reproduced by the following simple example: main.py ...

ec2: after moving eni, can connect to mysql from command line but not from python app

We had an interesting failure during a routine DB upgrade yesterday that I'm not sure how to debug. Setup: Rebuild new master DB, run a script from the new host to attach the ENI to the new host ...

Large number of apache virtualhosts: Python mod_wsgi vs PHP

I have a large number of low-traffic sites I'd like to host on the same Apache server, as many as 500 sites. Currently, I'm powering the pages with PHP and I have a different virtualhost set up for ...

python uwsgi not loading changes

i am using uwsgi to serve python application. app was using a particular vrsion of falcon python now i upgraded the package by removing it and reinstalling it. but the change is not reflected by the ...

Reverse proxy a virtual host while also hosting a directory listing?

The answers I've found re: setting up a virtualhost as a reverse proxy don't seem to be working for me. I'm trying to do something pretty simple. I want to use Apache to reverse proxy a flask ...

Provide a web Interface for a virtual machine [on hold]

We are developing software written in C with a interface for Python. Now we would like to provide an online interface where people can hack in python and testrun this code. kind of like pythonanywhere ...

Can this work as a Containerized Architecture for a Django/NGINX/MongoDB Web App?

I am attempting to build a reliable web App using Django and Nginx. This web app is simple in design, will be built with an MVC styled design, and needs to be secure, yet speedy. The question is ...

postfix connection to python-libmilter test-milter

From the python-libmilter I am trying to run the test milter. The milter is listening (I can connect via telnet to localhost 5000) I enabled the milter in the postfix config: milter_protocol = 6 ...

Apache ignores WSGIScriptAlias if same directory exists in root

I notice a peculiar error when serving Django app through mod_wsgi. In my document root, I have /admin directory that is restricted to 127.0.0.1 using LocationMatch directive. I also have /admin ...

Showing index of / without www, works normal with www

I'm working with Python, Flask and Apache, and i'm stuck. when i try to visit mywebsite using www, it works fine. however, when i remove the www, the website is showing "index of /" with an empty list ...

How to configure Apache2 to use Python on a Ubuntu Linode machine

I have installed Apache2 and Python on a new Linode machine running Ubuntu. I installed the Python mod with: sudo apt-get install libapache2-mod-python I added this to my /etc/apache2/apache2.conf ...

How do I loop over items 1 by 1 in Ansible config (YAML/Jinja2)?

I am trying to loop over my hosts from my inventory in Ansible, and use the name of the host of that iteration in a command. In particular, I am trying to set the hostname of each of my hosts to ...

Cloud SQL periodic issues connecting OperationalError: (2062, 'Cloud SQL socket open failed with error: Transport endpoint is not connected')

Periodically connection attempts to the 2nd Gen MySQL server receives this error: OperationalError: (2062, 'Cloud SQL socket open failed with error: Transport endpoint is not connected') This will ...

Apache wsgi python errro log full of [wsgi:error] withtout explanation

I've a server running django with mod-wsgi checking my apache error log i see an entry for every page hit on the server. Everything works fine the error log is full of messages like this: [Sat Dec ...

CentOS 7 / Apache / mod_wsgi - UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 2727: ordinal not in range(128)

I've deployed a Python web application (uses Pyramid) in Apache (httpd) using mod_wsgi. After starting the Apache service the error below (from Apache log) occurs when we make a http request to the ...

Why is posix.lstat taking such a long time? (duplicity backing up of 9p virtio filesystem)

I have a filesystem mounted with 9p virtio through KVM, and am backing it up using duplicity to a remote SSH server. I' m trying to speed up the backup process, which seems unreasonably slow to me. ...

Upload to S3 bucket slows over time

I'm part way through uploading about 200,000 files (each is ~1MB max) to an S3 bucket from an EC2 instance (both in Europe West). From monitoring the EC2 with CloudWatch (looking at the NetworkOut ...

ModSecurity: Warning. Operator EQ matched 0 at REQUEST_HEADERS

im running a python/django website on apache and modwsgi i've been looking trough my error log and i have tons of this( i had to delete bunch of them in the middle becuz of posting limitation ) [...

Packet fragmentation confusion

I was playing around with dpkt in Python, trying to decode PPPoE - and the program was working just fine, till I noticed that the Offset in the encapsulation IP packets was always 0, even with clearly ...

How do I run multiple on-going python scripts that might be changed in the future?

In a prod environment, I want to run some python scripts that run on start-up and never stop. Currently I am trying to run them as daemon processes, i.e. something like this in systemd: #!/bin/bash ...

Restarting nginx&gunicorn without sudo

Can I run systemctl restart gunicorn && systemctl restart nginx without sudo? Currently I get: out: Authentication is required to reload 'gunicorn.service'. out: Authenticating as: ...

Is there any way to start mongo-connector in linux as a background process?

I am using mongo-connector to synchronize data between MongoDB and SOLR. I am working in RedHat 7 OS Server, I wanted to run the mongo-connector command as fork process in Server OS, since i need a ...

In setting up a Django host, migrate.py often fails to create a .sock file

I am learning to use Django on Nginx. To set up a new host at sitename.com I do: ~$ mkvirtualenv sitename ~$ pip install Django ~$ django-admin.py startproject sitename ~$ cd sitename ~$ ./manage.py ...

Adding CentOS 6.8 Client to Spacewalk

I'm trying to add a CentOS 6.8 client to Spacewalk 2.6 to I can push out updates. In order to add the client I need to first install some packages: rhn-client-tools rhn-check rhn-setup rhnsd m2crypto ...

Nginx uWSGI responses truncated

I tried to write a web service as a joke today at http://dont-tread-on-memes.controversial.io. It's a flask app that serves fairly large images. The Flask app works well on its own, as does an ...

MemoryError when using gdb's Python extension on Jessie

In the past, I frequently used the possibility to attach gdb to a running Python process and use the py-* extensions for debugging. However, since Debian Jessie, this does not work anymore and throws ...
Translating... 0%