179
They must be valid package names. That rules out 2 (โimport my-django-appโ would be a syntax error). PEP 8 says:
Modules should have short, all-lowercase names. Underscores can be used
in the module name if it improves readability. Python packages should
also have short, all-lowercase names, although the use of underscores is
discouraged.
So, 1 and 3 are both valid, but 3 would be the recommended approach.
40
some good examples
- graphene_django
- users
- orders
- oauth2_provider
- rest_framework
- polls
in simple terms, app_name
should have short, all-lowercase names. Underscores can be used in the module name if it improves readability. also should have a short name and it can be a plural and singular name
- [Django]-Django-tables2: How to use accessor to bring in foreign columns?
- [Django]-Create empty queryset by default in django form fields
- [Django]-How can I get tox and poetry to work together to support testing multiple versions of a Python dependency?
9
App directory names must be a valid Python package name. This means that option 2 is completely inadmissible as a package name, although it can still be used for other purposes, such as documentation. In the end it comes down to personal style. If you prefer option 3 then use it.
- [Django]-How can I activate the unaccent extension on an already existing model
- [Django]-TransactionManagementError "You can't execute queries until the end of the 'atomic' block" while using signals, but only during Unit Testing
- [Django]-Github issues api 401, why? (django)
0
My votes for 1 and 3, but you can check several popular apps:
http://www.django-cms.org/
http://geodjango.org/
- [Django]-Serializer call is showing an TypeError: Object of type 'ListSerializer' is not JSON serializable?
- [Django]-How do I clone a Django model instance object and save it to the database?
- [Django]-Django migration fails with "__fake__.DoesNotExist: Permission matching query does not exist."