I have problem when i import Django-Markdownx

255 views Asked by At

i have problem when i import markdownx. i installed Markdownx for Django, and add in url. and i want to in models.py, but it has problem. problem is.. (Import 'markdownx.models' could not be resolved Pylance(reportMissingImports) [3, 6])

And my code

Settings.py

INSTALLED_APPS = [
    'blog',
    'single_pages',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django_extensions',
    'crispy_forms',
    'markdownx',
]

project/urls.py

urlpatterns = [
    path('admin/', admin.site.urls),
    path('blog/', include('blog.urls')),
    path('markdownx/', include('markdownx.urls')),
    path('', include('single_pages.urls')),
]

blog/models.py

from markdownx.models import MarkdownxField


class Post(models.Model):
    title = models.CharField(max_length=30)
    hook_text = models.CharField(max_length=100, blank=True)
    content = MarkdownxField()

when i import this line, it has problem

0

There are 0 answers