Dokusho Vernissage eCommerce is a Django-based web application that allows users to browse and purchase products online. The application is deployed on Vercel at https://dokusho-vernissage.vercel.app/. To further enhance the project, I am actively working on containerization using Docker, which will improve the application's scalability and portability, so stay tuned!
The project is composed of several Django applications, including:
- Account for user authentication and account management (passwords and addresses),
- Basket for basket functionality (adding items, updating quantities, calculating total prices),
- Catalogue for creating products, product types, product specifications, and categories,
- Checkout for payment integration with PayPal and delivery options,
- Orders for managing user orders and payment confirmation.
For the frontend, Bootstrap 5, jQuery, and AJAX were used. The application's database is hosted on Railway and created using PostgresSQL. Static and media files are stored in an AWS S3 Bucket. Tests were written using PyTest, FactoryBoy, and Faker.
- User authentication and account management, including email confirmation for account activation (you will recieve an activation email from dokushovernissage@gmail.com)
- Password reset functionality with or without logging in via email
- Product browsing via Categories
- Wish list for saving favorite products
- Basket and checkout functionality
- PayPal payment integration for secure and easy payment processing
- Multiple shipping addresses for users
- Toggle between dark and light mode for customizable user experience
- Clone the repository to your local machine or download and extract it into a folder:
git clone https://github.com/Veluthil/eCommerce-Store.git
- Open the project in your preferred code editor and create a virtual environment. Activate the virtual environment using the following commands:
py -m venv venv
venv\Scripts\activate
- Install the required packages using:
pip install -r requirements.txt
- Set up the environment variables by updating the
settings.py
file with the appropriate values for the following variables:
load_dotenv("INSERT HERE YOUR OWN PATH TO .ENV FILE")
SECRET_KEY
DATABASES
: If you want to use PostgresSQL database, update theUSER
,PASSWORD
,HOST
, andPORT
variables accordingly. Alternatively, you can use SQLite database by commenting out the PostgresSQL settings and uncommenting the SQLite settings.AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
EMAIL_HOST_USER
EMAIL_HOST_PASSWORD
PAYPAL_CLIENT_ID
PAYPAL_SECRET
- To use the application in development mode, comment out the following lines or change to
False
in thesettings.py
file:
SECURE_SSL_REDIRECT = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
And change DEBUG = False to:
DEBUG = True
- For local server usage, uncomment the following lines in the
settings.py
file:
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static")
]
MEDIA_URL = "/media/"
MEDIA_ROOT = os.path.join(BASE_DIR, "media/")
And comment out the AWS S3 Bucket settings.
- To set up email functionality, update the
settings.py
file as follows:
- For local server usage and sending email to your console, uncomment the following lines in settings.py:
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
EMAIL_HOST = 'localhost'
EMAIL_PORT = 25
And comment out the email settings for the SMTP section.
- Add following method to Customer class in ecommerce/apps/account/models.py:
def email_user(self, subject, message):
send_mail(
subject,
message,
"l@1.com",
[self.email],
fail_silently=False,
)
- In acccount_register view at ecommerce/apps/account/views.py comment out following code:
with get_connection(
host=settings.EMAIL_HOST,
port=settings.EMAIL_PORT,
username=settings.EMAIL_HOST_USER,
password=settings.EMAIL_HOST_PASSWORD,
use_tls=settings.EMAIL_USE_TLS
) as connection:
subject = subject
email_from = settings.EMAIL_HOST_USER
recipient = [user.email]
message = message
EmailMessage(subject, message, email_from, recipient, connection=connection).send()
And uncomment this:
user.email_user(subject=subject, message=message)
print(message)
- To use PayPal, you need to create your own developer account.
- Open your web browser and navigate to http://localhost:8000/.
- Create an account and/or log in. If you create an account, you will receive an activation link by email that you need to click to confirm and activate your account.
- Browse the available products and add items to your cart or wish list.
- Click the "Checkout Securely" button to enter your payment and shipping information.
- Review your order, choose a shipping method, select PayPal as your payment method, and submit your order for processing.
- Edit your account and address details as necessary (you can add multiple addresses and choose which one is the primary address).