CMed01 / django_project_gitpod

0 stars 0 forks source link

Notes

Database

pip3 install dj-database-url~=0.5 psycopg2~=2.9

Field Types

Static Files Setup

Migration

META DATA

ALLAUTH

Crispy Forms

Clouidnary

HTML validation

Javascript, CSS, Lighthouse

Python

How to test Django

Method Checks that...
assertTrue(a) a is True
assertFalse(a) a is False
assertEqual(a, b) a == b
assertNotEqual(a, b) a != b
assertIn(a, b) a is in b
assertNotIn(a, b) a is not in b
assertIsInstance(a, b) a is an instance of b
Terminal Command Explanation
python3 manage.py test Run all tests.
python3 manage.py test about Run all tests in the about app.
python3 manage.py test about.test_forms Run all tests in the test_forms.py file, in the about app.
python3 manage.py test about.test_forms. TestCollaborateForm Run all tests in the TestCollaborateForm class in about.test_forms.
python3 manage.py test about.test_forms.TestCollaborateForm.test_form_is_valid Run a single test, test_form_is_valid, within the location specified.

Useful Links