{"title":"Solución de problemas","version":"1.9","locale":"es","docname":"faq/troubleshooting","url":"/es/1.9/faq/troubleshooting/","canonical":"https://djangodocs.dev/es/1.9/faq/troubleshooting/","summary":"Esta página contiene algunos consejos sobre los errores y problemas que se encuentran comúnmente durante el desarrollo de las aplicaciones de Django. Problemas…","html":"<h1>Solución de problemas<a class=\"heading-anchor\" href=\"#troubleshooting\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p>Esta página contiene algunos consejos sobre los errores y problemas que se encuentran comúnmente durante el desarrollo de las aplicaciones de Django.</p>\n<section id=\"problems-running-django-admin\">\n<span id=\"troubleshooting-django-admin\"></span><h2>Problemas ejecutando django-admin<a class=\"heading-anchor\" href=\"#problems-running-django-admin\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<section id=\"command-not-found-django-admin\">\n<h3>«comando no encontrado: django-admin»<a class=\"heading-anchor\" href=\"#command-not-found-django-admin\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p><a class=\"reference internal\" href=\"/es/1.9/ref/django-admin/\"><span class=\"doc\">django-admin</span></a> should be on your system path if you\ninstalled Django via <code class=\"docutils literal notranslate\"><span class=\"pre\">python</span> <span class=\"pre\">setup.py</span></code>. If it’s not on your path, you can\nfind it in <code class=\"docutils literal notranslate\"><span class=\"pre\">site-packages/django/bin</span></code>, where <code class=\"docutils literal notranslate\"><span class=\"pre\">site-packages</span></code> is a directory\nwithin your Python installation. Consider symlinking to <a class=\"reference internal\" href=\"/es/1.9/ref/django-admin/\"><span class=\"doc\">django-admin</span></a> from some place on your path, such as\n<code class=\"file docutils literal notranslate\"><span class=\"pre\">/usr/local/bin</span></code>.</p>\n<p>If <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code> doesn’t work but <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin.py</span></code> does, you’re probably\nusing a version of Django that doesn’t match the version of this documentation.\n<code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code> is new in Django 1.7.</p>\n</section>\n<section id=\"mac-os-x-permissions\">\n<h3>Permisos Mac OS X<a class=\"heading-anchor\" href=\"#mac-os-x-permissions\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>If you’re using Mac OS X, you may see the message «permission denied» when\nyou try to run <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code>. This is because, on Unix-based systems like\nOS X, a file must be marked as «executable» before it can be run as a program.\nTo do this, open Terminal.app and navigate (using the <code class=\"docutils literal notranslate\"><span class=\"pre\">cd</span></code> command) to the\ndirectory where <a class=\"reference internal\" href=\"/es/1.9/ref/django-admin/\"><span class=\"doc\">django-admin</span></a> is installed, then\nrun the command <code class=\"docutils literal notranslate\"><span class=\"pre\">sudo</span> <span class=\"pre\">chmod</span> <span class=\"pre\">+x</span> <span class=\"pre\">django-admin</span></code>.</p>\n</section>\n</section>\n<section id=\"miscellaneous\">\n<h2>Miscelánea<a class=\"heading-anchor\" href=\"#miscellaneous\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<section id=\"i-m-getting-a-unicodedecodeerror-what-am-i-doing-wrong\">\n<h3>Estoy obteniendo «UnicodeDecodeError». ¿Qué estoy haciendo mal?<a class=\"heading-anchor\" href=\"#i-m-getting-a-unicodedecodeerror-what-am-i-doing-wrong\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>This class of errors happen when a bytestring containing non-ASCII sequences is\ntransformed into a Unicode string and the specified encoding is incorrect. The\noutput generally looks like this:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"ne\">UnicodeDecodeError</span><span class=\"p\">:</span> <span class=\"s1\">&#39;ascii&#39;</span> <span class=\"n\">codec</span> <span class=\"n\">can</span><span class=\"s1\">&#39;t decode byte 0x?? in position ?:</span>\n<span class=\"n\">ordinal</span> <span class=\"ow\">not</span> <span class=\"ow\">in</span> <span class=\"nb\">range</span><span class=\"p\">(</span><span class=\"mi\">128</span><span class=\"p\">)</span>\n</code></pre></div>\n<p>The resolution mostly depends on the context, however here are two common\npitfalls producing this error:</p>\n<ul>\n<li><p>Your system locale may be a default ASCII locale, like the «C» locale on\nUNIX-like systems (can be checked by the <code class=\"docutils literal notranslate\"><span class=\"pre\">locale</span></code> command). If it’s the\ncase, please refer to your system documentation to learn how you can change\nthis to a UTF-8 locale.</p></li>\n<li><p>You created raw bytestrings, which is easy to do on Python 2:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">my_string</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;café&#39;</span>\n</code></pre></div>\n<p>Either use the <code class=\"docutils literal notranslate\"><span class=\"pre\">u''</span></code> prefix or even better, add the\n<code class=\"docutils literal notranslate\"><span class=\"pre\">from</span> <span class=\"pre\">__future__</span> <span class=\"pre\">import</span> <span class=\"pre\">unicode_literals</span></code> line at the top of your file\nso that your code will be compatible with Python 3.2 which doesn’t support\nthe <code class=\"docutils literal notranslate\"><span class=\"pre\">u''</span></code> prefix.</p>\n</li>\n</ul>\n<p>Recursos relacionados:</p>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"/es/1.9/ref/unicode/\"><span class=\"doc\">Unicode en Django</span></a></p></li>\n<li><p><a class=\"reference external\" href=\"https://wiki.python.org/moin/UnicodeDecodeError\">https://wiki.python.org/moin/UnicodeDecodeError</a></p></li>\n</ul>\n</section>\n</section>","rootId":"troubleshooting","toc":[{"title":"Problemas ejecutando django-admin","anchor":"problems-running-django-admin","children":[{"title":"«comando no encontrado: django-admin»","anchor":"command-not-found-django-admin","children":[]},{"title":"Permisos Mac OS X","anchor":"mac-os-x-permissions","children":[]}]},{"title":"Miscelánea","anchor":"miscellaneous","children":[{"title":"Estoy obteniendo «UnicodeDecodeError». ¿Qué estoy haciendo mal?","anchor":"i-m-getting-a-unicodedecodeerror-what-am-i-doing-wrong","children":[]}]}],"breadcrumbs":[{"docname":"faq/index","title":"FAQ de Django","url":"/es/1.9/faq/"}],"prev":{"docname":"faq/contributing","title":"FAQ: Aportar código","url":"/es/1.9/faq/contributing/"},"next":{"docname":"ref/index","title":"API Reference","url":"/es/1.9/ref/"},"formats":{"html":"/es/1.9/faq/troubleshooting/","markdown":"/es/1.9/faq/troubleshooting.md","json":"/es/1.9/faq/troubleshooting.json"},"source":"https://github.com/django/django/blob/stable/1.9.x/docs/faq/troubleshooting.txt","official":"https://docs.djangoproject.com/es/1.9/faq/troubleshooting/","inVersions":["6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0","3.2","3.1","3.0","2.2","2.1","2.0","1.11","1.10","1.9"],"inLocales":["en","fr","ja","id","pt-br","es"]}