Pages

How to setup an SSH Key and connect to ubuntu server

  1. Create SSH Key using
    ssh-keygen

  2. Copy .pub key to server
    ssh-copy-id username@remote_host

  3. Validate previous steps by connecting to server
    ssh username@remote_host

  4. disable password authentication
  5. enable firewall

How to run Django Server from VSCode

 Hi Noonari, 

Here is how  I did it.


Step 1. Install following plugins

  • Python (by microsoft)
  • Live Server
Step 2. Set python version to your virtual env by following these steps in bullets in order
  1. Press `CTRL+SHIFT+P`
    This will open a command pallet in vscode.
  2. Set the python version by selecting if it is visible in the dropdowns or by typing it like
    `Python > <path-to-venv>/bin/python`
  3. create launch.json (normally it is automatically created when you press run button so first press run and see if it runs or not and then check or create launch.json)
  4. add this as contents of launch.json
    {
        // Use IntelliSense to learn about possible attributes.
        // Hover to view descriptions of existing attributes.
        // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
        "version": "0.2.0",
        "configurations": [
            {
                "name": "Python: Django",
                "type": "python",
                "request": "launch",
       
                "program": "${workspaceFolder}/monolith/manage.py",
                "args": [
                    "runserver",
                    "--noreload"
                ],
                "django": true,
                "justMyCode": true
            }
        ]
    }
Step 3. Run and test.