Python is a dynamically and strongly typed programming language that encourages readability.
Questions tagged [python]
1743 questions
7
votes
3 answers
Python version for mod_wsgi
how can I change the default version mod_wsgi uses?
I am using Debian 5 with Apache 2.

Etam
- 171
- 1
- 1
- 5
7
votes
5 answers
Secure method of changing a user's password via Python script/non-interactively
Questions
Is there a more secure/better way for setting a user's password non-interactively via a Python script? My current solution uses chpasswd from a Fabric script. Another option would be to use Pexpect from within the Fabric script.
Is my…

Matthew Rankin
- 1,175
- 5
- 15
- 32
7
votes
1 answer
One-liner to install Python 3.9 on Amazon Linux?
Is there a simple, one-liner yum-like command to install Python 3.9 on Amazon Linux?
[root@ip-10-0-0-182 ~]# yum install python39
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
No package python39 available.
Error: Nothing…

Alex R
- 1,063
- 3
- 14
- 29
7
votes
1 answer
Ansible - pip3 install fails
I am trying to install Ansible on CentOS 7, and have Ansible configured to use Python 3. I've both Python2 and Python3 installed.
[root@ansible1 ~]# python --version
Python 2.7.5
[root@ansible1 ~]# python3 --version
Python 3.6.8
If I install…

JeremyCanfield
- 413
- 4
- 11
- 17
7
votes
2 answers
Certbot fails with AttributeError: 'module' object has no attribute 'Locale'
I setup a new server a couple of months ago, running Ubuntu 18.04 LTS. I successfully installed certbot and created my certificates using the cloudflare DNS plugin.
It's now getting to be time for renewal, but when I run certbot renew (or various…

Ben Holness
- 944
- 2
- 10
- 28
6
votes
1 answer
Django with Apache and mod_wsgi: no system log unless setting Debug = True
I'm using apache web server and mod_wsgi to transfer request to django.
$ apache2ctl -v
Server version: Apache/2.4.10 (Raspbian)
Server built: Sep 17 2016 16:40:43
I'm using this apache site to declare django app:
ServerName…

Thomas
- 61
- 1
- 1
- 5
6
votes
2 answers
python boto3 allow ingress security groups
I am developing a simple python script to add rules to securitygroups, and I am wondering what is the difference between the two methods available within boto3: authorize_security_group_ingress(**kwargs) and authorize_ingress(**kwargs)?
The…

Tom
- 616
- 8
- 13
6
votes
1 answer
uWSGI permissions issue
I'm trying to set up a chef recipe that will get my site running and everything seems to be working fine except for uWSGI which is giving me the following error:
*** has_emperor mode detected (fd: 6) ***
[uWSGI] getting INI configuration from…

Nalum
- 259
- 1
- 3
- 13
6
votes
2 answers
Django doesn't find CSS files for admin pages using uWSGI
Even if I followed the official instructions, when I start a Django test site using uWSGI, CSS files for the admin interface are not loaded. If I open the URL of a CSS file, for example http://localhost:8443/static/admin/css/base.css, I get a 404…

Marco Sulla
- 207
- 2
- 4
- 15
6
votes
7 answers
Slow Memcached: Average 10ms memcached `get`
We're using Newrelic to measure our Python/Django application performance. Newrelic is reporting that across our system "Memcached" is taking an average of 12ms to respond to commands.
Drilling down into the top dozen or so web views (by # of…

Chris W.
- 103
- 1
- 1
- 10
6
votes
2 answers
Can I run two server applications on port 80?
I am currently running nginx on port 80, with the configured server names as example.com and www.example.com.
I also have a Flask application that I would like to have accessible through port 80, but using the hostname app.example.com.
Since nginx…

Mark
- 63
- 1
- 1
- 3
6
votes
1 answer
Ubuntu - Supervisord and virtualenv
I'm attempting to run a series of Python apps from supervisor. It works fine on Mac OSX, but when I attempt to run the same app on Ubuntu, supervisor doesn't seem to be activating the virtualenv so my scripts are throwing errors.
Here is my…

Hanpan
- 183
- 1
- 1
- 4
6
votes
3 answers
Can I "register" python scripts to execute on Windows?
I have Python 2.5 installed on Windows XP and a collection of scripts available in a certain directory. According to this article by Amanda Birmingham I can setup up a path for the Python executable and the one for where the scripts live. Which…

Jonathon Watney
- 621
- 1
- 10
- 17
6
votes
3 answers
How To Tell Puppet To Only Install Using Pip If A File Doesn't Exist
I am using Puppet to install some Python packages using pip. I'm using Puppet 2.7, so my package declarations look something like this:
package { "carbon":
require => Class["graphite::prereqs::install"],
ensure => latest,
provider =>…

Tom Purl
- 549
- 1
- 3
- 13
6
votes
2 answers
How to handle 20k concurrent persistent connections
I'm trying to design an architecture to handle massive TCP socket connections and I'm in doubt on the limits of this architecture.
I'll have to handle ~20k concurrent TCP connections and these are long-polling connections, they'll remain connected…

Aldebaran
- 335
- 4
- 12