I built a Django app for speech recognition, the app uses the user's microphone to record audio then convert it to text. It works well locally, but when I try to deploy it in Heroku it giving an error that Pyaudio can not install and
command 'gcc' failed with exit status 1.
I am using Python 3.6 and Windows 7. How can I deploy this application to Heroku?
the app uses the user's microphone to record audio then convert it to text
This won't work on Heroku even if you manage to install Pyaudio.
Python code runs on the server, not in the browser. If you try to record audio using Pyaudio it will try to record audio in some data centre somewhere on Amazon Web Services. This appears to work locally because in development your server and client are running on the same machine.
If you want to record audio from your users you'll need to do it in JavaScript.
Related
I want to deploy django app on aws having windows instance, gone through many doc and video but all are showing with ubuntu and linux machine. please provide any suggestion or right approach for doing this
I have a shared Cpanel host with the Litespeed web server. I want to deploy a Django application on it. After creating a Python application inside the Cpanel where I have not deployed the application on the host I try loading the website, and instead of displaying the Django version, I face 503 Unavailable!!
Also inside the "stderr.log" file, there is the following error.
/usr/local/lsws/fcgi-bin/lswsgi_wrapper: line 9: /opt/alt/python39/bin/lswsgi: No such file or directory
I'm creating the application with Python 3.9.
But it works when I create it with Python 3.8 and show the following message when I load the web,
It works!
Python 3.8.6
The issue is mostly caused by the lack of the Python 3.9 WSGI package. On out-of-date versions of LiteSpeed, the package needs to be installed manually.
To work around this, first ensure that LiteSpeed is up to date. LiteSpeed must be at version 5.4.10 for this to work. Once that is confirmed, execute the following script from LiteSpeed. It will pull the required Python Selector packages:
/usr/local/lsws/admin/misc/enable_ruby_python_selector.sh
Refer cpanel support
Recently I have started a Django server on Azure Web App Service, now I want to add a usage of "ChromoDriver" for web scraping, I have noticed that for that I need to install some additional Linux packages (not python) on the machine. the problem is that it gets erased on every deployment, does it mean that I should switch to Docker ?
Container works, but you can also try to pull down the additional packages in the custom start up file without messing around the machine after the deployment
https://learn.microsoft.com/en-us/azure/developer/python/tutorial-deploy-app-service-on-linux-04
I created a Docker image with Ubuntu 14.04 and compiled FFMPEG to run the streaming of a video asset to a DASH endpoint. On the same image I can run the media analysis script which basically use FFMPEG and other tools to analyse a video asset. Now I want to put a Django app so that assets can be both loaded in the streaming pipeline and run through the media analysis. What would you suggest is the best approach? Have 2 Docker images – one with compiled FFMPEG and the streaming pipeline and another one with django, and then share the code between the two? Or just keep 1 docker image and run both the FFMPEG streaming pipeline and media analysis and Django from there?
I am open to suggestions…
Possible duplicate of https://serverfault.com/questions/706736/sharing-code-base-between-docker-containers
I have a Google App Engine app and I'm running Windows with Vagrant. I have an Ubuntu installation which I access via vagrant ssh. On that machine I installed the Google App Engine SDK for Python and I can successfully deploy my app with:
appcfg.py update myapp --oauth2 --noauth_local_webserver
The --noauth_local_parameter allows me to copy the oauth URL and paste in the browser on my Windows machine, because on the Linux machine I have no GUI. Everything is working fine.
But now I want to use the Django manage.py syncdb command, to create the tables in Google Cloud SQL. The problem is, when I execute that command, the text-based w3n browser starts for the authorization, and then I get the error message that the browser does not support javascript.
I'd like to run the manage.py commands with the --noauth_local_webserver flag, but that is not supported by the manage.py commands. How can I solve this? I have already installed an Ubuntu virtual machine with GUI and given the app the permission and manage.py works fine on that machine, but when I try to execute the command on the Vagrant (non GUI) machine, it stills want to open the browser for permission.
Hm, I manually copied the oauth .dat file to the vagrant server, and manage.py syncdb is now working, but the website still can't connect in the browser; it says:
No valid OAuth 2.0 credentials. Before using the Google SQL Service backend on dev_appserver, you must first run "manage.py syncdb" and proceed through the given instructions to fetch an OAuth 2.0 token.
It seems to be the same errors as here. In my case it seemed that the necessary GOOGLE_SQL_OAUTH2_REFRESH_TOKEN environment variable was not set. I copied this refresh token from the .dat file and set it in the app.yaml:
env_variables:
GOOGLE_SQL_OAUTH2_REFRESH_TOKEN: "..."
Now everything is working fine.