commit 9cc4e8f24007815c91a8a4e38eaf924ff53051a7 Author: Priyatham-sai-chand Date: Thu Oct 15 22:48:39 2020 +0530 intial push diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3c89cbc --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "python.pythonPath": "C:\\Users\\bncha\\AppData\\Local\\Programs\\Python\\Python38-32\\python.exe", + "python.dataScience.jupyterServerURI": "local" +} \ No newline at end of file diff --git a/auctions/__init__.py b/auctions/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/auctions/__pycache__/__init__.cpython-37.pyc b/auctions/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000..7342046 Binary files /dev/null and b/auctions/__pycache__/__init__.cpython-37.pyc differ diff --git a/auctions/__pycache__/admin.cpython-37.pyc b/auctions/__pycache__/admin.cpython-37.pyc new file mode 100644 index 0000000..b0e0c7a Binary files /dev/null and b/auctions/__pycache__/admin.cpython-37.pyc differ diff --git a/auctions/__pycache__/models.cpython-37.pyc b/auctions/__pycache__/models.cpython-37.pyc new file mode 100644 index 0000000..27837bf Binary files /dev/null and b/auctions/__pycache__/models.cpython-37.pyc differ diff --git a/auctions/__pycache__/urls.cpython-37.pyc b/auctions/__pycache__/urls.cpython-37.pyc new file mode 100644 index 0000000..d84967f Binary files /dev/null and b/auctions/__pycache__/urls.cpython-37.pyc differ diff --git a/auctions/__pycache__/views.cpython-37.pyc b/auctions/__pycache__/views.cpython-37.pyc new file mode 100644 index 0000000..a54f4b3 Binary files /dev/null and b/auctions/__pycache__/views.cpython-37.pyc differ diff --git a/auctions/admin.py b/auctions/admin.py new file mode 100644 index 0000000..9c3b6e4 --- /dev/null +++ b/auctions/admin.py @@ -0,0 +1,9 @@ +from django.contrib import admin +from .models import User +from .models import AuctionListing +from .models import Comments + +# Register your models here. +admin.site.register(User) +admin.site.register(AuctionListing) +admin.site.register(Comments) \ No newline at end of file diff --git a/auctions/apps.py b/auctions/apps.py new file mode 100644 index 0000000..8ed8571 --- /dev/null +++ b/auctions/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class AuctionsConfig(AppConfig): + name = 'auctions' diff --git a/auctions/migrations/0001_initial.py b/auctions/migrations/0001_initial.py new file mode 100644 index 0000000..21a43b6 --- /dev/null +++ b/auctions/migrations/0001_initial.py @@ -0,0 +1,64 @@ +# Generated by Django 3.0.8 on 2020-10-11 16:42 + +from django.conf import settings +import django.contrib.auth.models +import django.contrib.auth.validators +from django.db import migrations, models +import django.db.models.deletion +import django.utils.timezone + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('auth', '0011_update_proxy_permissions'), + ] + + operations = [ + migrations.CreateModel( + name='User', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('password', models.CharField(max_length=128, verbose_name='password')), + ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')), + ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')), + ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')), + ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')), + ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')), + ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')), + ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')), + ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')), + ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')), + ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')), + ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')), + ], + options={ + 'verbose_name': 'user', + 'verbose_name_plural': 'users', + 'abstract': False, + }, + managers=[ + ('objects', django.contrib.auth.models.UserManager()), + ], + ), + migrations.CreateModel( + name='AuctionListing', + fields=[ + ('title', models.CharField(max_length=64, primary_key=True, serialize=False)), + ('price', models.DecimalField(decimal_places=2, max_digits=10)), + ('desc', models.CharField(max_length=1000)), + ('picture', models.URLField(null=True)), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='Comments', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('comment', models.CharField(max_length=1000)), + ('title', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='auction_title', to='auctions.AuctionListing')), + ], + ), + ] diff --git a/auctions/migrations/0002_auto_20201011_2323.py b/auctions/migrations/0002_auto_20201011_2323.py new file mode 100644 index 0000000..20fee1c --- /dev/null +++ b/auctions/migrations/0002_auto_20201011_2323.py @@ -0,0 +1,20 @@ +# Generated by Django 3.0.8 on 2020-10-11 17:53 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('auctions', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='auctionlisting', + name='user', + field=models.ForeignKey(default=' ', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + ), + ] diff --git a/auctions/migrations/0003_auto_20201012_0007.py b/auctions/migrations/0003_auto_20201012_0007.py new file mode 100644 index 0000000..4131ec2 --- /dev/null +++ b/auctions/migrations/0003_auto_20201012_0007.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.8 on 2020-10-11 18:37 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('auctions', '0002_auto_20201011_2323'), + ] + + operations = [ + migrations.AlterField( + model_name='auctionlisting', + name='picture', + field=models.ImageField(null=True, upload_to=''), + ), + ] diff --git a/auctions/migrations/0004_auto_20201013_0925.py b/auctions/migrations/0004_auto_20201013_0925.py new file mode 100644 index 0000000..8d060dd --- /dev/null +++ b/auctions/migrations/0004_auto_20201013_0925.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.8 on 2020-10-13 03:55 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('auctions', '0003_auto_20201012_0007'), + ] + + operations = [ + migrations.AlterField( + model_name='auctionlisting', + name='picture', + field=models.URLField(null=True), + ), + ] diff --git a/auctions/migrations/__init__.py b/auctions/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/auctions/migrations/__pycache__/0001_initial.cpython-37.pyc b/auctions/migrations/__pycache__/0001_initial.cpython-37.pyc new file mode 100644 index 0000000..3b45368 Binary files /dev/null and b/auctions/migrations/__pycache__/0001_initial.cpython-37.pyc differ diff --git a/auctions/migrations/__pycache__/0002_auctionlisting_username.cpython-37.pyc b/auctions/migrations/__pycache__/0002_auctionlisting_username.cpython-37.pyc new file mode 100644 index 0000000..df04c72 Binary files /dev/null and b/auctions/migrations/__pycache__/0002_auctionlisting_username.cpython-37.pyc differ diff --git a/auctions/migrations/__pycache__/0002_auto_20201003_2319.cpython-37.pyc b/auctions/migrations/__pycache__/0002_auto_20201003_2319.cpython-37.pyc new file mode 100644 index 0000000..090008f Binary files /dev/null and b/auctions/migrations/__pycache__/0002_auto_20201003_2319.cpython-37.pyc differ diff --git a/auctions/migrations/__pycache__/0002_auto_20201011_2158.cpython-37.pyc b/auctions/migrations/__pycache__/0002_auto_20201011_2158.cpython-37.pyc new file mode 100644 index 0000000..5dcd719 Binary files /dev/null and b/auctions/migrations/__pycache__/0002_auto_20201011_2158.cpython-37.pyc differ diff --git a/auctions/migrations/__pycache__/0002_auto_20201011_2206.cpython-37.pyc b/auctions/migrations/__pycache__/0002_auto_20201011_2206.cpython-37.pyc new file mode 100644 index 0000000..6079e9a Binary files /dev/null and b/auctions/migrations/__pycache__/0002_auto_20201011_2206.cpython-37.pyc differ diff --git a/auctions/migrations/__pycache__/0002_auto_20201011_2323.cpython-37.pyc b/auctions/migrations/__pycache__/0002_auto_20201011_2323.cpython-37.pyc new file mode 100644 index 0000000..4521577 Binary files /dev/null and b/auctions/migrations/__pycache__/0002_auto_20201011_2323.cpython-37.pyc differ diff --git a/auctions/migrations/__pycache__/0002_remove_comments_title.cpython-37.pyc b/auctions/migrations/__pycache__/0002_remove_comments_title.cpython-37.pyc new file mode 100644 index 0000000..adefe7c Binary files /dev/null and b/auctions/migrations/__pycache__/0002_remove_comments_title.cpython-37.pyc differ diff --git a/auctions/migrations/__pycache__/0003_auto_20201003_2349.cpython-37.pyc b/auctions/migrations/__pycache__/0003_auto_20201003_2349.cpython-37.pyc new file mode 100644 index 0000000..ec24f91 Binary files /dev/null and b/auctions/migrations/__pycache__/0003_auto_20201003_2349.cpython-37.pyc differ diff --git a/auctions/migrations/__pycache__/0003_auto_20201011_2155.cpython-37.pyc b/auctions/migrations/__pycache__/0003_auto_20201011_2155.cpython-37.pyc new file mode 100644 index 0000000..919b313 Binary files /dev/null and b/auctions/migrations/__pycache__/0003_auto_20201011_2155.cpython-37.pyc differ diff --git a/auctions/migrations/__pycache__/0003_auto_20201011_2208.cpython-37.pyc b/auctions/migrations/__pycache__/0003_auto_20201011_2208.cpython-37.pyc new file mode 100644 index 0000000..6f66a25 Binary files /dev/null and b/auctions/migrations/__pycache__/0003_auto_20201011_2208.cpython-37.pyc differ diff --git a/auctions/migrations/__pycache__/0003_auto_20201011_2211.cpython-37.pyc b/auctions/migrations/__pycache__/0003_auto_20201011_2211.cpython-37.pyc new file mode 100644 index 0000000..9fd22af Binary files /dev/null and b/auctions/migrations/__pycache__/0003_auto_20201011_2211.cpython-37.pyc differ diff --git a/auctions/migrations/__pycache__/0003_auto_20201012_0007.cpython-37.pyc b/auctions/migrations/__pycache__/0003_auto_20201012_0007.cpython-37.pyc new file mode 100644 index 0000000..f1ff107 Binary files /dev/null and b/auctions/migrations/__pycache__/0003_auto_20201012_0007.cpython-37.pyc differ diff --git a/auctions/migrations/__pycache__/0004_auto_20201013_0925.cpython-37.pyc b/auctions/migrations/__pycache__/0004_auto_20201013_0925.cpython-37.pyc new file mode 100644 index 0000000..2d75cef Binary files /dev/null and b/auctions/migrations/__pycache__/0004_auto_20201013_0925.cpython-37.pyc differ diff --git a/auctions/migrations/__pycache__/0004_remove_auctionlisting_username.cpython-37.pyc b/auctions/migrations/__pycache__/0004_remove_auctionlisting_username.cpython-37.pyc new file mode 100644 index 0000000..196e7fb Binary files /dev/null and b/auctions/migrations/__pycache__/0004_remove_auctionlisting_username.cpython-37.pyc differ diff --git a/auctions/migrations/__pycache__/__init__.cpython-37.pyc b/auctions/migrations/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000..4b5437e Binary files /dev/null and b/auctions/migrations/__pycache__/__init__.cpython-37.pyc differ diff --git a/auctions/models.py b/auctions/models.py new file mode 100644 index 0000000..f4fd0ed --- /dev/null +++ b/auctions/models.py @@ -0,0 +1,22 @@ +from django.contrib.auth.models import AbstractUser +from django.db import models + + +class User(AbstractUser): + pass + + +class AuctionListing(models.Model): + title = models.CharField(max_length = 64,primary_key = True) + user = models.ForeignKey(User,on_delete = models.CASCADE,default = " ") + price = models.DecimalField(max_digits = 10,decimal_places = 2) + desc = models.CharField(max_length = 1000) + picture = models.URLField(null=True) + + + def __str__(self): + return f"{self.title}: {self.price},{self.desc},{self.picture}" +class Comments(models.Model): + title = models.ForeignKey(AuctionListing,on_delete = models.CASCADE,related_name="auction_title") + comment = models.CharField(max_length = 1000) + diff --git a/auctions/static/auctions/styles.css b/auctions/static/auctions/styles.css new file mode 100644 index 0000000..d61a8dd --- /dev/null +++ b/auctions/static/auctions/styles.css @@ -0,0 +1,3 @@ +body { + padding: 10px; +} diff --git a/auctions/templates/auctions/create_listing.html b/auctions/templates/auctions/create_listing.html new file mode 100644 index 0000000..296aaa8 --- /dev/null +++ b/auctions/templates/auctions/create_listing.html @@ -0,0 +1,37 @@ +{% extends "auctions/layout.html" %} + +{% block body %} + +

Create Listing

+ + +
+ {% csrf_token %} +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ +
+ + +{% endblock %} \ No newline at end of file diff --git a/auctions/templates/auctions/index.html b/auctions/templates/auctions/index.html new file mode 100644 index 0000000..b9b1cc5 --- /dev/null +++ b/auctions/templates/auctions/index.html @@ -0,0 +1,29 @@ +{% extends "auctions/layout.html" %} + +{% block body %} +

Active Listings

+
+ {% for listing in Listings %} + + {% endfor %} +
+ +{% endblock %} \ No newline at end of file diff --git a/auctions/templates/auctions/layout.html b/auctions/templates/auctions/layout.html new file mode 100644 index 0000000..975338e --- /dev/null +++ b/auctions/templates/auctions/layout.html @@ -0,0 +1,49 @@ +{% load static %} + + + + + {% block title %}Auctions{% endblock %} + + + + +

Auctions

+
+ {% if user.is_authenticated %} + Signed in as {{ user.username }}. + {% else %} + Not signed in. + {% endif %} +
+ +
+ {% block body %} + {% endblock %} + + diff --git a/auctions/templates/auctions/listing.html b/auctions/templates/auctions/listing.html new file mode 100644 index 0000000..c8bc5ff --- /dev/null +++ b/auctions/templates/auctions/listing.html @@ -0,0 +1,16 @@ +{% extends "auctions/layout.html" %} + +{% block body %} +

Listing:{Listing.title}

+ + + +

{Listing.desc}

+

${Listing.price}

+ bids so far +
+ +
+ + +{% endblock %} \ No newline at end of file diff --git a/auctions/templates/auctions/login.html b/auctions/templates/auctions/login.html new file mode 100644 index 0000000..67624a4 --- /dev/null +++ b/auctions/templates/auctions/login.html @@ -0,0 +1,24 @@ +{% extends "auctions/layout.html" %} + +{% block body %} + +

Login

+ + {% if message %} +
{{ message }}
+ {% endif %} + +
+ {% csrf_token %} +
+ +
+
+ +
+ +
+ + Don't have an account? Register here. + +{% endblock %} \ No newline at end of file diff --git a/auctions/templates/auctions/register.html b/auctions/templates/auctions/register.html new file mode 100644 index 0000000..47e956f --- /dev/null +++ b/auctions/templates/auctions/register.html @@ -0,0 +1,30 @@ +{% extends "auctions/layout.html" %} + +{% block body %} + +

Register

+ + {% if message %} +
{{ message }}
+ {% endif %} + +
+ {% csrf_token %} +
+ +
+
+ +
+
+ +
+
+ +
+ +
+ + Already have an account? Log In here. + +{% endblock %} \ No newline at end of file diff --git a/auctions/tests.py b/auctions/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/auctions/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/auctions/urls.py b/auctions/urls.py new file mode 100644 index 0000000..f758835 --- /dev/null +++ b/auctions/urls.py @@ -0,0 +1,13 @@ +from django.urls import path + +from . import views + +urlpatterns = [ + path("", views.index, name="index"), + path("login", views.login_view, name="login"), + path("logout", views.logout_view, name="logout"), + path("register", views.register, name="register"), + path("wishlist", views.register, name="wishlist"), + path("create", views.create, name="create"), + path("categories", views.register, name="categories") +] diff --git a/auctions/views.py b/auctions/views.py new file mode 100644 index 0000000..c6d2f4e --- /dev/null +++ b/auctions/views.py @@ -0,0 +1,92 @@ +from django.contrib.auth import authenticate, login, logout +from django.db import IntegrityError +from django.http import HttpResponse, HttpResponseRedirect +from django.shortcuts import render +from django.urls import reverse +from django.core.files import File +from django.core.files.temp import NamedTemporaryFile +from django.core.files.base import ContentFile +import requests +from .models import User,AuctionListing,Comments + + +def index(request): + listings = AuctionListing.objects.all() + + return render(request, "auctions/index.html",{ + "Listings":listings + }) + +def listing(request,title): + """ + docstring + """ + listing = AuctionListing.objects.get(title) + return render(request,"acutions/listing.html",{ + "Listing": listing + }) + +def login_view(request): + if request.method == "POST": + + # Attempt to sign user in + username = request.POST["username"] + password = request.POST["password"] + user = authenticate(request, username=username, password=password) + + # Check if authentication successful + if user is not None: + login(request, user) + return HttpResponseRedirect(reverse("index")) + else: + return render(request, "auctions/login.html", { + "message": "Invalid username and/or password." + }) + else: + return render(request, "auctions/login.html") + + +def logout_view(request): + logout(request) + return HttpResponseRedirect(reverse("index")) + + +def register(request): + if request.method == "POST": + username = request.POST["username"] + email = request.POST["email"] + + # Ensure password matches confirmation + password = request.POST["password"] + confirmation = request.POST["confirmation"] + if password != confirmation: + return render(request, "auctions/register.html", { + "message": "Passwords must match." + }) + + # Attempt to create new user + try: + user = User.objects.create_user(username, email, password) + user.save() + except IntegrityError: + return render(request, "auctions/register.html", { + "message": "Username already taken." + }) + login(request, user) + return HttpResponseRedirect(reverse("index")) + else: + return render(request, "auctions/register.html") +def create(request): + """ + docstring + """ + if request.method == "POST": + title = request.POST["title"] + desc = request.POST["desc"] + starting_bid = request.POST["starting_bid"] + photo_url = request.POST["photo"] + obj = AuctionListing(title = title, desc = desc, user = request.user,price = starting_bid, picture = photo_url) + obj.save() + return render(request,"auctions/index.html") + else: + return render(request,"auctions/create_listing.html") diff --git a/commerce/__init__.py b/commerce/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/commerce/__pycache__/__init__.cpython-37.pyc b/commerce/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000..497af41 Binary files /dev/null and b/commerce/__pycache__/__init__.cpython-37.pyc differ diff --git a/commerce/__pycache__/settings.cpython-37.pyc b/commerce/__pycache__/settings.cpython-37.pyc new file mode 100644 index 0000000..310e2f1 Binary files /dev/null and b/commerce/__pycache__/settings.cpython-37.pyc differ diff --git a/commerce/__pycache__/urls.cpython-37.pyc b/commerce/__pycache__/urls.cpython-37.pyc new file mode 100644 index 0000000..bb63353 Binary files /dev/null and b/commerce/__pycache__/urls.cpython-37.pyc differ diff --git a/commerce/__pycache__/wsgi.cpython-37.pyc b/commerce/__pycache__/wsgi.cpython-37.pyc new file mode 100644 index 0000000..41e598f Binary files /dev/null and b/commerce/__pycache__/wsgi.cpython-37.pyc differ diff --git a/commerce/asgi.py b/commerce/asgi.py new file mode 100644 index 0000000..5594f23 --- /dev/null +++ b/commerce/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for commerce project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'commerce.settings') + +application = get_asgi_application() diff --git a/commerce/settings.py b/commerce/settings.py new file mode 100644 index 0000000..016409a --- /dev/null +++ b/commerce/settings.py @@ -0,0 +1,122 @@ +""" +Django settings for commerce project. + +Generated by 'django-admin startproject' using Django 3.0.2. + +For more information on this file, see +https://docs.djangoproject.com/en/3.0/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/3.0/ref/settings/ +""" + +import os + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = '6ps8j!crjgrxt34cqbqn7x&b3y%(fny8k8nh21+qa)%ws3fh!q' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'auctions', + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'commerce.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'commerce.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/3.0/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + } +} + +AUTH_USER_MODEL = 'auctions.User' + +# Password validation +# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/3.0/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/3.0/howto/static-files/ + +STATIC_URL = '/static/' diff --git a/commerce/urls.py b/commerce/urls.py new file mode 100644 index 0000000..2f7a9e0 --- /dev/null +++ b/commerce/urls.py @@ -0,0 +1,22 @@ +"""commerce URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/3.0/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import include, path + +urlpatterns = [ + path("admin/", admin.site.urls), + path("", include("auctions.urls")) +] \ No newline at end of file diff --git a/commerce/wsgi.py b/commerce/wsgi.py new file mode 100644 index 0000000..054e015 --- /dev/null +++ b/commerce/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for commerce project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'commerce.settings') + +application = get_wsgi_application() diff --git a/db.sqlite3 b/db.sqlite3 new file mode 100644 index 0000000..d8116c0 Binary files /dev/null and b/db.sqlite3 differ diff --git a/google b/google new file mode 100644 index 0000000..492f44c Binary files /dev/null and b/google differ diff --git a/google_9q82OQA b/google_9q82OQA new file mode 100644 index 0000000..492f44c Binary files /dev/null and b/google_9q82OQA differ diff --git a/image_google b/image_google new file mode 100644 index 0000000..492f44c Binary files /dev/null and b/image_google differ diff --git a/image_google_sTknGkm b/image_google_sTknGkm new file mode 100644 index 0000000..492f44c Binary files /dev/null and b/image_google_sTknGkm differ diff --git a/manage.py b/manage.py new file mode 100644 index 0000000..bea064a --- /dev/null +++ b/manage.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'commerce.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main()