All Questions
398
questions
35
votes
30
answers
122k
views
django.core.exceptions.ImproperlyConfigured: WSGI application 'application' could not be loaded
The scenario is,
I cloned the Django code for OpenShift-V3 from here . When I ran the code with python manage.py runserver, I got this error:
django.core.exceptions.ImproperlyConfigured: WSGI ...
24
votes
4
answers
13k
views
Deploying a local django app using openshift
I've built a webapp using django. In order to host it I'm trying to use openshift but am having difficulty in getting anything working. There seems to be a lack of step by steps for this. So far I ...
24
votes
1
answer
10k
views
How to configure Django on OpenShift? [closed]
I recently tried to export a Django project on OpenShift, but fruitlessly. The only solutions I found were "prebuilt" ones (such as https://github.com/openshift/django-example).
I spent some hours ...
12
votes
3
answers
3k
views
Django serving media files (user uploaded files ) in openshift
I have successfully deployed my Django project in openshift. But I need to be able to serve files that are uploaded by users. I user MEDIA_ROOT and MEDIA_URL for that. I followed this tutorial here, ...
9
votes
2
answers
16k
views
browser caching static files in flask?
Have been reading flask docs in python and building a local website.
Just performed a speed test on my website deployed on openshift with this tool here:-
The analysis report says that my site is ...
8
votes
4
answers
26k
views
Ansible K8s module: Failed to import the required Python library (openshift) on Python /usr/bin/python3
The env
Ansible 2.9.6 (python3)
Tried to run a simple playbook
- hosts: master
gather_facts: no
become: yes
tasks:
- name: create name space
k8s:
name: testing
...
6
votes
2
answers
7k
views
Install python packages on OpenShift
I'm trying to install python packages on OpenShift but I see a dearth of pages about the best way to do this. Can someone please suggest the best way of getting on say oauth2 and simplejson. I've ...
5
votes
5
answers
4k
views
Static files on OpenShift Django
I'm having issues serving up static files - i.e. style sheets and images required from my html pages. I cannot seem to fathom why these static images are not being found. Here is what I have in my ...
5
votes
2
answers
9k
views
Call Flask API with AJAX
I am experimenting with Flask and AJAX, I have a simple API route here , hosted at OpenShift. I want to call the API in a Javascript file with Ajax. The OpenShift Python file is simple:
from flask ...
5
votes
1
answer
2k
views
How to setup a Django App on OpenShift DIY with virtualenv
As RedHat openshift doesn't support Python 2.7, I choose to use Do-It-Yourself (DIY) application.
I could able to install python 2.7, setuptools, PIP successfully using an amazing tutorial. Now I ...
5
votes
2
answers
900
views
Using Python 3.3 in OpenShift's book example
OpenShift recently published a book, "Getting Started with OpenShift". It is a good guide for someone just starting out.
In Chapter 3 they show how to modify a template application to use Python 2.7 ...
5
votes
3
answers
4k
views
How to pass command line argument from oc start-build to dockerfile to set environment variable inside dockerfile
Used the below commands but the value for environment is not getting passed in Dockerfile.
Running these instances in oc container through groovy script:
oc start-build -e environment=ipte2 ipte2-...
4
votes
2
answers
625
views
daily cron run terminated as it exceeded max run time
I have no idea why my cron is running 20 minutes and it is terminated. On openshift, if you run cron, it gets killed after 5 minutes. If you run with nohup, it gets killed after 20 minutes.
This is my ...
4
votes
2
answers
10k
views
ffmpeg Python Subprocess Error returned non-zero exit status 1
So I have a line here that is meant to dump frames from a movie via python and ffmpeg.
subprocess.check_output([ffmpeg, "-i", self.moviefile, "-ss 00:01:00.000 -t 00:00:05 -vf scale=" + str(...
4
votes
1
answer
1k
views
byte string too long error in Python using pypyodbc 1.3.4
Getting byte string too long error while saving more than 127 characters in Unix environment while using pypyodbc 1.3.4 and Python Anaconda 3.5.
Gone through this link Byte string too long PyPyOdbc ...
4
votes
1
answer
616
views
How to configure webpy and MySQL on OpenShift
I want to know how to deploy webpy to-do example on openshift. Here is an official webpy example showing how to deploy a webpy app on openshift, but this example does not deal with mysql. Can anyone ...
4
votes
1
answer
2k
views
Building modules using node-gyp on Openshift
When trying to build modules that require node-gyp like node-canvas on Openshift I get this error:
> [email protected] install /var/lib/.../repo/node_modules/canvas
> node-gyp rebuild
Traceback (...
4
votes
1
answer
495
views
.htaccess seemingly ignored on OpenShift
I'm working on a site on OpenShift (Django, Python 2.7, Apache), and I'd like it to always be served over HTTPS. I figured this would be a simple task using .htaccess, and OpenShift's knowledge base ...
4
votes
1
answer
4k
views
Unknown command: 'collectstatic' Django 1.7
I want do static files. I use Django 1.7 and Python 2.7.5 and openshift hosting. When I try to run:
python manage.py collectstatic
I get:
Unknown command: 'collectstatic' Type 'manage.py help' for ...
4
votes
2
answers
2k
views
When does Dash release memory?
I wrote a python Dash app and made it available within my organization using OpenShift. I’m not really knowledgeable about OpenShift but it seems to be running correctly, including when multiple users ...
4
votes
0
answers
1k
views
In Django cursor.execute("select ..") randomly returns None
I am running Django + MySql on OpenShift server and have this problem.
Code:
from django.db import connection
...
cursor = connection.cursor()
somedate = calculateSomeDate()
query = "SELECT id ...
4
votes
1
answer
982
views
flask static files in redhat openshift cloud
I'm trying to deploy flask app to openshift express. The problem is that links to css files are not working. My application folder layout is as follows:
/wsgi
/static
/myapp
/main
...
3
votes
1
answer
3k
views
Does Python respect symlinks?
I'm have difficulty finding any docs describing Python's expected symlink behavior.
I've tried testing it myself but I'm getting weird results - sometimes it appears to work for a while then stops ...
3
votes
3
answers
1k
views
Can't get Pandas to install with OpenShift
I am ssh-ing a Flask application on OpenShift and one of the Python dependencies is Pandas 0.16.1. Looking through the OpenShift documentation, I created my setup.py file as follows:
from setuptools ...
3
votes
1
answer
1k
views
Pandas on OpenShift v3
Now that OpenShift Online V2 has announced its end of service, I am looking to migrate my Python application to OpenShift Online V3, aka OpenShift NextGen. Pandas is a requirement (and listed in ...
3
votes
3
answers
2k
views
Why Openshift adds cache-control private?
My flask python service on Openshift Origin is adding a Cache-Control: private.
My cache server does not make cache because this.
How can I remove this from service?
I Have added this configuration ...
3
votes
1
answer
3k
views
Bottle: Global Variable 'request' is not defined
I am creating a web based application with python where the user enters a search query and data is returned. I used bottle to provide the web framework for this. Openshift is then used to post online. ...
3
votes
1
answer
674
views
wget / curl binaries onto OpenShift before dependencies installation
I'm trying to perform a clean installation of an Oracle client onto a, OpenShift POD, just before that the dependencies are installed (in my case python requirements.txt), Oracle installation has to ...
3
votes
2
answers
2k
views
ImportError: cannot import name inspect OpenShift
Trying to deploy my application on OpenShift I'm stuck with this error:
Traceback (most recent call last):
File "app.py", line 35, in <module>
application = imp.load_source('app', '...
3
votes
1
answer
4k
views
Daphne server cannot connect with websockets on HTTPS
I'm deploying a Django project on the Openshift cloud. This project uses channels and Websockets to make it work asynchronously. The problem is that I can't successfully connect websockets from the ...
3
votes
1
answer
644
views
Long-running Openshift Cron
I have a long-running daily cron on OpenShift. It takes a couple hours to run. I've added nohup and I'm running it in the background. It still seems to timeout at the default 5 minutes (It works ...
3
votes
3
answers
523
views
Openshift: OSError Errno 98 can't update server
I'm using Openshift with Django/Python 3. As of yesterday, I've been unable to update my server. When I push a change, the push is successful. Using SCP to view the files on the server, the updated ...
3
votes
1
answer
633
views
Kubernetes service account does not have assigned role?
I have a service account in kubernetes:
apiVersion: v1
kind: ServiceAccount
metadata:
name: testsa
namespace: project-1
And I've assigned it the view role:
apiVersion: rbac.authorization.k8s.io/...
3
votes
1
answer
1k
views
My Python script hosted on OpenShift inside the .openshift/cron/minutely directory doesn't run. What's wrong?
I wrote the following script, which sends an email to a specific email address, and saved it inside the .openshift/cron/minutely directory:
import smtplib
g = smtplib.SMTP('smtp.gmail.com:587')
g....
3
votes
1
answer
1k
views
OpenShift, python 2.7 and static files with htaccess
I'm trying to configure apache to serve static files for URLs like site.com/img/bla.jpg.
Python cartridge + flask.
I know what there is an preconfigured alias for wsg/static directory, so we can use ...
3
votes
1
answer
2k
views
Starting Celery on openshift
I'm currently writing a flask application and going to use openshift. I start my worker in my dev environment using
celery worker -A wsgi.app
My question is how do I start my celery worker in ...
3
votes
1
answer
3k
views
Openshift ImportError: No module named 'gridfs'
I'm trying to deploy a Python application on Openshift, but I keep getting this following error
ImportError: No module named 'gridfs'
This is the setup.py file
from setuptools import setup
setup(...
3
votes
2
answers
1k
views
Running simple python app with endless loop on openshift
I'm writing small & simple telegram bot on python. I never used this language in my work and decided that's a good way to learn by practice.
To get updates my app currently uses long polling ...
3
votes
1
answer
2k
views
importing python modules in openshift
I have flask application running on openshift and I am trying to import requests module in program. I have added dependencies in requirements.txt as stated here.
My requirements.txt contains ...
3
votes
2
answers
733
views
Openshift: How to and the Drawbacks of a Hot Deployment
I work with Openshift and in specific with Python. I have done many projects in there and I think the most irretating thing is that when you deploy your application, the server is down and you cannot ...
3
votes
1
answer
624
views
Executing OpenShift commands with Python SSH utility failing
I'm trying to execute Open Shift commands like oc get nodes on a openshift node using Python Paramiko SSH client.
When I run this command directly on node it executes and returns output. But, if I ...
3
votes
0
answers
158
views
How do you launch a django functional test via the jenkins cartridge on openshift?
I followed this https://developers.openshift.com/en/managing-continuous-integration.html and set up a jenkins app for an existing app (Django 1.7).
Via the jenkins config I added python ${...
3
votes
1
answer
572
views
OpenShift - How to install Microsoft ODBC Drivers for Linux
My pyramid application connect to MS SQL server using pyodbc driver. For connecting to DB, it uses Microsoft ODBC driver for Linux (http://www.microsoft.com/en-us/download/details.aspx?id=36437). Now ...
3
votes
2
answers
1k
views
python try except does not capture all errors
In my flask web application I use beaker library for session handling. In the following code, for some unknown reason, production server raises exception, but my local pc does just fine.
import sys
....
2
votes
4
answers
4k
views
Openshift [Errno 13] Permission denied
I met an exact same problem with what this link says:pip install Failed in OpenShift, the error info is Permission Denied. I encountered the error while I was deploying django-oscar to openshift. To ...
2
votes
1
answer
584
views
Django/python: Understanding paths in django
As I was looking through my settings.py file in my current project, I realized I wasn't too sure what was really going on under the hood with python in terms of os.path.join
I tried looking it up, ...
2
votes
2
answers
1k
views
How to run OpenShift Django project locally?
I'm trying to run my django 1.6 project locally (downloaded from openshift) with command:
$python3.3 manage.py runserver
and get error:
Unhandled exception in thread started by <function ...
2
votes
1
answer
883
views
Cannot open a file with json in OpenShift with python
I have a problem with python code in Openshift.
I have a subdomain on my app where I have to open a txt file with json format.
from flask import Flask
from flask import render_template
import json
...
2
votes
2
answers
362
views
openshift: can't install lxml for python app
I am trying Openshift but I can't deploy a python app with lxml.
Below are my steps, I'm only adding a lxml requirement. The error happens when I push.
I am able to ssh so I don't think it's a ...
2
votes
3
answers
281
views
Flask Project root directory on openshift
I'm getting started with flask and I'm deploying my app to openshift.
My apps code:
def get_users():
f = open('./users.txt')
....
when I run:
$ rhc tail flaskpq
I see:
[Sun Jun 21 09:...