我需要一点帮助,我一直在寻找没有结果的解决方案。
这是我的设置:settings.py:
STATIC_ROOT = ''
# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
STATICFILES_DIRS = (
PROJECT_ROOT + '/static/'
)
已安装的应用程序:
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin', . . .
使用 DEBUG = TRUE 运行:
August 01, 2013 - 16:59:44
Django version 1.5.1, using settings 'settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
[01/Aug/2013 16:59:50] "GET / HTTP/1.1" 200 6161
[01/Aug/2013 16:59:50] "GET /static/media/css/jquery-ui/ui-lightness/jquery-ui- 1.10.3.custom.min.css HTTP/1.1" 404 5904
[01/Aug/2013 16:59:50] "GET /static/media/css/bootstrap/bootstrap.css HTTP/1.1" 404 5904
[01/Aug/2013 16:59:50] "GET /static/media/css/bootstrap/bootstrap-responsive.min.css HTTP/1.1" 404 5904
[01/Aug/2013 16:59:50] "GET /static/media/css/styles.css HTTP/1.1" 404 5904
[01/Aug/2013 16:59:50] "GET /static/media/js/jquery/jquery-1.9.1.min.js HTTP/1.1" 404 5904
[01/Aug/2013 16:59:50] "GET /static/media/js/bootstrap/bootstrap.min.js HTTP/1.1" 404 5904
[01/Aug/2013 16:59:50] "GET /static/media/js/jquery-ui/jquery-ui-1.10.3.custom.min.js HTTP/1.1" 404 5904
[01/Aug/2013 16:59:50] "GET /static/media/js/messages.js HTTP/1.1" 404 5904
[01/Aug/2013 16:59:50] "GET /static/media/js/validate/jquery.validate.min.js HTTP/1.1" 404 5904
[01/Aug/2013 16:59:50] "GET /static/media/images/FERREMOLQUES2.png HTTP/1.1" 404 5904
[01/Aug/2013 16:59:50] "GET /static/media/js/dynamic-style.js HTTP/1.1" 404 5904
作为特别提及,我在VIRTUALENV中运行 Django 1.5.1 和 Python 2.7.5 。我不知道这个配置是否导致问题
任何帮助将不胜感激
谢谢。
编辑:当我关闭 VIRTUALENV 并安装正确版本的 Django 和项目的依赖项时,我的项目运行良好,没有任何问题。. . 静态显示为应有的