Posts

Showing posts from August, 2020

Django: Error: You don't have permission to access that port

Here my env: /home/user/test/env project: /home/user/test/mysite sudo sh -c ". $HOME/test/env/bin/activate && cd $HOME/test/ && python manage.py runserver --insecure 0.0.0.0:80"

Set up Django with apache

1. Create Project [ for project structure]         mkdir django_project         cd django_project          virtualenv env          source env/bin/activate          pip3 install django         // Set up static file & media file         // setting.py          //import os          //at the end of file         STATIC_ROOT = os.path.join(BASE_DIR, "static/")      // collect static file        python3 manage.py collectstatic 2. Create site for django         sudo nano /etc/apache2/sites-available/djangoproject.conf         //Add this in conf file with your domain and directory         <VirtualHost *:80>             ServerAdmin admin@djang...

Install Docker in ubuntu

1.  sudo apt-get update 2. sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common 3.  curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - 4. sudo apt-key fingerprint 0EBFCD88 5. sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $( lsb_release -cs ) \ stable"

Install Django with Virtual Env

1. Update package & Install Python3 2. Install pip3           sudo apt install python3-pip 3. Install Virtual Env           sudo pip3 install virtualenv 4. Set up Environment           virtualenv -p python3 env_name 5. Activate Env         source env_name/bin/activate 6. Install Django           pip3 install djang           OR           pip3 install django==2.0.2 //For Specific version