我正在尝试为我的django项目建立一个PostgreSQL数据库,我相信我现在已经完成了,这要归功于我为django项目设置postgreSQL数据库时遇到的问题.我现在正试图在终端中运行命令'python manage.py runserver'来获取我的本地主机但是当我运行命令时,我看到这个响应...
Error: No module named psycopg2.extensions
Run Code Online (Sandbox Code Playgroud)
我不确定这意味着什么 - 我试图下载psycopg2但似乎找不到使用自制软件下载psycopg2的方法.我已经尝试过easy_install,pip install和sudo但是所有的返回错误都是这样的......
Downloading http://www.psycopg.org/psycopg/tarballs/PSYCOPG-2-4/psycopg2-2.4.5.tar.gz
Processing psycopg2-2.4.5.tar.gz
Writing /tmp/easy_install-l7Qi62/psycopg2-2.4.5/setup.cfg
Running psycopg2-2.4.5/setup.py -q bdist_egg --dist-dir /tmp/easy_install-l7Qi62/psycopg2-2.4.5/egg-dist-tmp-PBP5Ds
no previously-included directories found matching 'doc/src/_build'
unable to execute gcc-4.0: No such file or directory
error: Setup script exited with error: command 'gcc-4.0' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)
如何解决这个问题?
继我的上一个问题之后错误:没有名为psycopg2.extensions的模块,我已将我的mac OS更新为Mountain Lion并安装了Xcode.我还使用'sudo port install py27-psycopg2'安装了psycopg2.我现在正在尝试运行'python manage.py runserver'但是收到此错误
AttributeError: 'Settings' object has no attribute 'ROOT_URLCONF'
Run Code Online (Sandbox Code Playgroud)
有关如何解决此问题并使我的localhost运行的任何帮助?
我在模板中引用静态文件时遇到了困难.我正在使用Twitter Bootstrap并将引导程序文件(css,img,js)放在mysite/static中.
我已经设置了STATIC_URL,STATIC_ROOT并TEMPLATE_CONTEXT_PROCESSORS根据本教程.我已经运行./manage.py collectstatic了复制了72个文件.我还将以下模板标记添加到我的template(index.html)文件中,但这没有用.
{% load staticfiles %}
<link rel="stylesheet" href="{% static user_stylesheet %}" type="text/css" media="screen"/>
Run Code Online (Sandbox Code Playgroud)
任何有关如何引用文件的帮助,以便引导程序样式返回到模板将非常感谢!