https://m7madmomani2.github.io/reading-notes2
-> take folder_name
-> poetry init -n
-> poetry add django
-> poetry add --dev black flake8
-> poetry shell
-> django-admin startproject project_name .
-> python manage.py migrate
-> django-admin startapp app_name
-> code .
urlpattren=[
path(‘’ ,NamePageListView.as_view(), name=’name_page’ )
]
python manage.py test
from django.contrib.auth import get_user_model
class Name_app(models.Model):
name = model.CharField(max_length=256)
rating = models.IntegerField(default=0)
reviewer = models.ForeignKey(get_user_model(),on_delete=models.CASCADE)
def __str__(self):
return self.name