2
0

troubleshooting.txt 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. ===============
  2. Troubleshooting
  3. ===============
  4. This page contains some advice about errors and problems commonly encountered
  5. during the development of Django applications.
  6. .. _troubleshooting-django-admin:
  7. Problems running ``django-admin``
  8. =================================
  9. ``command not found: django-admin``
  10. -----------------------------------
  11. :doc:`django-admin </ref/django-admin>` should be on your system path if you
  12. installed Django via ``pip``. If it's not in your path, ensure you have your
  13. virtual environment activated and you can try running the equivalent command
  14. ``python -m django``.
  15. macOS permissions
  16. -----------------
  17. If you're using macOS, you may see the message "permission denied" when
  18. you try to run ``django-admin``. This is because, on Unix-based systems like
  19. macOS, a file must be marked as "executable" before it can be run as a program.
  20. To do this, open Terminal.app and navigate (using the ``cd`` command) to the
  21. directory where :doc:`django-admin </ref/django-admin>` is installed, then
  22. run the command ``sudo chmod +x django-admin``.
  23. Miscellaneous
  24. =============
  25. I'm getting a ``UnicodeDecodeError``. What am I doing wrong?
  26. ------------------------------------------------------------
  27. This class of errors happen when a bytestring containing non-ASCII sequences is
  28. transformed into a Unicode string and the specified encoding is incorrect. The
  29. output generally looks like this:
  30. .. code-block:: pytb
  31. UnicodeDecodeError: 'ascii' codec can't decode byte 0x?? in position ?:
  32. ordinal not in range(128)
  33. The resolution mostly depends on the context, however here are two common
  34. pitfalls producing this error:
  35. * Your system locale may be a default ASCII locale, like the "C" locale on
  36. UNIX-like systems (can be checked by the ``locale`` command). If it's the
  37. case, please refer to your system documentation to learn how you can change
  38. this to a UTF-8 locale.
  39. Related resources:
  40. * :doc:`Unicode in Django </ref/unicode>`
  41. * https://wiki.python.org/moin/UnicodeDecodeError