I am new to Python / Azure VM world.
I have created Python/Django website using PyCharm IDE.
Created Azure VM with Python/Django installed
on Azure VM , I can run : Python manage.py runserver and i can access it using Azure URL from externally.
Question:
to run/deploy a python website on VM, do we have to run Python manage.py command or there is any other way ?
in case I have to deploy multiple websites what i should do ?
and python manage.py session also gets expired pretty soon and site is not accessible anymore , how to keep it running ?
Regards Shakeel
after some research I found the solution, answer to my own question is for my requirements I can use NGINX and GUNICORN :)
Related
I have a nodeJS API which uses child_process to run a python file.
I know heroku has a way to add another buildpack with a script.
Is there a way with Microsoft Azure (web app / app services) to use NodeAPI and Python files in an App service.
PS : Python file is not an API, it is just a script that runs from node.
Thank you
When you hosted a Web App in Azure, you already have all runtime environments by default.
Web App Runtime on Azure Portal:
Python Runtime on Kudu Explorer:
NodeJS and PHP on Kudu Explorer:
Check the other stack versions in Console and if it not sufficient, update them.
Note:
When creating the webapp, it is recommended to choose windows platform which supports virtual application because when you find that you cannot use the runtime you required, you can try to install runtime extensions for other programs.
Also, it is possible under Linux but requires command line to operate.
Hope anyone with these areas of expertise can help me.
Basically, I am trying to run my Django project inside the EC2 instance in Amazon Web Service. I have placed the files and tried to run the server with
python3 manage.py runserver 0.0.0.0:8000
The steps I used to configure my EC2 is by referring to this website: https://medium.com/saarthi-ai/ec2apachedjango-838e3f6014ab. I followed all the steps and I was able to deploy my project.
However, once I close my SSH connection, I won't be able to access the website anymore. Is there a solution to this?
Regards,
YX
When you exit(close connection) from SSH. It will close all user activity which are running on.
So you need to deploy your Django project on server with specified port. So project have accessible anytime from any where as per defined policy.
Please follow the following link to deploy your django project on ec2.
you need to configure Gunicorn with Nginx to host your
project on EC2
https://www.pythoncircle.com/post/235/how-to-setup-django-app-on-ec2-instance-aws/
If you have experienced person on AWS than you need to follow following instruction.
https://aws.amazon.com/getting-started/projects/deploy-python-application/
Thanks
I'm using Azure Python SDK to deploy a Linux Vm in the Cloud. This Vm has a public IP and ssh enabled. I need to have this Vm running a custom script immediately after it boots . This script would install pip, python, docker etc and start a docker container.
How could I pass this script when deploying the vm ? / How could I instruct the vm to run this script after it has started ?
Cheers,
Steve
According to your scenario, you could use Azure Custom Script Extension.
The Custom Script Extension downloads and executes scripts on Azure
virtual machines. This extension is useful for post deployment
configuration, software installation, or any other configuration /
management task. Scripts can be downloaded from Azure storage or other
accessible internet location, or provided to the extension run time.
If you want to use python to do this, please refer to this python sdk documentation.
Please refer to the similar question.
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!
I am a newbie to web I developed a small web app using python and Django things are working fine with local development server. Now I want to deploy my app to an AWS EC2 instance with Nginx and Gunicorn. Every tutorial I found on the internet explains things using a linux platform. Unfortunately, I am using a windows.
I have never used Git or Linux, will I be able to do things from Windows machine itself?
Use PUtty and follow this.
After connecting to you linux instance everything command will be on linux.
It does not matter which platform you are using, just make sure on AWS, you should create linux instace and follow those tutorial on deploying with gUnicorn and Nginx.