小编C-B*_*izz的帖子

如何使用Material UI默认组件

我一直在使用bootstrap,我发现material ui也是一个很好的框架,并决定也开始学习如何使用它。在进入 MUI 组件时我陷入了困境。我想知道如何在不自定义的情况下使用默认的 MUI 组件。例如,我想复制card component并将其输出到浏览器上。

例如,其中一份文档的代码是:

import * as React from 'react';
import Card from '@mui/material/Card';
import CardContent from '@mui/material/CardContent';
import CardMedia from '@mui/material/CardMedia';
import Typography from '@mui/material/Typography';
import { Button, CardActionArea, CardActions } from '@mui/material';

export default function MultiActionAreaCard() {
  return (
    <Card sx={{ maxWidth: 345 }}>
      <CardActionArea>
        <CardMedia
          component="img"
          height="140"
          image="/static/images/cards/contemplative-reptile.jpg"
          alt="green iguana"
        />
        <CardContent>
          <Typography gutterBottom variant="h5" component="div">
            Lizard
          </Typography>
          <Typography variant="body2" color="text.secondary">
            Lizards are a widespread group of squamate reptiles, with over …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs material-ui

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

无法将 Django 应用程序与 Gunicorn 绑定

由于我来自 Windows 背景,因此尝试部署到 aws EC2 ubuntu 服务器对我来说非常困难。我在尝试将 django 应用程序绑定到 Gunicorn 时遇到错误。我正在运行的命令是sudo gunicorn --bind 0.0.0.0:8000 logistics.wsgi:application错误日志如下所示:

(venv) ubuntu@ip-172-31-18-196:/var/www/html$ sudo gunicorn --bind 0.0.0.0:8000 logistics.wsgi:application
[2021-09-08 11:21:00 +0000] [29379] [INFO] Starting gunicorn 20.1.0
[2021-09-08 11:21:00 +0000] [29379] [INFO] Listening at: http://0.0.0.0:8000 (29379)
[2021-09-08 11:21:00 +0000] [29379] [INFO] Using worker: sync
[2021-09-08 11:21:00 +0000] [29382] [INFO] Booting worker with pid: 29382
[2021-09-08 11:21:00 +0000] [29382] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/gunicorn/arbiter.py", line 589, in spawn_worker
    worker.init_process() …
Run Code Online (Sandbox Code Playgroud)

django ubuntu amazon-ec2 python-3.x gunicorn

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