carltongibson / neapolitan

Quick CRUD views for Django
https://noumenal.es/neapolitan/
MIT License
485 stars 34 forks source link

Cater for apps not in the project root #43

Closed nanorepublica closed 5 months ago

nanorepublica commented 5 months ago

Update mktemplate to find apps not in the project root, for example, projects generated via django-cookiecutter have a shared top-level directory for apps.

I would have preferred not to have recreated a whole new app for the test and would happily minimise this if possible.

carltongibson commented 5 months ago

As you express, I'm not so hot on the test either. It seems like a lot of noise for not much. (Half-minded to just skip it, but I'm feeling tired today, so let's just ponder a moment 😉)

OK, I've thought about it. 😜

I'm happy to take the change just with the existing test. Commit message something like:

Improved app folder discovery in mktemplate command.

Using `app_config.path` in more correct, since it leverages Django's app folder 
discovery, allowing apps to be placed in various locations. 

Django's test suite covers that app_config.path works for various locations. We just need to check that we can use that to create the template file, which the existing test already does.

Make sense?