Link to project: https://cheat-django.herokuapp.com/
Screenshots attached on the very bottom
Purpose of this project was to
learn basic Django 3.2.9, MVT, ORM
DjangoDebugToolbar, Authorization, STMP
HTML, CSS, Jinja2
The first thing to do is to clone the repository:
$ git clone https://github.com/dianaGera/django-cheat-sheets.git
$ cd django-cheat-sheets
$ python3 -m venv venv
$ venv\Scripts\activate (Windows)
$ source venv/bin/activate (Linux)
pip install -r requirements.txt
Set up PostgreSQL on Windows/Mac/Linux
Create Database (PostgreSQl official Documentation)
# Create the DB using default credentials or change it in settings.py:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.getenv('NAME', 'django_lessons'),
'USER': os.getenv('USER', 'django'),
'PASSWORD': os.getenv('PASSWORD', 'password'),
'HOST': os.getenv('HOST', 'localhost'),
'PORT': os.getenv('PORT', '5432'),
}
}
$ psql -h host -p port -d dbname -U username -f filename.sql
Path to db -> django-cheat-sheets/database/db.sql
$ python manage.py makemigrations
$ python manage.py migrate
$ python manage.py runserver
** Enjoy :)
$ pg_dump -U username dbname > filename.sql
(Heroku CLI)$ heroku run --app you-app-name pg_dump -U username dbname > filename.sql
$ psql -h host -p port -d dbname -U username -f filename.sql
(Heroku CLI)$ heroku pg: psql -h host -p port -d dbname -U username -f filename.sql