django create app in subdir

Posted Over 5 years ago. Visible to the public. Draft.

To create a "polls" app in the "apps" sub-directory, do the following first to make the directory (assuming you are at the root of your django project):

mkdir apps/polls

Next, run startapp to create "polls" in under the "app" project directory.

startapp polls apps/polls

Install the app;

INSTALLED_APPS = [
'apps.polls'
]

migrate:

makemigrations polls
migrate

optional:
main urls.py

urlpatterns = [
path('polls/',include('apps.polls.urls'),
]

See Also

django migrate

Cuauhtemoc
Last edit
About 5 years ago
Cuauhtemoc
Posted by Cuauhtemoc to Python Django (2018-07-24 18:37)