# Django

OS: Ubuntu

Create a user with Sudo permission

* Install vs code
* Create a virtual environment

&#x20;

&#x20;

Useful commands\
&#x20;

sudo code --user-data-dir=/home/mohan/.config/Code/ --no-sandbox --disable-gpu-sandbox

&#x20;

Open terminal upon launching vscode

&#x20;

&#x20;

&#x20;

\#Django version

django-admin.py --version

&#x20;

&#x20;

&#x20;

\#create a Venv

python3 -m venv djangoapps

&#x20;

&#x20;

\#activate the venv

source djangoapps/bin/activate

&#x20;

\#install django

pip install django

pip install psycopg

&#x20;

&#x20;

\#creating a New Project

django-admin startproject Core .

&#x20;

&#x20;

python manage.py migrate

python manage.py makemigrations

python manage.py runserver

&#x20;

&#x20;

&#x20;

Postgresql

access to user

sudo -u postgres psql

CREATE ROLE mohan;

ALTER ROLE mohan CREATEDB;

ALTER ROLE mohan LOGIN;

\q

&#x20;

&#x20;

&#x20;

Primary settings on settings.py

&#x20;

DEBUG = True

&#x20;

&#x20;User regsitration, login, password reset page, logout

&#x20;

Accept the domain name/IP range from user

&#x20;

Accept user preferences and keys

&#x20;

&#x20;OS: Ubuntu

Create a user with Sudo permission

* Install vs code
* Create a virtual environment

&#x20;

&#x20;

Useful commands\
&#x20;

sudo code --user-data-dir=/home/mohan/.config/Code/ --no-sandbox --disable-gpu-sandbox

&#x20;

Open terminal upon launching vscode

&#x20;

&#x20;

&#x20;

\#Django version

django-admin.py --version

&#x20;

&#x20;

&#x20;

\#create a Venv

python3 -m venv djangoapps

&#x20;

&#x20;

\#activate the venv

source djangoapps/bin/activate

&#x20;

\#install django

pip install django

pip install psycopg

&#x20;

&#x20;

\#creating a New Project

django-admin startproject Core .

&#x20;

&#x20;

python manage.py migrate

python manage.py makemigrations

python manage.py runserver

&#x20;

&#x20;

&#x20;

Postgresql

access to user

sudo -u postgres psql

CREATE ROLE mohan;

ALTER ROLE mohan CREATEDB;

ALTER ROLE mohan LOGIN;

\q

&#x20;

&#x20;

&#x20;

Primary settings on settings.py

DEBUG = True

&#x20;

&#x20;

Databases

&#x20;

Reference:

<https://github.com/CryceTruly/trulyexpensesyoutube>

Databases
