Follow the instructions here to set up SSL.
- Create a virtual environment:
virtualenv -p <python-path> .env
- Activate the virtual environment:
source path-to-env-activate
- Install dependencies:
pip install -r requirements.txt
- Generate migrations:
python manage.py makemigrations
- Apply migrations:
python manage.py migrate
Execute tests using: python manage.py test
Populate country data: python manage.py oscar_populate_countries
Create a superuser account: python manage.py createsuperuser
Replace <paste-api-key-here>
with your actual Stripe API key.
docker run --rm -it stripe/stripe-cli listen --load-from-webhooks-api --forward-to 192.168.1.4:8000 --api-key <paste-api-key-here>
docker run --rm -it stripe/stripe-cli logs tail --api-key <paste-api-key-here>
docker run --rm -it stripe/stripe-cli trigger charge.succeeded --api-key <paste-api-key-here>
Set the following environment variables:
export PYTHONUNBUFFERED=1
export DJANGO_SETTINGS_MODULE=e_store_primzel.settings
export POSTGRES_HOST=localhost
export PRIMZEL_DEBUG=True
Add the following parameters in /web-backend/e_store_primzel/settings/env/local.py
:
THUMBNAIL_DEBUG = True
THUMBNAIL_PRESERVE_FORMAT = True
- Schema: eggs
- Command:
./manage.py create_tenant
- Download and install AWS CLI:
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" unzip awscli-bundle.zip sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
- Create S3 Bucket
aws --endpoint-url=http://localhost:4566 s3 mb s3://demo-bucket
Command: ./manage.py tenant_command import_from_woocommerce --schema=eggs "http://www.website.com" "ck_*****" "cs_*****"
- Add
store.oscar.com
to/etc/hosts
. - Create a systemd service file:
/etc/systemd/system/primzel-backend.service
. - Populate the file with the following configuration, replacing sensitive data with your actual credentials.
[Unit] Description=Primzel backend. [Service] # Environment variables with masked sensitive data Environment="POSTGRES_PASSWORD=********" Environment="AWS_ACCESS_KEY_ID=********" Environment="AWS_SECRET_ACCESS_KEY=********" # Additional configurations... WorkingDirectory=/home/ec2-user/codebase/web-backend ExecStart=/home/ec2-user/codebase/web-backend/.env/bin/gunicorn --workers 8 --bind 0.0.0.0:8080 e_store_primzel.wsgi:application --chdir /home/ec2-user/codebase/web-backend
- Create an Nginx configuration file:
/etc/nginx/conf.d/demo.primzel.com.conf
. - Add the following server block configuration:
server { server_name demo.primzel.com; listen 443; ssl on; ssl_certificate /etc/ssl/demo.primzel.com/certificate.crt; ssl_certificate_key /etc/ssl/demo.primzel.com/private.key; # Additional Nginx configurations... }