Answer the question
In order to leave comments, you need to log in
"SystemError: Parent module '' not loaded, cannot perform relative import" what is the error?
article/
...
├── forms.py
├── __init__.py
├── models.py
├── static
│  ├── article
│  └── static_root
├── templates
│  ├── about.html
│  ├── article
│  ├── contact.html
│  └── thanks.html
├── urls.py
└── views.py
from django import forms
class ContactForm(forms.Form):
subject = forms.CharField(max_length=50)
message = forms.CharField(widget=forms.Textarea)
sender = forms.EmailField()
cc_myself = forms.BooleanField(required=False)
...
from .forms import ContactForm
from .models import Article
...
Traceback (most recent call last):
File "/home/danya/PycharmProjects/blog/article/views.py", line 8, in <module>
from .forms import ContactForm
SystemError: Parent module '' not loaded, cannot perform relative import
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question