Django电商平台Saleor搭建初体验

Django Alan 4年前 (2020-06-20) 9479次浏览 0个评论 扫描二维码

Saleor 是一个基于 Django 的前后端分离的电商网站框架,包含后端核心服务、前端又分别包含后台和前台,本文所使用操作系统为CentOS 7。官方文档目前首推的是使用 Docker启动服务,这样显然更为简单,本文还尝试分别在服务器上以源代码方式安装启动服务。就目前来看,可以考虑的部署方式是后端使用 Docker 打包镜像部署,只需对官方的 Dockerfile 进行部分修改即可,这样可避免依赖包安装之类的麻烦;PostgreSQL在服务器上进行安装,而前后台前端打包后可以直接在服务器上通过 Nginx 配置访问静态页面,也可打包为 Docker 在服务器上部署。

Django电商平台Saleor搭建初体验

基于 Python 和 Django 的电商解决方案网上总结如下:

  • Oscar — Domain-driven e-commerce for Django, open-source.
  • Saleor — An e-commerce storefront written in Python, open-source.
  • Django-SHOP — A Django based shop system.
  • Shuup — A single and multi-vendor application.

https://github.com/mirumee/saleor

https://github.com/mirumee/saleor-storefront

https://github.com/mirumee/saleor-dashboard

Docker 安装

 Git权限设置

非 Docker 安装启动

此时我们的 core 服务就运行起来了

前台

数据库安装

 

历史文档:https://docs.saleor.io/docs/2.8.0/getting-started/configuration

https://gitter.im/mirumee/saleor

AWS部署前端

S3配置

参考文章:medium.com

常见问题

1、ImportError: failed to find libmagic. Check your installation

2、could not open extension control file “/usr/pgsql-12/share/extension/hstore.control”

3、django.db.utils.ProgrammingError: permission denied to create extension “hstore”
HINT: Must be superuser to create this extension.

4、ENOSPC: System limit for number of file watchers reached centos

5、pg_dump: server version: 12.3; pg_dump version: 9.2.24
pg_dump: aborting because of server version mismatch

这是因为系统存在多个版本的 PostgreSQL,因此需指定 pg_dump,如:

5、no module named saleor

使用 uwsgi 启动时出现如下错误,这是因为没有项目根目下进行启动,可以在uwsgi.ini文件中指定项目根目录:chdir=/xxx/xxx

uwsgi 参数详解

6、Nginx 日志: Permission denied while connecting to upstream

这是因为开启了 selinux


Spree

调研时发现了一个基于 Ruby on Rails 的电商框架,国内似乎很少有人使用,但非常优秀,Mark 一下。

https://github.com/spree/spree

Your version of SQLite (3.7.17) is too old. Active Record supports SQLite >= 3.8. (RuntimeError)

ActionView::Template::Error The asset is not present in the asset pipeline.

 

喜欢 (5)
[]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址