1、创建python 虚拟环境
python3 -m venv oscar-env —创建虚拟环境
source oscar-env/bin/activate —激活环境
2、创建一个oscar文件目录
mkdir oscar;
3、生成一个商店站点
django-admin startproject ruihong;
4、完成django 配置
https://django-oscar.readthedocs.io/en/latest/internals/getting_started.html
4.1 settings.py 文件配置
"""
Django settings for ruihong project.
Generated by 'django-admin startproject' using Django 4.2.13.
For more information on this file, see
https://docs.djangoproject.com/en/4.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.2/ref/settings/
"""
from oscar.defaults import *
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "django-insecure-vq0@7$5@+(&4j=)ej3)&c47-(u8-w*63&vu%vcjuxybsli$n7t"
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = T

最低0.47元/天 解锁文章
1569

被折叠的 条评论
为什么被折叠?



