question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New apps created are located in the project root, not inside the project slug

See original GitHub issue

What 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:closed
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

85reactions
luzfcbcommented, Dec 18, 2018

@JCepedaVillamayor

What happened? When creating a new app using python manage.py startapp <name-of-the-app>, the application is created within the project root

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 change name = "<name-of-the-app>" to name = "<project_slug>.<name-of-the-app>" 4 - add "<project_slug>.<name-of-the-app>.apps.<NameOfTheAppConfigClass>", on your LOCAL_APPS on config/settings/base.py

if that is enough to answer the question. please close this issue. We gladly accept code and documentation contributions.

13reactions
changelingcommented, Oct 11, 2020

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found