NameError name is not defined

0 votes
PS E:\CokeStudio\std> python manage.py makemigrations
Traceback (most recent call last):
  File "manage.py", line 21, in <module>
    main()
  File "manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "C:\Users\Lenovo\python38\lib\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "C:\Users\Lenovo\python38\lib\site-packages\django\core\management\__init__.py", line 377, in execute
    django.setup()
  File "C:\Users\Lenovo\python38\lib\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Users\Lenovo\python38\lib\site-packages\django\apps\registry.py", line 114, in populate
    app_config.import_models()
  File "C:\Users\Lenovo\python38\lib\site-packages\django\apps\config.py", line 211, in import_models
    self.models_module = import_module(models_module_name)
  File "C:\Users\Lenovo\python38\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "E:\CokeStudio\std\Home\models.py", line 4, in <module>
    class services(models.Model):
  File "E:\CokeStudio\std\Home\models.py", line 7, in services
    phone =models.CharField(_(""), max_length=50)
NameError: name '_' is not defined
Jul 31, 2020 in Web Development by anonymous
• 120 points
3,137 views

1 answer to this question.

0 votes

Hello,

Just include this in you snippet:

from django.utils.translation import gettext as _

Hope this solve you error!! if not share your code

Thank You!

answered Aug 3, 2020 by Niroj
• 82,840 points

Related Questions In Web Development

0 votes
1 answer

Why does "window is not defined" error occur in Next.js?

"window is not defined" error in Next.js ...READ MORE

answered Dec 4, 2024 in Web Development by navya
73 views
0 votes
1 answer

Node js nodemiler Status 250 ok but mail is not received

Hi, @Sagar, I think you might simply be queuing the ...READ MORE

answered Dec 24, 2020 in Web Development by Gitika
• 65,770 points
4,207 views
0 votes
0 answers

TypeError: this.client.incrementMaxListeners is not a function

I'm making a command for my discord ...READ MORE

Dec 29, 2020 in Web Development by anonymous
• 120 points
861 views
0 votes
1 answer

Loading gif in jQuery ajax call is not showing

Create a div with your image. Make it ...READ MORE

answered Jun 27, 2022 in Web Development by rajatha
• 7,680 points
1,771 views
0 votes
0 answers

jQuery: Test if checkbox is NOT checked

I'm having trouble figuring this out. I ...READ MORE

Jun 29, 2022 in Web Development by gaurav
• 23,260 points
794 views
0 votes
1 answer

"JQuery not defined" throwing error after installing angular-slickgrid

1. Your CDN-hosted jQuery might be blocked If ...READ MORE

answered Jul 25, 2022 in Web Development by rajatha
• 7,680 points
1,493 views
0 votes
0 answers

Simple Registration page info is not added to database using localhost

When I use localhost, after completing my ...READ MORE

Jul 24, 2022 in Web Development by Kithuzzz
• 38,000 points
940 views
0 votes
0 answers

jQuery(...).iris is not a function

I am trying to implement color picker ...READ MORE

Jul 28, 2022 in Web Development by gaurav
• 23,260 points
683 views
+1 vote
1 answer

What is the relationship between angularjs Scope with controller/view?

Let us consider the below block: <div ng-controller="emp"> ...READ MORE

answered Jan 20, 2020 in Web Development by Niroj
• 82,840 points

edited Jan 21, 2020 by Niroj 1,241 views
+1 vote
1 answer

What is css box module?

Hey, All the element present in html follows ...READ MORE

answered Jan 20, 2020 in Web Development by Niroj
• 82,840 points

edited Jan 21, 2020 by Niroj 1,252 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP