Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/364.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在龙卷风上运行Django-can';不加载管理样式_Python_Django_Tornado_Pythonbrew - Fatal编程技术网

Python 在龙卷风上运行Django-can';不加载管理样式

Python 在龙卷风上运行Django-can';不加载管理样式,python,django,tornado,pythonbrew,Python,Django,Tornado,Pythonbrew,我正在tornado服务器上运行django应用程序 通过使用此脚本: #!/usr/bin/env python # # Runs a Tornado web server with a django project # Make sure to edit the DJANGO_SETTINGS_MODULE to point to your settings.py # # http://localhost:8080/hello-tornado # http://localhost:8080

我正在tornado服务器上运行django应用程序

通过使用此脚本:

#!/usr/bin/env python
#
# Runs a Tornado web server with a django project
# Make sure to edit the DJANGO_SETTINGS_MODULE to point to your settings.py
#
# http://localhost:8080/hello-tornado
# http://localhost:8080

import sys
import os

from tornado.options import options, define, parse_command_line
import tornado.httpserver
import tornado.ioloop
import tornado.web
import tornado.wsgi

from django.core.wsgi import get_wsgi_application


define('port', type=int, default=8080)


class HelloHandler(tornado.web.RequestHandler):
def get(self):
    self.write('Hello from tornado')


def main():
os.environ['DJANGO_SETTINGS_MODULE'] = 'siatpre.settings' # TODO: edit this
sys.path.append('./siatpre8') # path to your project if needed

parse_command_line()

wsgi_app = get_wsgi_application()
container = tornado.wsgi.WSGIContainer(wsgi_app)

tornado_app = tornado.web.Application(
    [
        ('/hello-tornado', HelloHandler),
        ('.*', tornado.web.FallbackHandler, dict(fallback=container)),
    ])

server = tornado.httpserver.HTTPServer(tornado_app)
server.listen(options.port)

tornado.ioloop.IOLoop.instance().start()

if __name__ == '__main__':
    main()
项目路径(siatpre8)是正确的,一切运行正常,唯一的问题是管理风格的静态文件,以及上传到应用程序的文件

但是,即使在我将
STATIC\u ROOT、STATICFILES\u DIRS
放在我的settings.py上,我也无法加载管理样式

这是一个开发环境,有什么想法吗

如果你需要更多的细节,请告诉我

提前谢谢

编辑

我的目录布局:

├── ejemplosDeDatos
├── imagenes-aplicacion
├── node_modules
├── __pycache__
└── siatpre
├── apps
│   ├── __pycache__
│   └── scppp
│       ├── lector
│       │   └── __pycache__
│       ├── Prueba_presion
│       │   └── __pycache__
│       ├── __pycache__
│       └── Utilitarios
│           └── __pycache__
├── media
│   ├── archivosDeCarga
│   ├── css
│   ├── img
│   ├── js
│   │   └── jquery
│   │       ├── css
│   │       │   └── themes
│   │       │       └── base
│   │       │           └── images
│   │       └── js
│   ├── scppp
│   │   ├── imagenes-aplicacion
│   │   └── original
│   │       ├── css
│   │       ├── img
│   │       └── js
│   └── siatpre
│       └── scpp
├── __pycache__
├── static
│   ├── admin
│   │   ├── css
│   │   ├── img
│   │   │   └── gis
│   │   └── js
│   │       └── admin
│   ├── media
│   │   ├── archivosDeCarga
│   │   ├── css
│   │   ├── img
│   │   ├── js
│   │   ├── scppp
│   │   │   ├── imagenes-aplicacion
│   │   │   └── original
│   │   │       ├── css
│   │   │       ├── img
│   │   │       └── js
│   │   └── siatpre
│   │       └── scpp
│   └── templates
│       └── scppp
│           ├── imagenes-aplicacion
│           └── original
│               ├── css
│               ├── img
│               └── js
└── templates
    └── scppp
        ├── imagenes-aplicacion
        └── original
            ├── css
            ├── img
            └── js
My
settings.py
静态文件结构声明:

STATIC_URL = '/static/'

#ADMIN_MEDIA_PREFIX = '/static/'

STATICFILES_DIRS = [
"home/kkoci/siatpre3.3.1/siatpre2015/siatpre8/siatpre/static/admin/",
"home/kkoci/siatpre3.3.1/siatpre2015/siatpre8/siatpre/media/archivosDeCarga/",
#"/home/polls.com/polls/static",
#"/opt/webfiles/common",
]
STATIC_ROOT = '/static/admin/'

#ADMIN_MEDIA_PREFIX = '/static/admin/css/'

STATICFILES_FINDERS = ( 
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)

TEMPLATE_DIRS = (
os.path.join(os.path.dirname(__file__),'templates'),
)

MEDIA_ROOT =   os.path.normpath(os.path.join(os.path.dirname(__file__),'media/'))

MEDIA_URL = '/media/'

您的目录布局是什么样的?您将
静态根目录
静态文件目录
设置为什么?嗨,本,我已经更新了我的问题,很抱歉耽搁了这么久,请查查,谢谢!顺便说一句,龙卷风脚本在这些目录之外,只有一个文件夹