manage.py: manage.py is a command-line utility used to interact with the project. It is a thin wrapper around the django-admin.py tool. You do not need to edit this file.
If your project want to run in English and a Spanish version edit the settings.py file of your project and add the following LANGUAGES setting to it. Place it next to the LANGUAGE_CODE setting: LANGUAGES = ( ('en', 'English'), ('es', 'Spanish'), ) The LANGUAGES setting contains two tuples that consist of a language code and a name . Language codes can be locale-specific , such as en-us or en-gb , or generic , such as en . With this setting, we specified that application will only be available in English and Spanish. If you don't define a custom LANGUAGES setting, the site will be available in all the languages that Django is translated into. Make your LANGUAGE_CODE setting look as follows: ...
You can exclude certain results from the QuerySet using the exclude() method of the manager. For Ex:, you can retrieve all posts published in 2019 whose titles don't start with xyz: Posts.objects.filter(publish__year=2019).exclude(title__startswith='xyz')
Comments
Post a Comment