목록Personal DB (108)
Silver Library (Archived)
Unlike other language does function like function(): in Django, this sounds like: {% if something.has_previous %} no (bracket), nor colon + except Exception stead, using Exception such like exception EmptyPage is better to use. => in order to return when a specific error occurred, targeting response to the error is better. (stead of Excepting all equally). *Why doing this? To prevent a troll use..
Jango does not allow to edit too much on the template (e.g. HTML) So, instead of the template: go to views.py, to add some custom logic. Patient...and remember: numeric code means...literally numeric outcome to see it. docs.djangoproject.com/en/3.1/ref/templates/builtins/ Built-in template tags and filters | Django documentation | Django Django The web framework for perfectionists with deadlines..
Finally, back to the track. And found that how I generate them with a random number as well. def add_arguments(self, parser): parser.add_argument( "--number", default=2, type=int, help="How many rooms you want to create" ) On terminal, python manage.py seed_rooms --number (input the amount I want to create, without bracket) * Once I stuck, be sure to go back from the current position first. Not ..
I know I should not waste my time here...but finally, I understood where the problem came from. [I FORGOT TO ADD A CONTENTS IN THE ADMIN SECTOR. e.g. ROOMS, REVIEWS.] Very easy. I just forgot to add them all again after I cleaned up the materials for the testing purpose. Least now I know the code was perfect, and I can proceed to the next phase. =========== If I face any error with a message "Mo..