Skip to content

DenisDanchyk/ecommerce_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Setup

1. Install Python3 interpreter

Additional information on https://www.python.org/downloads/

2. Clone this repository into your directory

mkdir ecommerce_project && cd ecommerce_project
git clone https://github.com/DenisDanchyk/ecommerce_project.git
cd ecommerce_project

3. Create virtual environment

python -m venv venv
venv\scripts\activate.bat

4. Install requirements

pip install -r requirements.txt
cd core

5. Set you Google account credentials for authentication system

In core/settings.py add your Google account credentials to EMAIL_HOST_USER and EMAIL_HOST_PASSWORD. If you don't have Google account - create it. Alternitavely, you can use other SMTP host. Instructions, how to set Django SMTP described here.

# TODO: 
SECRET_KEY = '1234567890'
DEBUG = True


EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_USE_TLS = True
EMAIL_PORT = 587
# TODO:
EMAIL_HOST_USER = ""
# TODO:
EMAIL_HOST_PASSWORD = ""

7. Create PosgresSQL database

Go to psql shell
postgres=# CREATE DATABASE demo;

And set in `core/settings.py` 

DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.postgresql',
    'HOST': 'localhost',
    'PORT': '5432',
    # TODO:
    'NAME': "",
    'USER': "",
    'PASSWORD': ""
}

}

8. Fill cities model

manage.py cities_light

9. Make migrations and run server

python manage.py makemigrations 
python manage.py migrate 
python manage.py runserver