New apps created are located in the project root, not inside the project slug
See original GitHub issueWhat happened?
When creating a new app using python manage.py startapp <name-of-the-app>
, the application is created within the project root
What should’ve happened instead?
The application should be created within the project slug, as indicated here
Steps to reproduce
- Create a bare new application using cookiecutter-django
- Install all requirements into your virtualenvironment using
pip install -r requirements/local.txt
- Try to create a new app (with the name foo, for instance) using
python manage.py startapp foo
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Android project not found. Maybe run react-native android first?
Open your React Native Project Root Directory and locate android -> app ... You should consider using the new upgrade tool based on...
Read more >Manage projects - GitLab Docs
On the right of the page, select New project. Select Create blank project. Enter the project details: In the Project name field, enter...
Read more >[Feedback] App Directory in Next.js 13 #41745 - GitHub
Next.js 13 introduces the app directory (beta) with new features and conventions. However, upgrading to Next.js 13 does not require using the app...
Read more >AppCenterDistribute@3 - App Center distribute v3 task
Selects the service connection for Visual Studio App Center. To create one, click the Manage link and create a new service connection. appSlug...
Read more >Glossary of terms - Expo Documentation
Slug. We use the word "slug" in app. json to refer to the name to use for your app in its url. For...
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
@JCepedaVillamayor
this is the expected behavior, because cookiecutter-django does not change the way that django
startapp
works. ( I tried doing this in another branch, but, I did not like having to rewrite almost everything to include this relatively simple logic. the django startapp, apparently, was not projected to be extended 😢 )you’ll have to fix this manually:
1 - create the
<name-of-the-app>
app with python manage.py startapp 2 - move<name-of-the-app>
directory to<project_slug>
directory 3 - edit<project_slug>/<name-of-the-app>/apps.py
and changename = "<name-of-the-app>"
toname = "<project_slug>.<name-of-the-app>"
4 - add"<project_slug>.<name-of-the-app>.apps.<NameOfTheAppConfigClass>",
on yourLOCAL_APPS
onconfig/settings/base.py
if that is enough to answer the question. please close this issue. We gladly accept code and documentation contributions.
This would seem to be a subject/issue worthy of documentation, perhaps inclusion in the startapp work flow. I see manual fixes presented as a reply to an issue, but surely this is worth addressing to the wider audience who may not come into the issues for a solution? Is this just me?