Rails run on Cloud9 without any problem.
What I want to do is as follows:
run Rails on Heroku
run python program by rake task in Rails (especially python for access AWS s3 by boto to get some.)
current condition is as follows:
Case 1: deployed rails to heroku without any changing.
The deploy could be success and there is no problem to run rails app via Web browser. but rails server shows error log (by heroku log --tail )
an error shows "No module named boto"
Case 2: deployed rails to heroku file named requirements.txt on root.
Heroku didn't detect it as Ruby Rails app so that rails server didn't run.
rails server shows error log (by heroku log --tail ) as
heroku[router]: at=error code=H14 desc="No web processes running"
Case 3: deployed rails first as same as case 1. Then, add Python on Buildpacks on Heroku setting, then add requirements.txt, finally deploy again. then it's deployed. but rails server shows error log (by heroku log --tail ) as same as Case3.
if I could run command like pip, it will be easy, but it's impossible.
is there any idea to solve the above?
Instead of trying to install your custom boto on Heroku, just place your custom boto folder in your project's directory (at the same level as your project's apps). Thereafter, you can import the boto folder using the import statement. You can read about importing a module here
Although, the ideal way to do it is to use the Rails SDK for AWS instead of using the Python SDK for AWS and then trying to use it with Rails. All the functionality available with Boto is available with the SDK for Ruby as well.
Check
http://docs.aws.amazon.com/sdk-for-ruby/v2/developer-guide/
Related
I am pushing a Rails web app to Azure and while pushing I'm am getting a remote:
Error: ENOENT: no such file or directory,
stat '/home/site/repository/include/python2.7'
remote: An error has occurred during web site deployment.
remote: Kudu Sync failed
I tried adding the WEBSITE_RUN_FROM_PACKAGE as a config variable but that deploys from a zip which I'm not sure I want to do and the app wasn't working with that. I've read that I might need a symlink but not really sure thats the way to go.
Here is complete step by step guide to deploy rails app in Azure you can refer:
https://gist.github.com/JeremyC-za/edb758525d5d98870f009dc1bba54d15
You have to set an environment variable like so:
KUDU_SELECT_NODE_VERSION_CMD=true
It changes the behavior of selectNodeVersion function run by deploy.sh
Note:
Rails apps are created with a package.json file and Azure uses this file to determine what type of app you're trying to deploy. Flags the app as a node.js in default scenario web site, and generates a deployment script , because of this reason it gets failed.
Hope it helps.
I'm having some troubles deploying this app on Heroku. The code is on a folder, where i created a git using git init, added everything to my git and then pushed everything to Heroku before running it.
I generated my requirements.txtand my procfile looks like this:
test: python "application.py" heroku ps:scale web=1
But on my webpage nothing will load, i'm assuming because i'm only running the Python part. How can i deploy it so that Heroku will know to run not only my Python script, but also the frontend part with the javascript and index.html files?
For development, you can serve static files with Flask.
For production, use cloud CDN (like Amazon's or Google's) or add a web-server to your app (Nginx or Apache or whatever).
I want to know how to deploy a Django production server on IBM Cloud.
Right now I have a Cloud Foundry Python app running without problems. But I'm using python manage.py runserver to start the app on the cloud.
There is a way to run the app without using the django server? Like, how we do running that kind of apps using Apache o Nginx web servers.
UPDATE:
I tried using the Procfile and gunicorn, but it gives me an error when it starts gunicorn.
This is my Procfile.
web: gunicorn my_app.wsgi --workers 2
And the error
ERR Starting gunicorn 18.0
I am using python 3.6 and django 1.11
Cloud Foundry provides out-of-the-box production quality hosting. You don’t need to configure nginx or apache. For more information on how cloud foundry works under the hood, see here
You would however normally configure the method for starting your application. The python buildback documentation describes a few options, for example:
Specify a Start Command
The Python buildpack does not generate a
default start command for your applications.
To stage with the Python buildpack and start an application, do one of
the following:
Required for Cloud Foundry v245 only: Supply a Procfile.
For more
information about Procfiles, see the Configuring a Production Server
topic. The following example Procfile specifies gunicorn as the start
command for a web app running on Gunicorn:
web: gunicorn SERVER-NAME:APP-NAME
Specify a start command with -c.
The following
example specifies waitress-serve as the start command for a web app
running on Waitress:
$ cf push python-app -c "waitress-serve --port=$PORT DJANGO-WEB-APP.wsgi:MY-APP"
Specify a start command in the application manifest by setting the command attribute.
For more
information, see the Deploying with Application Manifests topic.
I am trying to deploy a django app on hostgator shared hosting. I followed the hostgator django installation wiki and i deployed my app. The issue is that i am getting a 500 error internal page when entering the site url in the browser. I contacted the support team but could not provide enough info on troubleshooting the error Premature end of script headers: fcgi.This was the error found on the server error log.
I am installed django 1.9.5 on the server and from the django documentation it does not support fastcgi.
So my question 500 error be caused by the reason that i am running django 1.9.5 on the server and it does not support fastcgi. if so do i need to install lower version of django to support the fastcgi supported by hostgator shared hosting
First i thought the error was caused by my .htaccess file but it has no issue from the what i heard from support team.
Any Leads to how i can get the app up and running will be appreciated. This is my first time with django app deployment. Thank you in advance
I know this is a while as to when i asked the question. I finally fixed this by changing the hosts. I went for Digital Oceans (created a new droplet) which supports wsgi. I deployed the app using gunicorn (application server) and nginx (proxy server).
It is not a good idea to deploy a Django app on shared hosting as you will be limited especially installing the required packages.
Many hostings today that support python use Phusion Passenger and I have been able to deploy Django on it successfully. Before I share the procedure, let me mention that I faced a lot of problems in doing this and now I have the solution to all of them. I have already written a step by step guide on my blog here to deploy a Django app on shared hosting.
Start a new python app in cpanel. Specify the url where you want the app to be and the folder where you want to put the contents of the app. Set the Application startup file to passenger_wsgi.py and the Application entry point to application.
Copy the command to enter the virtual environment and run it via online terminal in CPanel or SSH.
Install version 2.1 of Django (latest 2.2 will not work) pip install django==2.1
Upload your django project to the folder you specified while setting up the app. There will be a passenger_wsgi.py file in that folder. Edit it and enter the following code: (replace myapp with your application name)
from myapp.wsgi import application
Edit the settings.py file and add the url of your appp to the ALLOWED_HOSTS list.
Set up the MySql database
Configure the path for static files in the settings.py and run python manage.py collectstatic
Again go to Setup python app in cpanel and restart the app.
As you say, Django 1.9 does not support FastCGI.
You could try using Django 1.8, which is a long term support release and does still support FastCGI.
Or you could switch to a different host that supports deploying Django 1.9 with wsgi.
I'm trying to deploy a python-based scientific application on IBM's bluemix platform. However, while I can launch the cgi services to host the web pages, the python application behind it doesn't currently run. The application currently runs on an apache server on rackspace, but I'm try trying launch a newer version for testing. I tried Heroku, with the same problem that the web pages will be served, but not the python application. But the heroku gist seems to be that Heroku can't serve cgi applications. And there was a suggestion that the Cloud Foundry platform would be able to do so. The application runs fine locally, so I'm trying to find the right tweak to deploy to Bluemix (or Heroku).
We have the requirements file, and the initial thought is that it's the procfile that needs tweaking. Currently it looks like:
web: python -m CGIHTTPServer $PORT
I've tried launching the application via the worker tag.
worker: python weblogo.py
worker: python setup.py
even trying to launch the internal files:
worker: python /weblogolib/_cgi.py
worker: python /weblogolib/__init__.py
Yet none of these methods worked on getting the application behind the web pages to work. Is there another method that we're unaware of?
The application is designed to be served locally with the command.
python ./weblogo --serve
Does this matter when deploying to a cloud platform?
Rewriting the application to Flask or Django isn't really an option now. Any guidance toward the getting the application launched would be much appreciated! Thank you in advance!