Code Monkey home page Code Monkey logo

auction-website's Introduction

Auction Website

This is an eBay-like auction website built using Django with Bootstrap 5 and Chart.js that uses a PostgreSQL database to store data.

plot

plot

Prerequisites

Install the following prerequisites:

  1. Python 3.9.12 or higher
  2. PostgreSQL
  3. Visual Studio Code

Installation

1. Create a virtual environment

From the root directory run:

python -m venv venv

2. Activate the virtual environment

From the root directory run:

On macOS:

source venv/bin/activate

On Windows:

venv\scripts\activate

3. Install required dependencies

From the root directory run:

pip install -r requirements.txt

4. Set up a PostgreSQL database

With PostgreSQL up and running, in a new Terminal window run:

dropdb --if-exists auctions

Start psql, which is a terminal-based front-end to PostgreSQL, by running the command:

psql postgres

Create a new PostgreSQL database:

CREATE DATABASE auctions;

Create a new database admin user:

CREATE USER yourusername WITH SUPERUSER PASSWORD 'yourpassword';

To quit psql, run:

\q

5. Set up environment variables

From the root directory run:

touch .env

The touch command will create the .env file in the root directory. This command works on Mac and Linux but not on Windows. If you are a Windows user, instead of using the command line, you can create the .env file manually by navigating in Visual Studio Code to the Explorer, and selecting the option New File.

Next, declare environment variables in the .env file. Make sure you don't use quotation marks around the strings.

SECRET_KEY=yoursecretkey
DEBUG=True
DATABASE_NAME=auctions
DATABASE_USER=yourusername
DATABASE_PASS=yourpassword
DATABASE_HOST=localhost

6. Run migrations

From the root directory run:

python manage.py makemigrations
python manage.py migrate

7. Create an admin user to access the Django Admin interface

From the root directory run:

python manage.py createsuperuser

When prompted, enter a username, email, and password.

Run the application

From the root directory run:

python manage.py runserver

View the application

Go to http://127.0.0.1:8000/ to view the application.

Add data to the application

Add data through Django Admin.

Go to http://127.0.0.1:8000/admin to access the Django Admin interface and sign in using the admin credentials.

auction-website's People

Contributors

bobsprogrammingacademy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.