“command not found: django-admin”

django-admin should be on your system path if you installed Django via python setup.py. If it’s not on your path, you can find it in site-packages/django/bin, where site-packages is a directory within your Python installation. Consider symlinking to django-admin from some place on your path, such as /usr/local/bin.

If django-admin doesn’t work but django-admin.py does, you’re probably using a version of Django that doesn’t match the version of this documentation. django-admin is new in Django 1.7.

Mac OS X permissions

If you’re using Mac OS X, you may see the message “permission denied” when you try to run django-admin. This is because, on Unix-based systems like OS X, a file must be marked as “executable” before it can be run as a program. To do this, open Terminal.app and navigate (using the cd command) to the directory where django-admin is installed, then run the command sudo chmod +x django-admin.

Miscellaneous

I’m getting a UnicodeDecodeError. What am I doing wrong?

This class of errors happen when a bytestring containing non-ASCII sequences is transformed into a Unicode string and the specified encoding is incorrect. The output generally looks like this:

UnicodeDecodeError: 'ascii' codec can't decode byte 0x?? in position ?:
ordinal not in range(128)

The resolution mostly depends on the context, however here are two common pitfalls producing this error:

  • Your system locale may be a default ASCII locale, like the “C” locale on UNIX-like systems (can be checked by the locale command). If it’s the case, please refer to your system documentation to learn how you can change this to a UTF-8 locale.

  • You created raw bytestrings, which is easy to do on Python 2:

    my_string = 'café'
    

    Either use the u'' prefix or even better, add the from __future__ import unicode_literals line at the top of your file so that your code will be compatible with Python 3.2 which doesn’t support the u'' prefix.

最新文章

  1. BZOJ 题目整理
  2. 用SMIL语言编写一个简单的演示
  3. WAMP启动失败简单解决方法
  4. 用Nifi合并二个API、计算并生成新的API
  5. Hadoop实战4:MapR分布式集群的安装配置及shell自动化脚本
  6. 【51nod】1376 最长递增子序列的数量
  7. 解决VS如何同时打开两个工程(xp和win7)
  8. http server v0.1_http_parse.c
  9. JAVA在线基础教程!
  10. EL表达式学习
  11. download 下载文件 IE兼容性处理
  12. (原)HashMap之java8新特性
  13. typedef void(*Fun)(void);
  14. 60cms Cookies欺骗漏洞审计
  15. 二维码解析:使用 JavaScript 库reqrcode.js解析二维码
  16. Java--static、final、static final的区别
  17. nyoj-659-推断三角形(大坑)
  18. nohup磁盘打满问题排查与解决
  19. .NET破解之PDF编辑器
  20. jquery mobile小经验

热门文章

  1. HDU 1160 FatMouse's Speed
  2. HDU 1512 Monkey King
  3. 一些纯css3写的公司logo
  4. python - 简明 性能测试
  5. Python [Leetcode 345]Reverse Vowels of a String
  6. Python [Leetcode 141]Linked List Cycle
  7. Java多线程-工具篇-BlockingQueue
  8. Solr部署准备
  9. C# 中对WinForm窗体中的控件快速设置TableIndex次序
  10. Android学习随笔--ListView的分页功能