How to Deploy Django Project on Pythonanywhere | How to Free Deploy Django Project on Server | Part1

 

Search web browser (pythonanywhere) and Login :-

Step:-

 1. open up a Bash console and clone your repository (git clone)

2. create a virtualenv: (mkvirtualenv --python=/usr/bin/python3.8 myven)

3. Install Django: (pip install django)

4. Goto web create a new web app 

  • Click the add new web app.
  • Click the Manual Configuration.
  • Select the python version. 
  • Click on next button.
5. Add the path virtualenv.

6. click the WSGI Configuration File:

7. open file add following code :


# +++++++++++ DJANGO +++++++++++
# To use your own django app use code like this:
import os
import sys

# assuming your django settings file is at '/home/myusername/mysite/mysite/settings.py'
path = '/home/myusername/mysite'
if path not in sys.path:
    sys.path.insert(0, path)

os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'

# serve django via WSGI
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
8. Open setting Change the ALLOWED_HOSTS[] -> ALLOWED_HOSTS['*']
9. Goto web Reload Project .
10. Click on Configuration for  Theacx.pythonanywhere.com

Comments

Popular posts from this blog

How to install Pip pillow | Install Pip Pillow | Python pip | Python pillow tutorial

Samsung Galaxy F62 | Samsung Galaxy F62 with 6.7-inch FHD+ AMOLED Infinity O Display, Exynos 9825, 7000mAh battery launched in India starting at Rs. 23999

How to Create the Button in Android Studio. | Button | Android Studio.