SellYo'Shit is an application for selling your things online, written in Python 3.7 using the Django framework.
This group project is developed for the NTNU course TDT4140 Software Engineering during the spring of 2020.
- Establish your own account
- Create and publish your own ads
- Browse and search for ads of your interest
- Contact and communicate with sellers
- Rate other sellers in the application
Additionally, the Inspection checklist is used to control specific standards related to this product before merge.
Download and install the latest version of Python (version 3.7 or newer).
Download and install the latest version of Git.
The source code of the application is hosted at GitLab. Download the project repository and enter it by running the following commands in your preferred shell (CMD/PowerShell in Windows, Bash in Mac/Linux):
git clone https://gitlab.stud.idi.ntnu.no/tdt4140-2020/52.git
cd 52
Input your GitLab username and password if prompted. The pip and venv modules should be included in the default Python installation. Create a virtual environment and activate it:
Windows
python -m venv myvenv
myvenv\Scripts\activate
Linux/Mac
python3 -m venv myvenv
source myvenv/bin/activate
Ensure that you're using the latest version of PIP, install Django and other project dependencies and navigate into the source folder:
python -m pip install --upgrade pip
pip install -r requirements.txt
cd src
You can either connect to the preconfigured database created on the NTNU server or connect to your own database.
Connecting to the preconfigured database
To use this configuration you must have access to a NTNU user account.
- Authenticate use of NTNU servers by connecting through NTNU's VPN.
- Input vpn.ntnu.no in the Cisco AnyConnect text field, click Connect.
- Input your NTNU user credentials, and click OK and Accept.
Connection to your own database
Your database must use MySQL or SQLite in order to work with this product.
- Navigate to and open
default.pylocated insrc/pu/settings - Modify the dictionary
DATABASES = {}according to your own database settings. More specific instructions can be found here. - Run the following command in your virtual environment to configure your database with the product:
python manage.py migrate
Generate a Django "superuser" with all administrator permissions:
python manage.py createsuperuser
Input desired admin username and password when prompted, and confirm the password. This superuser is also initiated as an administrator account for the application website.
Next, run the Django server:
python manage.py runserver
Finally, open your preferred browser and go to the locally hosted web page by entering the following URL in the address bar:
http://127.0.0.1:8000/
If you're still running the server, press CTRL-BREAK inside the shell to quit.
Run the Django test suite to validate the implementation of each module:
python manage.py test <directory>
Replace <directory> with the module name (ads, contact, login, search, sellyoshit, stats, or users). If you want to test all modules, simply leave <directory> empty.
Type yes if you're being asked whether you would like to delete the old test database.
Be aware that running the tests without being connected to a database will cause errors. If you are using the preconfigured database you must also be connected to NTNU's VPN in order to run the tests.
Add an image with the file name default.png into the folder src/media/ads. This image will be shown for each advertisement if no picture is added by the seller.
Run the following commands in order to activate the interactive Python Console and create advertisement categories for the application:
python manage.py shell
from ads.models import Category
Category.objects.create(name=<category name>)
Replace <category name> with your desired category name. Run the last line for each category to be added. Type exit() to exit the Python Console.
You can also add categories by using the Django administrator panel with this URL:
http://127.0.0.1:8000/admin/ads/category
The following students have contributed to this project:
- Alf Berger Husem (alfbhu@stud.ntnu.no)
- Giske Naper Freberg (giskenf@stud.ntnu.no)
- Mathias Pettersen (mathipe@stud.ntnu.no)
- Mathias Sørensen (mathiaws@stud.ntnu.no)
- Simon Blindheim (simon.blindheim@ntnu.no)
- Sivert Hognes (siverhog@stud.ntnu.no)
- Thor-Herman van Eggelen (theggele@stud.ntnu.no)
This project uses the MIT license.