question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NameError: global name 'VALIDATE_POSTAL_CODES' is not defined

See original GitHub issue

running the following command on command line produces the following error:

python manage.py cities --import=postal_code

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/mnt/data/dev/budhub/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line  
    utility.execute()
  File "/mnt/data/dev/budhub/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/mnt/data/dev/budhub/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 294, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/mnt/data/dev/budhub/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 345, in execute
    output = self.handle(*args, **options)
  File "/mnt/data/dev/budhub/venv/local/lib/python2.7/site-packages/django/utils/decorators.py", line 185, in inner
    return func(*args, **kwargs)
  File "/mnt/data/dev/budhub/venv/local/lib/python2.7/site-packages/cities/management/commands/cities.py", line 146, in handle
    func()
  File "/mnt/data/dev/budhub/venv/local/lib/python2.7/site-packages/cities/management/commands/cities.py", line 751, in import_postal_code
    if VALIDATE_POSTAL_CODES:
NameError: global name 'VALIDATE_POSTAL_CODES' is not defined

Seems to be missing an import on the cities management command in the current master branch.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:25 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
blagcommented, Dec 27, 2016

Closing - pushed to PyPI as version 0.5. Thank you all for your help!

1reaction
ghostcommented, Dec 27, 2016

@blag can confirm that import process works right till end ! Congratulations and thanks again !

Read more comments on GitHub >

github_iconTop Results From Across the Web

NameError: global name is not defined - python - Stack Overflow
I'm using Python 2.6.1 on Mac OS X. I have two simple Python files (below), but when I run python update_url.py. I get...
Read more >
python NameError: global name '__file__' is not defined
PYTHON : python NameError : global name '__file__' is not defined [ Gift : Animated Search Engine : https://www.hows.tech/p/recommended.html ] ...
Read more >
NameError: global name is not defined when Python
Continuing on in learning Python as I go I am at the next issue. I have created a Python toolbar add-in with a...
Read more >
NameError: global name 'layer' is not defined
Problem has been solved. I've changed the code a little bit. here is the final code. def btn_nuf_pressed(self): layer = geo_utils.
Read more >
Global Name Not Defined - General Discussion
NameError : global name 'p' is not defined. SELECT p.lpn AS "LPN", SUBSTRING(p.location, 2, 12) AS "ALOC", p.sku AS "SKU", p.lot_number AS ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found