Django: vps or shared hosting? [closed] - python

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am new to web development and everything involved with it. Im finishing my website in django and i will soon have to find a hosting and deploy it. I heard there are vps or shared hosting types. So here are the questions:
1. How many visits/clicks per day make it worth choosing vps? shared?
2. How hard is it to tune and maintain a vps on your own if you're new to everything!
3. If i ask hosting providers to help me deploy my site - will they help? (shared, vps)
4. Is vps with 256mb memory much faster than shared hosting?
5. If i want to host many sites on one hosting - is vps more suitable for that?
6. Can i host php, django and other stuff on one hosting simultaniously?
7. Should i know something else to make a decision?

I've been using Webfaction for shared hosting of Django. The price is pretty decent, they have good forums, and have a nice web-based interface to help get you setup. Despite the web interface, it doesn't impede you from having full control over your site form the command line. You can host all sorts of things, from Django to Rails, to PHP, and mysql. For smaller sites, it works nicely. I'm not sure how the performance works under high load, but you can always start small and upgrade to a vps. I've never had direct contact with the support personel there, but the documentation seems good. I don't mean for this to sound like a plug, but it's been pretty good for shared hosting. If you have any questions about it, I'll be glad to answer.

Django runs on GoogleAppEngine but php doesn't.
Your Django code will have to use Google's datastore models instead of Django's usual ORM, so there is some tie in to GAE - if you decide you want to host your own app later on it could be quite a lot of work.
If you go with a VPS obviously you can run Django and php together, but you'll need to choose a webserve, maybe a firewall, maybe load balancing later on.
Clicks per day isn't really useful, you need to know how many clicks per second you get at peak time.
Cheap hosting providers will provide less help than expensive ones.
Is one VPS going to be enough? What is the impact if it goes down? It's harder to do major upgrades if you only have one server.
With a VPS you need to back your data up somewhere. The hosting may do offsite backups for you, but it's a good idea to have some yourself too.
I don't know how easy it is to backup your data from GAE, but it's probably a good idea if the data is valuable.

Should i know something else to make a decision?
Django (albeit a subset) runs on Google AppEngine:
free for starters and pay as you grow.
auto-scale
resilient (backups are "automatic" i.e. datastore)
The drawback of course is you only have Python and Java as options...

If you want to know about setting up a VPS for Django:
Here's a blogpost about it. I used it when deploying a couple of Django-sites (and, yes, you can use Django+PHP and other stuff - I used Wordpress on the VPS too!).
I had never used a VPS before, and it was very easy to follow this guide.

Given your requirements, I would give it a try to hosting Django on Amazon EC2. If you take advantage of their free tier you can do so free for one year in a micro instance (618Mb RAM, 30Gb filesystem). You get full control of the machine, including SSH access. There are a number of freely available images that already bundle Django including the BitNami Django Amazon Machine Image which is also available for free (disclaimer: I am one of the BitNami developers). As your requirements change, it is relatively easy to resize the server to make it bigger without having to reinstall everything

Don't forget Heroku for simple django needs. Perhaps the easiest deployment out there and no need to figure out servers/ports etc.
Heroku is okay when you are starting small, but if you start getting popular - make sure you watch your usage lest you get a nice surprise on your credit card bill.
Some positives that you may not get with other more traditional providers:
Ability to run the latest version of django and other libraries.
By far and wide, the simplest deployment out there - there is definitely their killer feature.
Who doesn't like free postgresql?
A large menu of third party services that are already integrated with them. You just sign up and a few lines and a git push later you are up and running.

Related

Want to Use Whisper in My Flutter Project and Not Sure Where to Start

First I'd like to say that I know similar questions about calling Python code in Flutter have been asked before, but I think this particular case has some challenges.
Some notes about the app I'm aiming for:
Basically a note taking app, records a lecture or meeting or whatever and transcribes the text for you, with a few extra features thrown in. I'd like to have all speech being processed locally both to ensure it works offline and reduce the app's dependence on cloud services.
I'm trying to use Whisper, a new speech to text software that processes everything locally, which is a necessity for my app. I know I could make a Flutter plugin but I'm not sure if that's the best route to go about this for a few reasons:
I haven't done it before, so it would be quite a time investment to do this and just hope it works out.
One of the ways I've seen of doing this involves sending data over http between Python and Flutter, but Whisper would need a continuous stream of audio to work properly which I'm not sure this approach is suited for.
I'd really like to have 1 codebase that runs on any device.
I'd be fine with the app only working on pc for now, but I'd like to also have it working on Android and maybe IOS if reasonably possible. Any other routes I can take towards development are great too but I'd really like to stick with Flutter for this app if I can.
Just found that one: https://github.com/azkadev/whisper_dart
Did not tried it until now but seems to be worth the try.

How to constantly run a python script on a Webserver

I have just coded a trading algorithm and some analytics software for the stock market which in itself works fine.
Since my computer is not always running or internetconnection is not running perfectly I would like to source the script out and put it on a Webserver for example, where it would run all day and night.
Do you guys now I could do that?
I would also like to build a user interface using django to monitor live performance.
Does anybody know what would be necessary to implement these steps?
Thanks in advance and kind regards
Marcel Kresse
This is very general question and the answer is close to "sky is the limit". As mentioned above, any cloud service provider will do.
Most (if not all) clouds have dedicated images for web servers and Django deployments. Have fun.

How to architect a web-based, 3D product designer using Blender?

So I'm trying to create a 3D web product designer similar to:
Zazzle's Custom iPhone Builder:
http://www.zazzle.com/case_mate_iphone_5_5s_vibe_case_iphone_5_5s_case-179139058105217167
ShoesOfPrey: https://www.shoesofprey.com/3d/designer?p=20600P4
It seems that the 3D modeling (skinning, colors, etc) is done server side, with jpeg snapshots taken at a few angles and passed to the client. I have a blender script that does this on my computer, but I'm not sure what rendering engine they are running or how they are hosting it.
I would like to re-create this functionality exactly with other custom products (mugs, clothing, etc). I'm not worried about the front end design tools nor editing the 3D model with user inputs. I plan on using Django and Blender + python scripts to spit out images.
I want to know how to properly architect this app to get a working Version 1 prototype. I'm familiar with Django and front-end design tools, but have little to no experience with networking, hosting, scaling, setting up workers, load balancing, task queuing, passing data from render farm to django, etc.
That might be a bit too open ended, so I'll try to be more specific. Apologies for the noobness:
Question 1: What's a good hosting service for blender that lets me run the python scripts?
Question 2: Would Celery come in handy anywhere here? Not too sure about what it does or why it's important.
Question 3: Ideally, I'd like users to see a resulting image in <=1 second (doesn't have to be as fast as the examples). The app would need to handle maybe 100 simultaneous users at a time. Would I need a render farm, or can any server running python handle this load?
If there's anything I'm overlooking, please let me know! This is also my first stackoverflow post, and I'm a little disappointed in myself that it is a vague question without any code :(.
EDIT-- Question 4: A possible tech stack suggestion (Django + Blender + ???) that could be used to make a project like this would be helpful in getting me off the ground and looking into the right places for answers.

Testing Apache/mod_jk/Tomcat configuration upgrade

We have begun upgrading hardware and software to a 64-bit architecture using Apache with mod_jk and four Tomcat servers (the new hardware). We need to be able to test this equipment with a large number of simultaneous connections while still actually doing things in the app (logging in, etc.)
I currently am using Python with the Mechanize library to do this, but it's just not cutting it. Threading is not "real" in Python, and multiprocessing makes the local box work harder than the machines we are trying to test since it has to load so much into memory for Mechanize.
The bottom line is that I need something that will really hammer this thing's connections and hold a session to make sure that the sticky sessions are working in mod_jk. I need to be able to code it quickly, it needs to be lightweight, and being able to do true multithreading would be a perk. Other than that, I am open-minded.
Any input will be greatly appreciated. Thanks.
Open Source Testing Tools
Not knowing the full requirements makes it difficult, however something from the list might fit the bill.
In order to accomplish what I wanted to do, I just went back to basics. Mechanize is somewhat bulky, and there was a lot of bloat involved in the main functionality tests I had before. So I started with a clean slate and just used cookielib.CookieJar and urllib2 to build a linear test and then run them in a while 1 loop. This provided enough strain on the Apache system to see how it would react in the new environment, and for the record, it did VERY well.

Rookie Python-questions

Is it possible to make python run on your homepage? I know, this is a really stupid question but please don't pick on me for my stupidity :)
If it is possible, how? Do you have to upload/install the executing part of Python to you website using FTP? or...?
Edit: Just found out my provider does not support python and that shell access is completely restricted. Problem solved :)
Everything depends on the hosting provider you use for your homepage -- do they offer Python among their services, and, if so, what version, and how do you write server-side scripts to use it (is it CGI-only, or...?) -- if not, or the version / deployment options disappoint, what do they allow in terms of giving you shell access and running long-time processes?
It's impossible for us to judge any of these aspects, because every single one of them depends on your hosting provider, and absolutely none of them depends on Python itself!-)
Yes, you can. I don't know exactly how but I know it is possible. Mabye look into this website:
https://trinket.io/
This website lets you do this. I sent them a message to see how they do it so I will update this to let you know after they respond.
Python is a scripting language, though it is used gracefully for building back end web applications.

Categories

Resources