django - Django 没有应用新的修改
问题描述
我部署了我的 Django 应用程序,然后我编辑了源代码,但我的编辑没有应用。
例子:
class Type(models.Model):
seller = models.ForeignKey(Profile, related_name="cam_seller_profile", on_delete=models.CASCADE)
label = models.CharField(max_length=150, null=True, blank=True)
slug = models.SlugField(max_length=255, unique=True, blank=True)
def __str__(self):
return "test"
新的更新:
def __str__(self):
return self.seller.user.username
结果还是和老一样
我试过这个来重新加载 nginx 但没有用:
service nginx reload
sudo systemctl restart nginx
sudo systemctl daemon-reload
解决方案
通过重新加载主管解决的问题
supervisorctl restart myproject
来源:https ://rahmonov.me/posts/run-a-django-app-with-nginx-gunicorn-and-supervisor/
推荐阅读
- azure-cosmosdb - ReadItemAsync 与 GetItemLinqQueryable?
- r - 如何在 r studio 中逐步整理这些数据集?
- python - selenium-python 代码管理(git) + jenkins 集成。现在如何在 jenkins 上运行 git 上的测试项目?
- powershell - 将变量导出到两列
- ruby-on-rails - 升级到 elasticsearch 7 时重新索引错误
- c# - Primitive Obsession - 具有自动增量的强类型 int ID
- c# - 在 WPF 中构建复杂的财务计算时如何管理文本框更改
- reactjs - 使用自定义 onDrop 行为扩展 ImageInput
- html - 具有不透明背景的重叠 div
- javascript - 在传单中设置图层的缩放级别