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 ...
随机推荐
- LA 4794 Sharing Chocolate
大白书中的题感觉一般都比较难,能理解书上代码就已经很不错了 按照经验,一般数据较小的题目,都有可能是用状态压缩来解决的 题意:问一个面积为x×y的巧克力,能否切若干刀,将其切成n块面积为A1,A2,, ...
- 标准IO库函数复习
打开文件,打开文件一定要成对写,养成好习惯很重要.比如 fopen()fclose<ol> <li>fopen()</li> <pre lang=" ...
- ACCESS中的窗体、报表、宏模块等(ACCESS 2000)
窗体: 分为数据操作窗体,它包括单页.多页.连续.子窗口 控制窗体 信息交互窗体 窗体三种视图:“设计”视图.“窗体”视图.“数据表”视图 窗体建立的五种方式: 一:自动创建窗体 二:窗体向导(一对多 ...
- linux 安装SVN
1.环境centos6.4 2.安装svnyum -y install subversion 3.配置 建立版本库目录mkdir /www/svndata svnserve -d -r /www/sv ...
- struts2 action 返回图片流
数据库为mssql zp字段为image类型 java代码 OutputStream out = null; try { String contenttype = "image/jpeg&q ...
- Cocoa Foundation框架学习笔记 - NSCalendar
+ (void)beginTest { /* FOUNDATION_EXPORT NSString * const NSGregorianCalendar; //公历(常用) FOUNDATION_E ...
- 平庸与卓越的差别 z
本文是清华大学陈吉宁校长于在 2015 年第一次研究生毕业典礼暨学位授予仪式上的讲话,原文标题:选择与坚持.演讲非常精彩,值得您细细阅读. 亲爱的同学们: 今天,共有 1318 名同学获得博士.硕士学 ...
- Redis 对String数据类型的操作
Redis的 Strings 数据结构是简单的key-value类型,value其实不仅是String,也可以是数字.使用Strings类型,你可以完全实现目前 Memcached 的功能,并且效率更 ...
- ASP.NET转换人民币大小金额
public class DecimalToRMB { /// <summary> /// 转换人民币大小金额 /// </sum ...
- VC远控(一)界面设计及套接字连接测试
首先创建一个MFC项目. 选择基于对话框: 勾选Windows套接字 依次拉上各种不同的控件: Edit Control.Button.Tree.Static Text.List.Progress C ...