Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

suggestion for quickstart tutorial page #506

Closed
harryghgim opened this issue May 19, 2021 · 1 comment
Closed

suggestion for quickstart tutorial page #506

harryghgim opened this issue May 19, 2021 · 1 comment
Labels

Comments

@harryghgim
Copy link

I follwed along the official tutorial here, and when I ran ./manage.py makemigrations helloworld, django won't make migrations by giving me this error

django.core.exceptions.ImproperlyConfigured: Cannot import 'helloworld'. Check that 'demo.helloworld.apps.HelloworldConfig.name' is correct.

Turned out app name helloworld was not recognised, so I had to change apps.py like the following

from django.apps import AppConfig


class HelloworldConfig(AppConfig):
    default_auto_field = 'django.db.models.BigAutoField'
    # name = 'helloworld' 
    name = 'demo.helloworld'  # new

And in demo/urls.py, I used path, rather than url. If a user uses django 3 version, path would be better in my opinion.

from django.contrib import admin
from django.urls import path, include
from django.views import generic
from material.frontend import urls as frontend_urls

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', generic.RedirectView.as_view(url='/workflow/', permanent=False)),
    path('', include(frontend_urls)),
 #]
@kmmbvnr
Copy link
Collaborator

kmmbvnr commented Nov 9, 2021

Thank you, indeed, django 3.2 apps module autodiscovery breaks ability to create apps in a subfolder without manual changes.

I fixed this by removing folder nesting in the quickstart.

@kmmbvnr kmmbvnr closed this as completed Nov 9, 2021
@kmmbvnr kmmbvnr added the bug label Nov 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants