What are the steps to deploy django project that warks localy to production - django

I am sorry for asking such a wide question. But i have built website with django that works locally and now i need to deploy it in production. I wanted to try to do it with first with free hosting like Heroku but it caused me with problems with my postgresql, so i decided to to post it in production and spent month for final testing in "real world". Can someone give me just steps that will lead me to that goal. this is my first website and i am really confused with the variety of options that i can use to do it. I found some articles but they were outdated mostly and most of them proposed different solutions that confused me very badly. Would really appreciate just a simple list of steps for deployment, like which hosting to use for starting, how will it work with local domain if i get it country in Central Asia. Will that cause my website work slower or not? Will be grateful for anyone's response and suggestion, cause this deployment process confused me so badly, that i can't solve it without help from experienced programmer

Deploying django app in production on your local system is similar to deploying it on VPS
You can use this link by Django project or this link by digital ocean to deploy your dango app on your local system. I would suggest you to use digital ocean link.
You can use this link by heroku devcenter or use this link by Marina Mele to deploy it on heroku
If you are primarily looking to test the app, then pythonanywhere is a good option for you. With its free account it provides you 500mb of disk usage, a domain name like "yourapp.pythonanywhere.com".
If your app has more requirements, then you can check out their paid plans.
How will it work with local domain if i get it country in Central Asia. Will that cause my website work slower or not?
The response of your website does not depend on the domain name you buy, it is just to route website users to your website using easy to use/remember address. The response of your website depends more on the performance of VPS or whatever that servers your webapp.
This is my first website and i am really confused with the variety of options that i can use to do it.
You have many cost efficient options like using free tier of Amazon Web Services. But as you have mentioned that this is your first website, you may find it difficult to use it, since aws is largest provider of Platform as a Service, and has lots of things in store to offer.
At this stage you may find using Digital Ocean very easy. In my experience, I have found that digital ocean is more user friendly than AWS.

Related

process of deployment independent websites from SaaS Application

first of all I'm not sure how I can explain myself since I'm not native English speaker but please bear with me in the following scenario: I have a lot of customers where they need a simple blog website with their own domain name, instead of me registering on host service provider and deploying that blog website manually I'm looking for a better automated solution for example it would make a lot of sense if they use my own platform so after a successful registration/payment on my platform their website is deployed independently on private server instance (with their own specific config) ... Im not really looking for an answer on exactly how to implement that but what that process is called (the deployment part) or under what category should I dig to learn more. your advice is much appreciated.
There can be multiple approaches to solve the problem.
However, simple one will be using AWS SDK to create EC2 instances with Bitnami wordpress image.
You can trigger the API with parameters which will auto-install wordpress, configure dns and other stuff and provide the ready to use website within seconds.

Django hosting on a domain

So far, the only websites I've put in a hosted domain were with PHP. But since I work with Django I wonder if there would be any "barrier" or trouble when it comes about hosting a project, since Linux and IOS have Python installed by default but Windows not. Also it would be necessary to install tools such as Django itself, pillow, mysqlclient, etc...
I just want to know any possible barrier before going ahead. Thanks!
Everything depends on the server, if you have the necessary permissions to install and configure everything, you will not have any problem. How can be gunicorn, supervisor, nginx, etc.
For example services that you will not have any problem can be Amazon EC2, digitalocean, or any similar provider.
When I started with Django about 4 years ago I didn't know anything about servers, nginx and very little about databases but I found Djangoeurope on which I put my first websites.
They have managed databases (PostgreSQL and MySQL), one-click Django installs, reasonable prices and a very helpful staff.
I've since transitioned to using Docker on GCP, but for a beginner I can't recommend them enough: you can just concentrate on your Django code and you don't have to learn everything else at the same time.

Which is the best development/production environment for Django projects?

A bit of background
I work for a little company as Django developer. The previous developer left the company and I am the only developer (that is the reason they were looking for a Django developer). The company has a simple web application that needs to be mantained and scaled. It seems that the company is getting sales and incomes are increasing. There is a possibility to hire another developer in the short or mid-term. Right now I am analizing possible improvements. This is my first professional job as Django developer, but I achieved to deploy some little personal projects in the past. As you can imagine I am not an expert at all.
The issue
We use a Ubuntu VPS for development, using Django's integrated web server. And another Ubuntu VPS for production, using Nginx+Gunicorn. We use git for version control. The only user we use (for everything) in both VPS is root. I don't work locally in my computer, but connected via ssh to the servers. These are my insights about the structure:
Use of root is unsafe. No doubt about it and we should change this.
What if another developer is hired? Could we work together in the development server?
The question
As the title says, I want to know which would be the perfect working structure for a developers team. After googling a few hours my approach would be something like this:
Production server.
Testing server (replicating as much as possible the production server).
Development environment. Every developer should work and test their code locally in their computers before testing it in the Testing server.
Use of Git for version control.
Use of non-root users for both testing and production servers.
This is just my point of view and I haven't even tried it. I would appreciate you to share your knowledge and experiences.
Thanks in advance!

Django on Digital Ocean

So I am beginner Django Developer and have been learning by developing local apps. I am looking to finally deploy something so people can use it. I have been looking around at various hosting providers and I am wondering what it's like using Digital Ocean for Django hosting. Specifically what exactly is involved/required with managing a Django app on Digital Ocean. Hostgator, which is another host I've been looking at, does not offer any "one-click" install for stuff like Nginx or anything else which I noticed Digital Ocean does have, so I would have to install that that as well as anything else I'd need myself. I guess my question is after that one click install what is involved with managing a Django app on Digital Ocean? Do I have to learn how to do a ton of other stuff regarding managing a server and dealing with Nginx (I would have to do that on HostGator) or does that One-click install for Django handle all that? Also other than Django, are there any skills that I have to learn in order to be able to do this?
Digital Ocean is more than a hosting service, it's a development platform. Digital Ocean works around the element of "droplets", where each droplet is a virtual machine typically running a UNIX system. Basically if you are looking for a service where you can both host a website and do some development, Digital Ocean may be the way to go, but it is not free. But yes, you would have to configure everything yourself with regards to setting-up Django, proxies, and other network-related tasks.
If you are looking for an easier, alternative solution, you might want to take a look at Django on Heroku.
As far as I know, there are no one-click solutions for Django. There is an official tutorial, though, which is where I would start, along with a quick read in the Django docs.
My experience hosting small Django apps on DO has generally been good. DO is very stable nowadays with no noticeable downtime (unless you must guarantee HA to your users, which I don't).
I have been using Digital Ocean/DO for my Django deployment last 6 months and have a great experience.
I use Django On Click Django 1.8.7 in Ubuntu 16.04 Image for all my website development.
Do provides extensive tutorials/documentations and very developer/tinker friendly. I was able to config my Do box Nginx to host 4 different websites on one single box and even manage to run a Ethereum node on it.
I wrote this tutorial on How to Deploy Multiple Websites on 1 single DO Droplets - Tutorial Link

ecommerce django app on webfaction versus VPS/DS versus Cloud Servers like EC2

Firstly, some background - I have been mostly using VPS/DS and EC2 for the django apps I build for the past 3-4 years.
On webfaction, I have only been deploying "trivial" apps or "personal blog apps" using both django and wordpress.
My biggest hesitation about deploying anything serious (with large amount of sensitive personalised user data such as addresses and phone records or ecommerce related data or even accepting a Paypal related transaction) on webfaction is that it is a shared hosting environment.
I like webfaction a lot because they have made it really easy to deploy django apps without the need for me to spend some time doing system administration and installing my own packages (which I obviously need to do on a clean EC2 instance or a VPS/DS instance on linode for example).
The question is - is it very unsafe to use webfaction (since it is a shared hosting provider and I can actually list the other users' home directory by running "ls -la" after I ssh in) to run an ecommerce application or an application which has a lot of personalized, sensitive user data? I would appreciate specific technical examples which can help me better decide whether or not to run a "simple" (yes, I know the word simple is dangerously ambiguous/undefined) ecommerce app - which probably will use the paypal payment gateway on webfaction.
I can address the specific concerns you have listed:
While you may be able to see other user's files, it's because they haven't changed the permissions on their files. You can use standard linux file permissions to keep other users from reading or writing your files.
chmod 600 file
You will most likely be storing your information in a database hosted by webfaction. While it is a shared enironment, you do get your own database that is protected by a password and a username. In short, it has the same security in place that a database hosted on a VPS would have.
While you do have to take extra steps to ensure the other users on the system cannot gain access to your information, it is certainly possible to keep your site secure in webfaction's shared hosting environment.