Posted over 2 years ago. Visible to the public. Draft.

django create app in subdir

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):

Copy
mkdir apps/polls

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

Copy
startapp polls apps/polls

Install the app;

Copy
INSTALLED_APPS = [ 'apps.polls' ]

migrate:

Copy
makemigrations polls migrate

optional:
main urls.py

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

See Also

django migrate

Owner of this card:

Avatar
Cuauhtemoc
Last edit:
almost 2 years ago
by Cuauhtemoc
Posted by Cuauhtemoc to Python Django
This website uses short-lived cookies to improve usability.
Accept or learn more