myshop readme

shop

配置

ngrok

ngrok下載和基本使用
https://ngrok.com/ 下載ngrok

然后注冊(cè)一個(gè)賬號(hào) 獲取官方分配一個(gè)密鑰
Install your authtoken
  ./ngrok authtoken xxxx
Create your first secure tunnel
  ./ngrok http 80
Open the web interface at http://localhost:4040 to inspect and replay 
read doc  https://ngrok.com/docs 
for instructions on advanced features like adding HTTP authentication, setting custom subdomains and more.

使用cmd 到ngrok.exe的目錄 
    ngrok -authtoken 密鑰 -subdomain  二級(jí)域名 端口 
    ngrok -authtoken  xxxx -subdomain yyyy 8000  #這個(gè)二級(jí)域名也要付費(fèi)才有了

最簡(jiǎn)單的命令是 
ngrok http 8000

下面介紹全免費(fèi)的方案
使用默認(rèn)配置文件
default location of config file is $HOME/.ngrok2/ngrok.yml.
windows下面
C:\Users\Administrator.ngrok2\ngrok.yml

authtoken: 
tunnels:
  myshop-http:
    addr: 8000
    proto: http
    #subdomain: myshop-inspect  這個(gè)要付費(fèi)才有
    inspect: false
    
然后在console,運(yùn)行
ngrok start myshop-http

Rabbitmq server

celery4.x 不再支持windows
pip install celery==3.1.18

rabbitmq in windows

rabbitmq 支持的OS多過(guò)redis,在windows安裝了一個(gè) 可以用

cd /d D:\RabbitMQ Server\rabbitmq_server-3.6.9\sbin
windows下面配置rabbitmq
http://www.rabbitmq.com/configure.html#customise-windows-environment
run the following command after installation on rabbit mq path:

rabbitmq-plugins enable rabbitmq_management 
#下面的服務(wù)啟動(dòng)是會(huì)失敗的,如何配置為windows service看下面
rabbitmq-service.bat start 

下面的命令,可以在console看到消息
rabbitmq-server.bat start

如何要運(yùn)行為windows service
RABBITMQ_BASE是用來(lái)放db和log兩個(gè)目錄的,
默認(rèn)是在C:\Users\Administrator\AppData\Roaming\RabbitMQ
RABBITMQ_BASE=D:\RabbitMQ Server\rabbitmq_server-3.6.9
rabbitmq-service.bat uninstall
rabbitmq-service.bat install
rabbitmq-service.bat start

rabbitmq in linux

請(qǐng)參考
CentOS7上安裝RabbitMQ

paypal

Creating a PayPal account
You need to have a PayPal Business account to integrate the payment gateway into your site. If you don't own a PayPal account yet, sign up at https://www.paypal.com/signup/account.
Make sure that you choose a Business Account and sign up
to the PayPal Payments Standard solution, as shown in the following screenshot:

pip install django-paypal==0.3.6
http://django-paypal.readthedocs.io/en/stable/

http://developer.paypal.com
注冊(cè)sandbox賬號(hào)
包括business和person賬號(hào),這個(gè)是用來(lái)模擬買賣中的賬號(hào)來(lái)的。
person賬號(hào)初始化的balance是$9999.

WeasyPrint使用它的轉(zhuǎn)換功能(輸出pdf file)

目前為止PyGTK只支持py2.7,所以確保在python2.7的環(huán)境
否則就只能去掉WeasyPrint

發(fā)布運(yùn)行(以ngrok發(fā)布為例):

因?yàn)槟承゛pp要用到static下面的靜態(tài)文件,所以需要運(yùn)行下面的命令
python manage.py collectstatic
開(kāi)4個(gè)console

ngrok

ngrok start myshop-http

這時(shí)候會(huì)顯示外網(wǎng)url,以后就用這個(gè)url訪問(wèn)myshop購(gòu)物

django myshop

workon myshop
cd /d e:/django_projects/shop/myshop
python manage.py runserver 0.0.0.0:8000

rabbitmq server

cd /d D:\RabbitMQ Server\rabbitmq_server-3.6.9\sbin
rabbitmq-server start
或者啟動(dòng)service

celery

workon myshop
cd /d e:/django_projects/shop/myshop
(myshop) e:\django_projects\shop\myshop>
celery -A myshop worker -l info

因?yàn)閳?bào)錯(cuò):pickle被rejected,所以把下面的配置注釋掉了
CELERY_ACCEPT_CONTENT = ['application/json']

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容