This project was completed by my friend and I and it was put into use in October 2019.
Link: https://usgolife.com

Requirements Analysis

1.1 User Module

1) Registration page

  • Check whether the user name has been registered during registration.
  • Complete the registration of user information
  • Send an email to the user’s registered mailbox, and the user clicks the activation link in the email to complete the activation of the user account.

2) Landing page

  • Realize user login function

3) User Center

  • The user center information page, which displays the information of the logged-in user, including the user name, phone number, and address, and the product information that the user has recently viewed at the bottom of the page.
  • User Center Address Page: displays the default receiving address of the logged-in user, and the user’s receiving address can be added in the form at the bottom of the page.
  • User Center Order Page: Display the order information of the logged-in user.

4) Other

  • If the user has logged in, the top of the page displays the user’s order information.

1.2 Commodity module

1) Home

  • Dynamically specify homepage carousel product information.
  • Dynamically specify home page activity information.
  • Dynamically obtain and display product category information.
  • Dynamically specify each category of products displayed on the homepage (including text products of image products).
  • When you click on a product, it jumps to the product details page.

2) Product details page

  • Display the detailed information of a product.
  • The two new product information of the product is displayed at the bottom of the page.

3) Product list page

  • Display the list data of a certain category of goods, display by page and support sorting by default, price and popularity.
  • The two new product information of the product is displayed at the bottom of the page.

4) Other

  • Search product information through the search box.

1.3 Shopping Cart Module

  • List page and detail page to add products to the shopping cart.
  • After the user logs in, the home page, details page, and list page display the number of items in the user’s shopping cart.
  • Shopping cart page: operate on the products in the user’s shopping cart. If you select an item, increase or decrease the number of items in the shopping cart.
  • Submit order page: Display the product information that the user is about to purchase.
  • Click Submit Order to complete the creation of the order.
  • The user center order page displays the user’s order information.
  • Click Pay to complete the payment of the order.

II Development environment and tools

ubuntu18.4 | python>3.6 | Django == 2.2 | pychram | redis
mysql 5.7 | celery | fastDFS | nginx | Django-haystack
whoosh | jieba | alipay | requests

III Configure the project environment

1.Configure mysql database environment

1
2
3
4
5
6
7
8
9
10
DATABASES = {
'default':{
'ENGING': 'django.db.backend.mysql',
'NAME': 'sslsl',
'USER': 'root',
'PASSWORD': '123456',
'HOST': 'xxx.xxx.xxx.xxx',
'POST': 3306,
}
}

2.Configure cache path–redis database environment

Cache stored in redis database

1
2
3
4
5
6
7
8
9
CACHES = {
'default':{
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': 'redis://xxx.xxx.xxx.xxx:6379/9',
'OPTIONS': {
'CLIENT_CLASS': 'django_redis.client.DefaultClient",
}
}
}

3.Configure session storage mode

Save to cache

1
2
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
SESSION_CACHE_ALIAS = 'default'

4.Configure Send mail

1
2
3
4
5
6
EMAIL_BACKEND = 'django.core.mail.backends.smto.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 25
EMAIL_HOST_USER = 'emample@gmail.com'
EMAIL_HOST_PASSWORD = 'xxxxxx'
EMAIL_FORM = 'USGOLIFE<emample@gmail.com>'

5.Configure fastDFS and nginx

1
2
3
DEFAULT_FILE_STORAGE - 'utils.fdfs.storage.FDFSStorage'
FDFS_CLIENT_CONF = '/fdfs/client.conf'
FDFS_URL = 'http://example.com:8888/'

6.Configure Celery

1
app = Celery('celery_tasks.tasks',broker = 'redis://example.com:6379/8')

For more information, click here.