小编Gab*_*sii的帖子

Django-无法打开数据库文件(sqlite3.OperationalError)

我正在使用django框架开发一个小型应用程序,当尝试通过Apache2服务时,出现以下错误:

(sqlite3.OperationalError)无法打开数据库文件(此错误的背景位于:http : //sqlalche.me/e/e3q8

settings.py输入的数据库如下所示:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3')
    }
}
Run Code Online (Sandbox Code Playgroud)

该数据库文件存在,并具有chmod赋予的以下权限:

root@myVPS:/var/www/lab# ls -l db.sqlite3
total 30236
-rwxrwxr-x 1 www-data www-data  3018568 Jul  1 22:14 db.sqlite3
Run Code Online (Sandbox Code Playgroud)

根文件夹/var/www/lab

drwxrwxr-x 8 www-data www-data 4096 Jul 2 01:15 lab
Run Code Online (Sandbox Code Playgroud)

我读到版权可能有问题,但我似乎找不到我做错了什么。

我的Apache2配置文件:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName sub.domain.com
        ServerAlias sub.domain.com
        DocumentRoot /var/www/lab
        <Directory /var/www/lab>
                Options FollowSymLinks
                AllowOverride All
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order …
Run Code Online (Sandbox Code Playgroud)

python sqlite django python-3.x

6
推荐指数
0
解决办法
303
查看次数

Gatsby - 无法读取未定义的属性“组件---src-pages-index-jsx”

我正在尝试将现有的带有 WordPress 后端的 ReactJS 应用程序迁移到 GatsbyJS。我是 GatsbyJS 的新手,按照他们页面上的说明在 Windows 10 计算机上进行设置。设置运行得很好,我可以开始迁移过程,但一段时间后,我在尝试加载页面时只收到以下错误:

\n\n
TypeError: Cannot read property 'component---src-pages-index-jsx' of undefined\n\nfetchResource\nD:/GitHub/gatsby-starter-wordpress/.cache/loader.js:77\n  74 | // Find resource\n  75 | let resourceFunction\n  76 | if (resourceName.slice(0, 12) === `component---`) {\n> 77 |   resourceFunction = asyncRequires.components[resourceName]\n  78 | } else if (resourceName.slice(0, 9) === `layout---`) {\n  79 |   resourceFunction = asyncRequires.layouts[resourceName]\n  80 | } else {\nView compiled\ngetResourceModule\nD:/GitHub/gatsby-starter-wordpress/.cache/loader.js:112\n  109 |     cb(failedResources[resourceName])\n  110 |   })\n  111 | } else {\n> 112 |   fetchResource(resourceName, (err, executeChunk) => {\n …
Run Code Online (Sandbox Code Playgroud)

javascript browser npm reactjs gatsby

4
推荐指数
1
解决办法
2451
查看次数

反应路由器加载两个组件

我正在编写一个简单的登录系统,如果我想让自己注册,两个组件都会加载到App组件中.

我的代码:

class App extends React.Component {
  render() {
      return (
         <div className="row">
            <Header/>
            <BrowserRouter history={browserHistory}>
              <div>
                <Route path="/" component={Login}/>
                <Route path="/register" component={Register} />
              </div>
            </BrowserRouter>
         </div>
      );
   }
}
Run Code Online (Sandbox Code Playgroud)

javascript reactjs

1
推荐指数
1
解决办法
329
查看次数

标签 统计

javascript ×2

reactjs ×2

browser ×1

django ×1

gatsby ×1

npm ×1

python ×1

python-3.x ×1

sqlite ×1