Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError: name 'MyAPI' is not defined #1

Open
lavig17 opened this issue Aug 26, 2019 · 3 comments
Open

NameError: name 'MyAPI' is not defined #1

lavig17 opened this issue Aug 26, 2019 · 3 comments

Comments

@lavig17
Copy link

lavig17 commented Aug 26, 2019

Could you help me with the error into video 17min?
Python=3.7

File "/home/luis/despliegueDjango/dj/lib/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/luis/despliegueDjango/DjangoAPI/DjangoAPI/urls.py", line 22, in
path('api/', MyAPI.site.urls),
NameError: name 'MyAPI' is not defined

@satssehgal
Copy link
Owner

Have you installed a virtual env? I would install the virtual env, all the dependencies as mentioned in the video and then create the project and app using Django admin.

Once you have done that move the py files to its relevant folder. It should work.
Also ensure you have python 3.7 installed

@lavig17
Copy link
Author

lavig17 commented Aug 26, 2019

I created: virtualenv dj python3
source dj/bin/activate
next, It functions ok http://127.0.0.1:8000/admin/
but when I modify MyAPI/urls.py generated error.
and don't visualization in http://127.0.0.1:8000/ the approvals
I attached my file: https://drive.google.com/file/d/19Tt7o_yET_XSG-QQbjqyVPSvglnk4Th_/view?usp=sharing

@satssehgal
Copy link
Owner

You also have to create the project and app, make migrations then move the python files over

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants