How to backup database periodically on PythonAnyWhere server

You can host your Django app effortlessly on PythonAnyWhere server. If you are using the database in your app then it is strongly recommended to take backup of database to avoid loss of data.

This PythonAnyWhere article explain the process to take sql dump. We will extend the same article to take database backup periodically and delete the old files.

Continue reading “How to backup database periodically on PythonAnyWhere server”

Automatically updating Django website hosted on PythonAnyWhere server with every git push

Until now this is how I use to develop and deploy (update) code on PythonAnyWhere server.

  1. Make changes in code on my local machine.
  2. Commit and push the code to remote repository.
  3. Login to PythonAnyWhere server and start bash terminal.
  4. Pull the code from remote repository.
  5. Reload the web app from web tab.

Steps 3 to 5 are time consuming, repetitive and boring. So I thought of eliminating these steps.

In this article we will see how can you get rid of these steps and your web site is automatically updated with the code as soon as you push it to remote repository.

Continue reading “Automatically updating Django website hosted on PythonAnyWhere server with every git push”

How to setup Django app on EC2 instance (AWS) – Part 2

In the previous part of article we completed the environment setup to host the Django app on EC2 instance of AWS.

How to setup Django app on EC2 instance (AWS) – Part 1.

Hosting Django Apps on PythonAnyWhere server for free. Step by step guide.

In this article we will start from where we left in last part.

Database initialisation:

Activate the virtual environment.
source venv/bin/activate

Make migrations.
python manage.py makemigrations

If you get a message –  No changes detected then make sure migration files from development environment are not present. If still same message is received, mention the name of app with makemigration command.

Continue reading “How to setup Django app on EC2 instance (AWS) – Part 2”

How to setup Django app on EC2 instance (AWS)

Recently I hosted Django project on EC2 instance of AWS. I find the process very difficult due to multiple reasons which we will see in article.

Hosting on PythonAnyWhere is cake walk as compare to hosting on EC2 instance. And pricing is also almost same.

Since I have gone through the process, I am sharing the step by step approach to host Django application on EC2 instance.

 

Steps to host Django app on EC2:

Login:

Create the account and get the .pem file.

Place the file in on your system and change the permission on that file to 644.  chmod 644 aws_key.pem

Login to system from terminal.  ssh -i aws_key.pem ec2_user@ec2-232-999-89-1.compute-1.amazonaws.com

Now you are into your home directory. Running pwd  will give you  /home/ec2-user .

Continue reading “How to setup Django app on EC2 instance (AWS)”

How to upgrade to paid account on PythonAnyWhere

When I started developing Django applications, one constant concern I had was ‘which is best server for hosting Django applications?’.  I read multiple articles about hosting the Django app, hosting service providers and server providing Django support. Most of them provides support for python but very few provide support for django.

I even purchased hosting space on two servers but thanks to money back guarantee scheme, my money was returned as I was not satisfied with their service. Finally I settled for PythonAnyWhere. I liked PythonAnyWhere for its simplicity.

Continue reading “How to upgrade to paid account on PythonAnyWhere”

How to host django app on pythonanywhere for free

So you developed a course project which you need to host somewhere so that everyone can access it.
Or you are working on some personal project and want to host it so that test users can test it.

What do you do in such scenario? You look for best hosting service provider. Right?
So what is best option to host your django app?

We tried multiple hosting providers and found out that best choice for a django app is pythonanywhere.com. why? Find out below.

Continue reading “How to host django app on pythonanywhere for free”