Problems running django-admin
“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.
Problems running django-admin的更多相关文章
- Django admin 组件 原理分析与扩展使用 之 sites.py (一)
一 . 前言 Django 提供了admin 组件 为项目提供基本的管理后台功能(对数据表的增删改查). 本篇文章通过 admin源码 简单分析admin 内部原理 ,扩展使用方式,为以后进行定制和自 ...
- Configuring and Running Django + Celery in Docker Containers
Configuring and Running Django + Celery in Docker Containers Justyna Ilczuk Oct 25, 2016 0 Commen ...
- Django admin美化插件suit应用[原创]
前言 由于比较懒,自己弄了一个用户验证,没有自己写后台,用了django自带的user认证,并通过admin直接进行管理,但默认的admin并不漂亮,于是使用了这个django-suit插件,效果对比 ...
- Django admin 权威指南(一)
版本: Django 1.10 此部分由官方文档<6.5.1 The Django admin site>翻译而来. 6.5.1.1 概览 默认情况下,使用startproject的时候, ...
- Django admin 显示图片
我有一个表用来储存轮播图片,有一个 `picture` 字段储存的是图片的url,图片的 url 通过上传文件到 cdn 获得.目前这个表的编辑是通过自定义一个 `ModelForm`,然后重写 Dj ...
- [系统开发] Django Admin上传图片简单校验
我的 models里有个ImageField字段,用来保存用户头像,希望通过Django Admin上传时校验头像大小,如果太大就报错,并且不保存. 网上有不少方法,有的通过第三方软件实现,有的通过自 ...
- SQLAlchemy连接数据库并在django admin显示
SQLAlchemy 0.7 postgersql 9.0 SQLAlchemy连接数据库有两种方法,一种是classic,一种是modern 1,modern方法 from sqlalch ...
- Django admin site(一)ModelAdmin Options
Admin管理界面是django的杀手级应用.它读取你模式中的元数据,然后提供给你一个强大而且可以使用的界面,网站管理者可以用它立即向网站中添加内容. 要使用admin,可以按照下面的步骤: 将'dj ...
- Django Admin 简单部署上线
前言 打算为公司弄一个管理公用密码的平台,由于比较懒,就选择使用Django admin,默认的admin并不漂亮,于是我使用了这个django-suit插件来美化 如图: 是不是比原来的漂亮多了. ...
- Django admin究竟要怎么写才优雅
比如在Django admin 注册models时,会用到. 对于APP里自带的models,可以使用这种方式注册. from django.contrib import admin # Regist ...
随机推荐
- 查找所有含有表名(abc)的存储过程 执行脚本
SELECT obj.Name , sc.TEXT FROM syscomments sc INNER JOIN sysobjects obj ON sc.Id = obj.ID WHERE sc.T ...
- bzoj3668: [Noi2014]起床困难综合症
从高位到低位枚举期望的应该是ans最高位尽量取一.如果该数最高位为o的话能够取得1直接更新ans否则判断该位取1是否会爆m不会的话就加上. #include<cstdio> #includ ...
- BZOJ 4631 踩气球
BZOJ上内存小了会WA.... 线段树上挂链表. #include<iostream> #include<cstdio> #include<cstring> #i ...
- java线程join的意思(转自http://zjj1211.blog_51cto_com)
Join,单词本事就是连接的意思. 先贴出几段代码猜猜结果. <1> public static int Main() { Alpha oAlpha = new Alpha(); Thre ...
- 锋利的jQuery读书笔记---jQuery中Ajax--load方法
第一个Ajax例子 <!DOCTYPE html> <html> <head lang="en"> <meta charset=" ...
- 多数据源问题--Spring+Ibatis 访问多个数据源(非分布式事务)
有的时候,我在一个工程中需要访问两个以上的数据源,尤其是在系统集成的时候,以下是我在系统集成的时候遇到的情况,我的工程的架构是:spring2.0+ibatis2.0+struts1.2. 数据库是o ...
- Redis 对String数据类型的操作
Redis的 Strings 数据结构是简单的key-value类型,value其实不仅是String,也可以是数字.使用Strings类型,你可以完全实现目前 Memcached 的功能,并且效率更 ...
- Visual Studio 2005 移植 - WINVER,warning C4996, error LINK1104
Visual Studio 2005 移植 - WINVER,warning C4996, error LINK1104 一.WINVER Compile result: WINVER not d ...
- testng之listener
这周在给人培训selenium+testng框架时,讲到listener这块发现对listener并没有完全了解,于是自己又重新学习了下. 以下是 TestNG 提供的几种监听器: IAnnotati ...
- Asp.Net 自定义控件实现图片的上传,浏览,删除功能
4月的时候公司比较闲,就想着自己做点东西,其实主要是为了更加熟悉.Net,毕竟接触的时间不长,趁着有时间想提高提高.不过当我做到图片上传这个功能的时候,就有些停滞不前了,连续写了两天也达不到自己想要的 ...