teslabb
An e-commerce site written with Django, with categories, campaigns, memberships and bank payment modules.
teslabb is the source code of an e-commerce site I wrote with Django in 2015. It was built for a store selling shoes, clothing and accessories. The product catalogue, memberships and the shopping cart, order tracking, campaigns, bank and instalment settings, and site settings are organised as separate Django apps. A significant part of my e-commerce experience comes from this project.
Purpose
Off-the-shelf e-commerce software often did not quite fit the day-to-day needs of stores in Turkey. Instalment tables, virtual POS details that differ from bank to bank, campaigns such as "a discount on the second item" and notifying customers about their order status by SMS were the main examples. I wrote teslabb to manage all of these from a single admin panel. I wanted store staff to be able to do their daily work, from adding products to starting a campaign, from the panel without knowing any code.
How it works
The catalogue lives in the kategoriler app. Products are linked to a brand, a gender and a three-level category structure (top, middle and sub category). Under each product there are variants carrying colour, size, barcode, stock count and extra price. Whether a variant is defective and whether it has a 3D photo are flagged in separate fields. Similar categories and similar products can be linked by hand.
The uyeler app holds members, Facebook profiles, VIP customers, the cart, orders and order statuses. Whether an SMS was sent to the customer when the order was prepared, packed or handed to the courier is flagged separately on the order. Credit card payments, gift coupons and payments for price differences arising from exchanges are archived in separate tables. Members sign in with their email address instead of a username.
In the bankalar app, each bank's virtual POS details and 3D Secure settings are defined, and the Taksitler table holds the number of instalments, extra instalments and the interest rate.
Campaigns
- A points campaign that rewards purchases with points
- A discount for new members
- Buy one, get one free in selected categories and brands
- A percentage or fixed discount on the second item
- A tiered discount on the order total based on the cart amount
Every campaign has a start and end time. You can also choose whether a campaign is open only to members.
Admin panel and middleware
The admin panel was customised with Grappelli. The product list has bulk actions that move the selected products to the showcase, deals, outlet or product of the week with a single click. Filters that separate products with stock, without photos, without a brand or on discount, exporting to Excel and generating XML for Google Merchant are also handled from the panel. In the siteayarlari app, the blog, banners, content and meta information for a specific address, subdomain redirects and on-site search logs are managed.
As Django middleware, I wrote mobile device detection, reading the keyword a visitor searched for when arriving from a search engine, redirects based on the subdomain and removing unnecessary whitespace from the HTML output.
Technical background
The project was written with Python 2 and the Django version of that time. The repository contains the models, admin definitions, middleware and helper modules; the settings file and page templates were not added to the repository.
- Category
- Websites
- Year
- 2015
Technologies
- Python
- Django
- E-commerce
Links
- GitHub https://github.com/muslu/teslabb