美文网首页
django问题

django问题

作者: pokerstarxy | 来源:发表于2017-03-20 15:38 被阅读0次

    1、访问

         python manage.py runserver 0.0.0.0:8000是django server监听public ip以便从外面访问


    2、django和apache

      Django 框架还包含了一个开发服务器,用它调试和测试 Django应用程序非常方便。不幸的是,这个服务器只能在本地环境中运行,不能承受由许多用户同时使用的生产 Web 应用程序产生的负载。因此,您需要将Django 应用程序部署到生产级 Web 服务器,比如 Apache

      搭建问题  :                                                                                                                                                    版本:  centos6 apache 2.2.15 django 1.10 python2.7 mod_wsgi 3.4                                                                 安装 django apache ,编译安装mod_wsgi(mod_wsgi>python_mod)     

    安装

       apache2.2 和apache2.4 区别     权限表示不同 


    2.4 2.2

    这里安装完之后记得在http.conf 中load wsgi module 

    表示错误会出现错误  “”Couldn't perform authentication: AuthType not set  “”

    AppRegistryNotReady处理 目录结构 wsgi配置 python cache意思
    http.conf主要配置

    这里dcoumentroot 只是相对路径,可以依据此路径简化操作 ,namevirtualhost是因为 virtualhost和listen冲突而设置的(只是其中一个解决方案),也可以直接改变vh的* 至域名,那么就可以直接跳到这个网站的配置里面 ,下面的servername也可以删除。再有错误问题,需要看日志。--(目录权限 chmod 755)

    静态页面   -----admin后台无样式

    setting.py修改static_root 为配置路径     然后运行python manage.py collectstatic  使得复制css文件到该static目录里面  然后修改  httpd.conf文件  使得 指定 static文件位置,并配置相应访问权限


    相关文章

      网友评论

          本文标题:django问题

          本文链接:https://www.haomeiwen.com/subject/ixezettx.html