16👍
Change from tutorial.quickstart import views
to from quickstart import views
in both tutorial/url.py
file as well as tutorial/quickstart/views.py
file. This should work.
This is required as python automatically adds your current directory to sys path.
6👍
Just change tutorial.quickstart import views
to from quickstart import views
in both tutorial/url.py file as well as tutorial/quickstart/views.py file.
4👍
USE:
django-admin startproject tutorial .
INSTEAD of:
django-admin startproject tutorial
while you start the project.
It is mentioned in the documentation.(Read carefully)
- Django South migration conflict while working in a team
- How to use a tsvector field to perform ranking in Django with postgresql full-text search?
1👍
Make sure your tutorial.quickstart is in the same folder as your project.
Also make sure it is unzipped ! Otherwise use a absolute path.
Hope it helps !
- Add object level permission to generic view
- Django: Limiting the number of relationships in a OnetoMany relationship
- Django REST Framework different depth for POST/PUT?
- How to store google oauth token in django : Storage or database
1👍
You should use from quickstart import views
instead of from tutorial.quickstart import views
if you use PyCharm or other IDE. And don’t forget change code where use from tutorial.quickstart.[xxx] import [xxx]
.
- Could not import settings 'myproject.settings' (Is it on sys.path?): No module named pinax
- Django: <ul> inside help_text of field
1👍
In quickstart/views.py:
from .serializers import UserSerializer, GroupSerializer
in tutorial/urls.py:
from quickstart import views
That worked for me.
- Is it possible to add SQL comments to a query built with the ORM?
- Django ajax error response best practice
- Why am I getting the "MySQL server has gone away" exception in Django?
- Is there a way to hook Django's unittest into PyUnit in eclipse?
1👍
It works for me by modification tow importing files
- /tutorial/quickstart/views.py
from tutorial.quickstart.serializers import UserSerializer, GroupSerializer
to
from quickstart.serializers import UserSerializer, GroupSerializer
- /tutorial/urls.py
from tutorial.quickstart import views
to
from quickstart import views
0👍
i was getting this issues several times,
with-
python version3.6.9
django version3.2.14
and
restframework3.13.1
so, first step:
i just updated the python version to 3.9.13
and django version to 4.0.6
and restframework version was same as before.
second step:
Change from tutorial.quickstart import views
to from quickstart import views
in tutorial/urls.py
file
as well as if you write
from serializers import UserSerializer, GroupSerializer
or
from tutorials.quickstart.serializers import UserSerializer, GroupSerializer
in tutorial/quickstart/views.py
file then you can change it to
from quickstart.serializers import UserSerializer, GroupSerializer
or from .serializers import UserSerializer, GroupSerializer
.
Hopefully, This should work.
- Strategies to make a web application available offline?
- Limit Maximum Choices of ManyToManyField
- CharField max_length 2^n vs 2^n-1