I'm new using python on openshift and I follow this tutorial to learn more about it https://developers.openshift.com/en/python-flask.html, then there is a thing that I can't find info in openshift docs or https://developers.openshift.com/en/python-flask.html
I suspect is defining the execution order of https://developers.openshift.com/en/python-repository-layout.html
Am I right or I missing something else?
It is used to automatically deploy your application.
See this link.
Check also this link
Related
Recently I have been creating docs using sphinx. Now when the docs are done I want to deploy them on my web app under like /docs/ url.
Is here any good tool that is capable of doing that?
So far I found a tool that is able to deploy the docs under url but the docs look awful - it takes the json created by make and renders the data…
https://github.com/carltongibson/django-sphinx-view
Thanks for any ideas.
I am new to Python deployment. I have a Python Web API made in Flask. Want guidance on how to publish the python code as web API so that Dot Net program can consume it and take benefit of Python / ML.
Apologies for such generic question, but any help or approach or documentations on the same would be grateful.
Thanks In Advance!!!..
As far as I know, if you want to deploy python application to the IIS. I suggest you could follow below steps:
1.Install Python on your server.
2.Install wfastcgi on your server.
3.Install the IIS(contol panel->Programs->Programs and Features->Turn Windows Features on or Off) with the CGI
4.Create a new IIS web app for the paython project folder.
5.Modify the handler mapping to add python handler. Notice: Modify the path based on your python and wfastcgi path
Run your application
More details, you could refer to below article:
https://www.storehubs.com/Blog/deploy-python-flask-application-iis/
https://learn.microsoft.com/en-us/visualstudio/python/configure-web-apps-for-iis-windows?view=vs-2019
Need advice on how to incorporate Python into an Azure ASP.NET web application environment. Please excuse this question but I am new to Azure and I'm not clear on how to proceed. Every option that I look into looks promising but they all seem to have their own issues. Below is a more thorough explanation but the deal is that I have an Azure account with all kinds of goodies, a full fledged ASP.NET (C#) web app running via App Service, I am new to Azure (but not Python), and I'm hoping to add Python functionality to this whole setup. In short:
I want to add Python to this setup mainly to run scheduled jobs and also to trigger Python code from ASP.NET web form submissions
ideally I want a solution that resembles a non-cloud setup. I know this sounds silly but I'm finding the cloud/Azure functionality to be nuanced and not straightforward. I want a place to put a bunch of Python scripts, run, edit, schedule and trigger them from ASP.NET
for example: I created a WebJob that runs manually and from the documentation it wasn't clear how it should be called. I just figured out that you need to POST with Basic Auth (and the credentials provided).
!Also, Azure CMD does NOT like files with 'underscore _' in them! You cannot submit a Web Job with a py file with an underscore nor can you write output with a file with an underscore
!Also, I don't see an option for this Web Job to run Python 3.6.4 (which I installed via extension). Right now it is using 2.7.15...
!Also, CRON expression in Azure has six *, not five plus a command. Again, more weird stuff to worry about
I tried these instructions but the updates to the web page's Web.config file breaks the ASP.NET web pages
ideally the most cost effective option
Any info is greatly appreciated
MORE DETAILED EXPLANATION
Currently I have an ASP.NET site running via Azure App Service and I would like to add Python scripts and possibly Flask/Rest functionality. Note that I am not expecting to serve any content via Python and will largely be running Python scripts either on a scheduled basis or call them from ASP.NET. As a matter of fact, and this is an important point, I'm hoping to have ASP.NET trigger/run a Python script when a web form is submitted. I realize that I could get a similar effect if I make a web call to a Rest api that is running Python. In any event, I can't tell if I should:
add a Python extension to the current App Service running the web page (I tried this) OR
I did install Python 3.6.4 and some packages via pip
These instructions were useful, however the updates to the web page's Web.config file breaks the ASP.NET web pages
set up a VM that will have all of the Python code (but how can I have the .NET web page(s) call the Python in the VM?) OR
use Azure functions (I'm completely new to this and must admit that I prefer to have my old school Python environment instead although I see the benefit of using functions. But how do you deal with logging and debugging?)
or what about a custom windows container (Docker)?
This requires installing VS Code and that is OK but I'm looking for a solution that another user can get into with as few interruptions as possible
The idea is to ramp up the use of Python although, like I said, I don't expect Python to be serving any of the web content. It will be used to run in the background and to run scheduled jobs. What is the most robust and hopefully easiest way to add Python functionality to Azure (most importantly in a way to be able to trigger/use Python from an App Service running .NET?)? I've searched online and stack overflow so far with interesting finds but nothing to my liking.
For example, the following link discusses how to schedule WebJobs. I just created a manual one and when I called the webhook I got the message: "No route registered for '/api/triggeredwebjobs/TestPython/run'" How to schedule python web jobs on azure
The Docker method looks very promising, however, I'm looking for a simple solution as there is another person who will be involved in all of this and he's busy with other projects
Thank you very much!
I found a solution, though I'm open to more info. Like I mentioned in my post, I used the 'add extension' tool to add Python 3.6.4 to my Azure (installed in D:\home\python364x64).
Then I installed a bunch of packages via pip, these installed into D:\home\python364x64\Lib\site-packages.
I created a Python folder in webpages\Python where I put my scripts.
Finally, in ASP.NET I used the Diagnostics.Process call to run my code in ~\webpages\Python\somecode_2.py
The main issue is that Azure came with Python 2.7.15 installed. And for some reason when my Python code got executed it was using 3.4 (where that version came from beats me). So for each script, I had to create an _2.py version where I simply did the following in order to call the original script via Python 3.6.4. Looks a little nasty but it works. So like I said, I would welcome more info for ways to do this better...
--
import os<br>
os.system("D:\\home\python364x64\python.exe SomePython.py {0}".format(add arguments here)
I had a Django project that uses python 3.2+. Having been through a couple Azure classes I wanted to deploy my Django application through Windows Azure. I got the web site synced through my Git Repository, and following the advice of the MSDN forums, added the python 33 runtime in a folder called /PythonCore/ and added WSCGI.py to the scripts folder within there.
My website can''t find the CGI interface and likewise is failing to process HTTP requests. I know something must be wrong in my configuration, but I havn't a clue as to what. I was wondering if anyone might know what my error is.
WEBSITE_NODE_DEFAULT_VERSION 0.10.5
DJANGO_SETTINGS_MODULE DjangoApplication.settings
PYTHONPATH D:\home\site\wwwroot\DjangoApplication;
WSGI_HANDLER django.core.handlers.wsgi.WSGIHandler
Handler Mappings
* D:\home\site\wwwroot\PythonCore\python.exe D:\home\site\wwwroot\PythonCore\scripts\wfastcgi.py
Please let me know if any additional information is needed or you have an idea what I can try.
Azure Web Sites w Django currently requires Python version 2.7. Please see this:
http://www.windowsazure.com/en-us/develop/python/tutorials/web-app-with-django-and-mysql/
and
http://pytools.codeplex.com/wikipage?title=Django%20Web%20Site/Cloud%20Service%20Tutorial
Corresponding video walk thru:
http://www.youtube.com/watch?v=S7A7VNnsA_8
Python 3.x will be supported soon (hopefully fall 2013).
I am new to web development. So be gentle. AND thanks in advance.
I am developing on windows env. and deploying on a linux server w/ Python 2.6.2 installed.
Running apache2.2 as Virtual Host, and I am using mod_wsgi. I plan to serve media files from the same Virtual Host.
I have a django site and I am now ready to deploy. I am stuck, and every site I go to seems to be outdated/incomplete/overmyhead.
https://docs.djangoproject.com/en/1.3/howto/deployment/modwsgi/
http://www.djangobook.com/en/2.0/chapter12/
...only 2 links as for the newbness
The top link seems to be what I need yet I am still confused on these things:
What does the file structure look like on the server
I cannot change/edit server files myself, I rely on the dba for that
I have django.wsgi, and django.wsgi~, where do those go?
Where do I put my project in relation to those wsgi files?
The httpd.conf file is something that the server has on it? or do I create another?
Do I need to put django in any way shape or form on the server? If so where? And what about the packages like registration, defaults?
Again sorry for the newbness, I have been banging my head for 2 weeks on this.
Any help/links will be greatly appreciated unless they link me to the django-docs. I have read those...A LOT! thanks
Also go read:
http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango
and watch:
http://code.google.com/p/modwsgi/wiki/WhereToGetHelp?tm=6#Conference_Presentations
The latter includes Django examples and talks a bit about locations, permissions etc.
The first of these is even linked to in the document in the Django documentation.
It doesn't matter where the files go. They just have to be readable/executable by the user that the web server is running under.
I don't know what you mean by django.wsgi~, that sounds like a backup file created by your editor - you don't need that.
Yes the httpd.conf is the configuration file for Apache. Some distributions (eg Debian and Ubuntu) split this up into separate files for each site that the server runs. If your administrator is the only one who can edit files, he will know about this already.
Yes, you need Django, and any third-party packages.
#Nathan
An easier option for you while you are learning this is not to really have to many expenses.
I could also suggest you take a look at Heroku - allows you to easily deploy your applications in minutes.
Up until recently they only supported RoR and they have brought in support for Django and Python - they have some really well documented tutorials as well.
I hope this helps
Heroku Django / Python tutorial
I have written up an simple deployment guide for django applications it can be found here. It goes all the way from project setup and deployment. I also have references setup. I honestly believe it answers all your questions, I would give it a look.
Goodluck.