-
Django – makemigrations – No changes detected
To create initial migrations for an app, run makemigrations and specify the app name. The migrations folder will be created. python manage.py makemigrations appname Your app must be included in INSTALLED_APPS first (inside settings.py).
-
How to order by query set in django
Order by Ascending order Ascending.objects.all().filter(product_id=product_id).order_by(‘created_date’) Order by Descending order Descending.objects.all().filter(product_id=product_id).order_by(‘-created_date’) – (hyphen) in django is used to indicate descending order. Thank you for reading this article, I really appreciate it. If you have any question feel free to leave a comment.
-
Installation of Django on Virtual Environment
Installation of Django on Virtual Environment Install virtualenv virtualenv environmentname Note:- environmentname can be replace by any name you want for your environment. Activate environmentname\Scripts\activate Note:- To deactivate virtual environment use following command.deactivate Install Django pip install django Verify your Django Installation django-admin –version Create Project in Django django-admin startproject projectname Note:- Replace projectname with…
-
Installation of Django on Virtual Environment
Installation of Django on Virtual Environment Install virtualenv virtualenv environmentname Note:- environmentname can be replace by any name you want for your environment. Activate environmentname\Scripts\activate Note:- To deactivate virtual environment use following command. deactivate Install Django pip install django Verify your Django Installation django-admin –version Create Project in Django django-admin startproject projectnameNote:- Replace projectname with…