Skip to content

Instantly share code, notes, and snippets.

@AlessandraRomualdo
Last active January 4, 2024 19:05
Show Gist options
  • Save AlessandraRomualdo/f00008ed08ce5422af60f38e5887b9fa to your computer and use it in GitHub Desktop.
Save AlessandraRomualdo/f00008ed08ce5422af60f38e5887b9fa to your computer and use it in GitHub Desktop.
Django Cheatsheet

Django Cheatsheet

Create a virtual environment

python3 -m venv .ven
source .venv/bin/activate

Installing Django

pip install django

Installing Pillow (work with images)

pip install Pillow

Creating a project

django-admin startproject projectName

Starting a server

python manage.py runserver

Creating an app

python manage.py startapp AppName

Creating a migration

python manage.py makemigrations

Applying the migration

python manage.py migrate

Creating the admin user

python manage.py createsuperuser

Enter db via CLI

python3 manage.py shell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment