Canonical location for local apps
See original GitHub issueCookiecutter-django defines apps inside project folder, i.e.: red_dwarf/red_dwarf/users. I tried following the convention, but Django complains that it can’t find my module, e.g.:
md red_dwarf/posts
python manage.py startapp red_dwarf/posts
config/settings/common.py
LOCAL_APPS = (
'ref_dwarf.posts.apps.PostsConfig',
)
ImportError: No module named ‘posts’
I’d have to adjust sys.path
to include the APPS_DIR, but then Django complains, burns, and crashes with Model class [...] doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS
So my question is, what is the recommended location for local apps? I’ve red the docs back to back, gh issues, and the internets but could not find a meaningful answer.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:5
- Comments:16 (3 by maintainers)
Top Results From Across the Web
Canonical location for local apps · Issue #881 · cookiecutter ...
The canonical place is inside the the project folder, otherwise the root folder gets littered with too much stuff. You can use startapp...
Read more >When installing user applications, where do "best practices ...
The /usr/local hierarchy is for use by the system administrator when installing software locally. It needs to be safe from being overwritten when...
Read more >URL Canonicalization and the Canonical Tag | Documentation
What is a canonical URL? A canonical URL is the URL of the page that Google thinks is most representative from a set...
Read more >Canonical Names of Control Panel Items - Win32 apps
As of Windows Vista, Control Panel items included with Windows are given a canonical name that can be used in an API call...
Read more >App install location - Android Developers
The unique container in which your application is stored is encrypted with a randomly generated key that can be decrypted only by the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve just been struggling with this myself, I had the same issue as @ltankey, tried @browniebroke suggestion but it created the files in the project folder. The only way I could create an app using docker-compose was to log in to a shell and create it from within the project folder.
As I understand it you should not create your app with startapp command. If you want new app
posts
just do this in the project root:Into your
apps.py
add this code:and in
config/settings/common.py
intoLOCAL_APPS
addred_dwarf.posts
so it will looks like this:And you can start code your app. It works perfectly for me.