To setup and install Django server on any of the cloud platforms, the recommended way is to setup a VM using the Django image available from the marketplace. Details below:
By default, the Django application can not be accessed from the remote hosts. So you will need to allow Django for external hosts. You can do it by adding your server IP in settings.py. Run the following command, change the mysite folder directory depending on where you’ve installed Django
sudo nano mysite/settings.py
Change the following line:
Â
ALLOWED_HOSTS = [‘your-server-ip’] – Make sure to add the quotations ‘ ‘
Â
Save and close the file. Then, start the Django application with the following command:
Â
Make sure you’re still in your Django root application folder.
Â
python3 manage.py runserver 0.0.0.0:8000
Â
You should see the following output:
Django application has now started and runs on port 8000.
Â
Go to your ServerIP:8000 and you should see the following page:
Â
Â
To use the administrative web admin, Access with /admin
Â
Login with username and password which was setup earlier.
Â
Â
Thats it, you’re now ready to start building your first app.
Django Documentation / Support
Â
Documentation on using Django can be found on the official website:
Disclaimer: Django is a registered trademark owned by Django Software Foundation (DSF) and is licensed under BSD license. No warrantee of any kind, express or implied, is included with this software. Use at your risk, responsibility for damages (if any) to anyone resulting from the use of this software rest entirely with the user. The author is not responsible for any damage that its use could cause.
Cloud Solution Architect. Helping customers transform their business to the cloud. 20 years experience working in complex infrastructure environments and a Microsoft Certified Solutions Expert on everything Cloud.
00votes
Article Rating
Subscribe
Login and comment with
I allow to create an account
When you login first time using a Social Login button, we collect your account public profile information shared by Social Login provider, based on your privacy settings. We also get your email address to automatically create an account for you in our website. Once your account is created, you'll be logged-in to this account.
DisagreeAgree
Login and comment with
I allow to create an account
When you login first time using a Social Login button, we collect your account public profile information shared by Social Login provider, based on your privacy settings. We also get your email address to automatically create an account for you in our website. Once your account is created, you'll be logged-in to this account.