My Blog

Django on cloud

1-click AWS Deployment  1-click Azure Deployment 1-click Google Deployment

Overview

Django on cloud is a free and open-source web framework, written in Python, which follows the model–view–controller (MVC) architectural pattern. Django’s primary goal is to ease the creation of complex, database-driven websites. Django emphasizes reusability and “pluggability” of components, rapid development, and the principle of don’t repeat yourself. Python is used throughout, even for settings, files, and data models.

Django is owned by Django (https://www.djangoproject.com/) and they own all related trademarks and IP rights for this software.

Cognosys Provides Hardened images of DJango on the cloud ( AWS marketplace, Azure and Google Cloud Platform).

Deploy DJango securely on cloud i.e. AWS marketplaceAzure and Google Cloud Platform (GCP)

Secured Django on Ubuntu 14.04 LTS 

Features

Major Features of Django  

  • Ridiculously fast.
  • Fully loaded
  • Reassuringly secure
  • Exceedingly scalable
  • Incredibly versatile
  • Simple installation
  • No 3rd-party requirements

AWS

Installation Instructions For Windows 

Step 1) RDP  Connection: To connect to the deployed instance, Please follow Instructions to Connect to Windows  instance on AWS Cloud

Connect to the virtual machine using following RDP credentials:

  • Hostname: PublicDNS  / IP of machine
  • Port : 3389

Username: To connect to the operating system, use RDP and the username is Administrator.
Password: Please Click here to know how to get password .

Step 2)  Application URL: Access the application via a browser at “http://127.0.0.1/admin” or “http://localhost/admin”

Step 3) How Can We Get Started With Django?

To get started, we suggest the following steps:

  1. Open Command Prompt by Clicking on Desktop Icon and choose path for project cd C:\inetpub\wwwroot
  2. Enter in Command Prompt – virtualenv test
  3. Enter in Command Prompt – cd test
  4. Enter in Command Prompt – pip freeze
  5. Enter in Command Prompt – python -m pip install –upgrade pip
  6. Enter in Command Prompt – pip freeze
  7. Enter in Command Prompt – .\Scripts\activate
  8. Enter in Command Prompt – pip freeze
  9. Enter in Command Prompt – pip install django==1.6.5
  10. Enter in Command Prompt – pip freeze ( To see Django Version , If empty then follow 8th step )
  11. Enter in Command Prompt – python .\Scripts\django-admin.py startproject projectname
  12. Enter in Command Prompt – cd project name
  13. Enter in Command Prompt – python manage.py syncdb
  14. Fill all the details – Username(optional) || Mail ID(optional) || Password(Compulsory)
  15. Enter in Command Prompt – python manage.py runserver 0.0.0.0:80

How To Access A Django Server Application?

14. The Django server will be accessible only when using 127.0.0.1/localhost
15. Admin URL – http://127.0.0.1/admin or http://localhost/admin

or Access via PublicDNS or Public-IP by http://publicdns/admin

open command prompt and choose project path

AWS Step by Step Screenshots for Windows

Step 1. Open Command Prompt by Clicking on Desktop Icon and choose path for project ( For Example: cd C:\inetpub\wwwroot )

Step 2. Enter – virtualenv name_of_env ( For Example: virtualenv test )

enter virtual name
Step 3.Enter – cd name_of_env ( It will go to your Env Directory )

enter cd name
Step 4.Enter – pip freeze ( To check ENV Version )

check env version by entering pip freeze
Step 5.Enter – .\Scripts\activate ( TO actiavte ENV )

activate env by entering path
Step 6.Enter – pip freeze ( To see Django Version , If empty then follow 8th step )

enter pip freeze to check your django version

Step 7.Enter – pip install django==1.6.5 ( It will install Django latest version )

enter pip to install django latest version
Step 8.Enter – python .\Scripts\django-admin.py startproject projectname

enter path
Step 9.Enter – cd projectname

enter projectname
Step 10.Enter – python manage.py syncdb

enter - python manage.py syncdb
Step 11.Fill all the details – Username(optional) || Mail ID(optional) || Password(Compulsory)

enter all details
Step 12.Enter – python manage.py runserver 0.0.0.0:80

enter - python manage.py runserver

Step 13.Django ready for use opne in Browser-wellcome page

welcome screen of django

Step 14.Django login window

enter credentials in login window

Step 15.After login open user panel

open user panel after login

Step 16.Administrator profile

enter details in django admin screen

select user to edit details

Step 17.add new user

add new user

change user

Step 18. Add group

add new group

Step 19.Change password

change your password

first page of django

Azure

Installation Instructions For Ubuntu

Note: How to find PublicDNS in Azure

Step 1) SSH Connection: To connect to the deployed instance, Please follow Instructions to Connect to Ubuntu instance on Azure Cloud

1) Download Putty.

2) Connect to virtual machine using following SSH credentials:

  • Hostname: PublicDNS  / IP of machine
  • Port : 22

Username: Your chosen username when you created the machine ( For example:  Azureuser)
Password : Your Chosen Password when you created the machine ( How to reset the password if you do not remember)

connect to virtual machine using your credentials

Step 2) Application URL: Access the application via a browser at “http://PublicDNS”

Step 3)  Other Information:

Version – Django 1.6.11

Note: You can use the django-admin command to create a project:
django-admin startproject projectname

1. Default installation path: will be in your web root folder “/var/www/html/”

2. Default ports:

  • Linux Machines:  SSH Port – 22
  • Http: 8080

Configure custom inbound and outbound rules using this link

3. To access Webmin interface for management please follow this link

Installation Instructions For CentOS

Note: How to find PublicDNS in Azure

Step 1) SSH Connection: To connect to the deployed instance, Please follow Instructions to Connect to Centos instance on Azure Cloud

1) Download Putty.

2) Connect to virtual machine using following SSH credentials:

  • Hostname: PublicDNS  / IP of machine
  • Port : 22

Username: Your chosen username when you created the machine ( For example:  Azureuser)
Password : Your Chosen Password when you created the machine ( How to reset the password if you do not remember)

connect to virtual machine with your credentials

Step 2) Application URL: Access the application via a browser at “http://PublicDNS”

Step 3) Other Information:

Version – Django 1.6.12

Note: You can use the django-admin command to create a project:
django-admin startproject projectname

1.  Default installation path: will be on your web root folder “/var/www/html/”

2. Default ports:

  • Linux Machines:  SSH Port – 22
  • Http: 8080

Configure custom inbound and outbound rules using this link

3. To access Webmin interface for management please follow this link

 Step by Step Screenshots

first page of django page

enter old password for security purpose


connect to your virtual machine

password changed confirmation screen

enter credentials to login

site admin screen

log out screen

Google

Installation Instructions For Windows

Step 1) VM Creation:

1.Click the Launch on Compute Engine button to choose the hardware and network settings.


2.You can see at this page, an overview of Cognosys Image as well as some estimated costs of VM.


3.In the settings page, you can choose the number of CPUs and amount of RAM, the disk size and type etc.

Step 2) RDP Connection: To initialize the DB Server connect to the deployed instance, Please follow Instructions to Connect to Windows instance on Google Cloud 

Step 3)  Application URL: Access the application via a browser at “https://localhost/admin”

Step 4) How Can We Get Started With Django?

To get started, we suggest the following steps:

1. Open Command Prompt by Clicking on Desktop Icon and choose path for project ( For Example: cd C: )
2. Enter in Command Prompt – virtualenv name_of_env ( For Example: virtualenv test )
3. Enter in Command Prompt – cd name_of_env ( It will go to your Env Directory )
4. Enter in Command Prompt – pip freeze ( To check ENV Version )
5. Enter in Command Prompt – .\Scripts\activate ( TO actiavte ENV )
6. Enter in Command Prompt – pip freeze ( To see Django Version , If empty then follow 8th step )
7. Enter in Command Prompt – pip install django==1.6.5 ( It will install Django latest version )
8. Enter in Command Prompt – pip freeze ( To see Django Version , If empty then follow 8th step )
9.Enter in Command Prompt – python .\Scripts\django-admin.py startproject projectname
10.Enter in Command Prompt – cd project name
11.Enter in Command Prompt – python manage.py syncdb
12.Fill all the details – Username(optional) || Mail ID(optional) || Password(Compulsory)
13. Enter in Command Prompt – python manage.py runserver 0.0.0.0:80


Installation Instructions For Ubuntu

Step 1) VM Creation:

  1. Click the Launch on Compute Engine button to choose the hardware and network settings.
  2. You can see at this page, an overview of Cognosys Image as well as some estimated costs of VM.
  3. In the settings page, you can choose the number of CPUs and amount of RAM, the disk size and type etc.

Step 2) SSH Connection: To connect to the deployed instance, Please follow Instructions to Connect to Ubuntu instance on Google Cloud

1) Download Putty.

2) Connect to the virtual machine using SSH key

  • Hostname: PublicDNS  / IP of machine
  • Port : 22

Step 3)  Application URL: Access the application via a browser at “https://localhost/admin”

Step 4) How Can We Get Started With Django?

To get started, we suggest the following steps:

1. Open Command Prompt by Clicking on Desktop Icon and choose path for project ( For Example: cd C: )
2. Enter in Command Prompt – virtualenv name_of_env ( For Example: virtualenv test )
3. Enter in Command Prompt – cd name_of_env ( It will go to your Env Directory )
4. Enter in Command Prompt – pip freeze ( To check ENV Version )
5. Enter in Command Prompt – .\Scripts\activate ( TO actiavte ENV )
6. Enter in Command Prompt – pip freeze ( To see Django Version , If empty then follow 8th step )
7. Enter in Command Prompt – pip install django==1.6.5 ( It will install Django latest version )
8. Enter in Command Prompt – pip freeze ( To see Django Version , If empty then follow 8th step )
9.Enter in Command Prompt – python .\Scripts\django-admin.py startproject projectname
10.Enter in Command Prompt – cd project name
11.Enter in Command Prompt – python manage.py syncdb
12.Fill all the details – Username(optional) || Mail ID(optional) || Password(Compulsory)
13. Enter in Command Prompt – python manage.py runserver 0.0.0.0:80

Installation Instructions For Redhat

Step 1) VM Creation:

  1. Click the Launch on Compute Engine button to choose the hardware and network settings.

2.You can see at this page, an overview of Cognosys Image as well as some estimated costs of VM.  

3.In the settings page, you can choose the number of CPUs and amount of RAM, the disk size and type etc.

Step 2) SSH Connection: To connect to the deployed instance, Please follow Instructions to Connect to Ubuntu instance on Google Cloud

1) Download Putty.

2) Connect to the virtual machine using SSH key

  • Hostname: PublicDNS  / IP of machine
  • Port : 22

Step 3) Application URL: Access the application via a browser at http://<yourip>/django

A) You will see the page where you can configure your site data with site name, django admin name etc.

B) On next page you will see configuration success message.

C) You can login to the django admin portal with the django username and its generated password from point A shown above.

D) You can access the configured site at http://yourIP/django

Step 5) Other Information:

1.Default ports:

  • Linux Machines:  SSH Port – 22

2. To access Webmin interface for management please follow this link

Step 4) How Can We Get Started With Django?

To get started, we suggest the following steps:

1. Open Command Prompt by Clicking on Desktop Icon and choose path for project ( For Example: cd C: )
2. Enter in Command Prompt – virtualenv name_of_env ( For Example: virtualenv test )
3. Enter in Command Prompt – cd name_of_env ( It will go to your Env Directory )
4. Enter in Command Prompt – pip freeze ( To check ENV Version )
5. Enter in Command Prompt – .\Scripts\activate ( TO actiavte ENV )
6. Enter in Command Prompt – pip freeze ( To see Django Version , If empty then follow 8th step )
7. Enter in Command Prompt – pip install django==1.6.5 ( It will install Django latest version )
8. Enter in Command Prompt – pip freeze ( To see Django Version , If empty then follow 8th step )
9.Enter in Command Prompt – python .\Scripts\django-admin.py startproject projectname
10.Enter in Command Prompt – cd project name
11.Enter in Command Prompt – python manage.py syncdb
12.Fill all the details – Username(optional) || Mail ID(optional) || Password(Compulsory)
13. Enter in Command Prompt – python manage.py runserver 0.0.0.0:80

Videos

Secured Django on Ubuntu 14.04 LTS 

Django on cloud

Related Posts