Migrate Python Tornado application to Azure - python

Right now I'm having a Python application developed on Tornado framework.
I need to migrate it to Azure. The Back-end i will use is Clear-db as we have MySQL in On-premises.
Kindly suggest me how to migrate and host the Application on Azure.
Thanks,

Simplest way to migrate is to use Azure Web Apps. It supports different Python versions, WebSockets, etc, and you should be able to migrate almost (or at all) without changes. Take a look at that tutorial.
The second way would be to use Virtual Machines which is similar to the local server in terms of setting the needed software.

Related

Why can I not use the Django server for production?

I'm learning Django for the first time and I'm also relatively new to Python. On the Django documentation, it says,
"You’ve started the Django development server, a lightweight Web
server written purely in Python. [...] don’t use this server in
anything resembling a production environment. It’s intended only for
use while developing."
Why shouldn't I use the Django server for production? Why do I need a separate server? I'm from a Node/Express background, and when I created an Express application, I could just deploy it to Heroku without doing too much. How will this be different for Django?
Because of security and performance reasons. It's only meant to be used while developing.

Deploying Django project on Linux

Comming from PHP(without frameworks), I don't quite understand how deploying works in Python. I have completed my simple Django version: (1, 10, 1, 'final', 1) blog project and all I have to do is put it online. I am using linux openSUSE distro and virtualenv
I have access to a mysql database with phpmyadmin and I have some space, accessed with filezilla. hosting site: https://host.bg/
But then I started researching of how to deploy my project and I stumbled upon stuf like apache, Nginx, wsgi and other stuff I haven't used in the project and not quite familiar how they work.
So my question is: Can I make my project into a folder with some files in it, copy->paste them in filezilla and have a working site and if not, how does django deployment really work and what should I do from here ?!
I would recommend you to use Git instead of FTP protocol. As you are using Linux you can easily connect to your SO using ssh.
About the deployment, I would recommend you to use GUnicorn for a WSGI way.
It's not hard to deploy with, but if you get in trouble you can use the official Django documentation for deploying Django with WSGI:
Link
Ps.: As you are using Linux, I would recommend to you to use VirtualEnv to allow you server many Django sites in the same Linux instance with the isolated environments
Check what version of Python is installed on the server hosting your account and if there's option for ssh access.
Host.bg and Bulgarian hosting providers in general fail to keep up with most things other than php and mysql. With shared plans they avoid installing anything new too.
I'd say contact support and see if they would be able to assist you with Apache configurations and whatever else is needed for your project.

does it make sense to use apache as web server for django in development mode

I'm a newbie in django and have a project that involves distributed remote storage and I'm suggested to use mod x-sendfile as part of the project procedure.
In have a django app that receives a file and transforms it into N segments each to be stored on a distinct server. Those servers having a django app receiving and storing the segments.
But since mod x-sendfile works need apache and I am just in developing and trying stage this question occurred to me.
I googled a lot but found nothing in that regard.
So my question being: Is it possible to use apache as django web server during the development of django apps? Does it make sense in development mode to replace apache with django built-in web server?
There should be nothing stopping you from installing a copy of Apache on your workstation and using it for developing, and since you're working on something that depends on some of that functionality it makes perfect sense for you to use that for your development server instead of ./manage.py runserver.
Most people use Djangos built-in server because they don't need more than that for what they're trying to do - it sounds like your solution does.
Heck, since you're testing distributed you may even want to consider grabbing a virtualization tool (qemu, virtualbox, et al) so you can have a faux-distributed setup to work with (I'd suggest doing a bit of scripting to make it easy to deploy / restart them all at once though - it'll save you from having to track down issues where the code that's running is older than you thought it was).
Your development environment can be what you need it to be for what you're doing.

Django: how to publish an app

I have developed an app using Django 1.1.1 and python 2.7.1. I want to publish it on a commercial website, but not sure which one.
the app works fine on the apache server running on my local machine, however, before investing on a host, I want to be sure that I have the necessary requirements, so if it matters, what are the possible hosts I can use?
I use Apache 2.2 with python 2.7.1 on my local machine running with Django 1.1.1. I use the Windows OS. I tried looking at linode but they don't have a documentation for Windows users in using Django and mod_wsgi, so does it even matter?
This is the first time I try to publish on a commercial site, so I don't want to invest on a host and then find myself stuck and not knowing how to upload my Django app.
Thanks,
You can follow the docs on linode just fine, it doesn't matter that you're a Windows user, the app will be deployed on a linux box.
You can also try a shared hosting solution, that will run django right way, without any need to configure and setup a new machine. My personal recommendation is http://www.webfaction.com/ . Another alternative is https://www.djangy.com/.

A production ready server to serve django on win32

I'd like to serve django application on windows XP/Vista.
The application is an at hoc web interface to a windows program so it won't be put under heavy load (around 100 requests per second).
Do you know any small servers that can be easily deployed on windows to serve a django app? (IIS is not an option as the app should work on all versions of windows)
cherrypy includes a good server. Here's how you set it up to work with django and some benchmarks.
twisted.web has wsgi support and that could be used to run your django application. Here's how you do it.
In fact any wsgi server will do. Here's one more example, this time using spawning:
$ spawn --factory=spawning.django_factory.config_factory mysite.settings
And for using paste, the info is gathered here.
Of course, you could use apache with mod_wsgi. It would be just another wsgi server. Here are the setup instructions.
If you want to give Apache a go, check out XAMPP to see if it'll work for you. You can do a lightweight (read: no installation) "installation." Of course, you'll also want to install mod_python to run Django. This post may help you set everything up. (Note: I have not used python/Django with XAMPP myself.)
Edit: Before someone points this out, XAMPP is not generally a production-ready tool. It's simply a useful way to see whether Apache will work for you. Also, I saw that you're using SQLite after the fact.
Why not Apache ?
Nokia have developed a scaled down version of apache to run on their mobile phones. It supports python.
http://research.nokia.com/research/projects/mobile-web-server/
Also do you need anything else such as database support etc?

Categories

Resources