Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
TanvirApon committed Sep 10, 2020
0 parents commit ff2cea5
Show file tree
Hide file tree
Showing 97 changed files with 1,597 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
media/
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"compile-hero.disable-compile-files-on-did-save-code": false
}
Empty file added Hello/__init__.py
Empty file.
Binary file added Hello/__pycache__/__init__.cpython-35.pyc
Binary file not shown.
Binary file added Hello/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file added Hello/__pycache__/settings.cpython-35.pyc
Binary file not shown.
Binary file added Hello/__pycache__/settings.cpython-37.pyc
Binary file not shown.
Binary file added Hello/__pycache__/urls.cpython-35.pyc
Binary file not shown.
Binary file added Hello/__pycache__/urls.cpython-37.pyc
Binary file not shown.
Binary file added Hello/__pycache__/wsgi.cpython-35.pyc
Binary file not shown.
Binary file added Hello/__pycache__/wsgi.cpython-37.pyc
Binary file not shown.
16 changes: 16 additions & 0 deletions Hello/asgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
ASGI config for Hello 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', 'Hello.settings')

application = get_asgi_application()
130 changes: 130 additions & 0 deletions Hello/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
"""
Django settings for Hello project.
Generated by 'django-admin startproject' using Django 3.0.6.
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 = '6fr$123tfcq4%@95c3=7f2x&lxberztg0xart!o!0pkwg&uca-'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
'home.apps.HomeConfig',
'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 = 'Hello.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR,"template")],
'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 = 'Hello.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'),
}
}


# 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/'

#additional dir

STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static")
]
#managing media
MEDIA_ROOT = os.path.join(BASE_DIR,'media')
MEDIA_URLS = '/media/'
31 changes: 31 additions & 0 deletions Hello/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""Hello 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 path,include
from django.conf import settings
from django.conf.urls.static import static

admin.site.site_header = "WATER GARDEN ADMIN"
admin.site.site_title = "WATER GARDEN ADMIN PORTAL"
admin.site.index_title = "Welcome to WATER GARDEN"




urlpatterns = [
path('admin/', admin.site.urls),
path('',include('home.urls')),
]+ static(settings.MEDIA_URLS,document_root=settings.MEDIA_ROOT)
16 changes: 16 additions & 0 deletions Hello/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
WSGI config for Hello 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', 'Hello.settings')

application = get_wsgi_application()
Binary file added db.sqlite3
Binary file not shown.
Empty file added home/__init__.py
Empty file.
Binary file added home/__pycache__/__init__.cpython-35.pyc
Binary file not shown.
Binary file added home/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file added home/__pycache__/admin.cpython-35.pyc
Binary file not shown.
Binary file added home/__pycache__/admin.cpython-37.pyc
Binary file not shown.
Binary file added home/__pycache__/apps.cpython-35.pyc
Binary file not shown.
Binary file added home/__pycache__/apps.cpython-37.pyc
Binary file not shown.
Binary file added home/__pycache__/models.cpython-35.pyc
Binary file not shown.
Binary file added home/__pycache__/models.cpython-37.pyc
Binary file not shown.
Binary file added home/__pycache__/urls.cpython-35.pyc
Binary file not shown.
Binary file added home/__pycache__/urls.cpython-37.pyc
Binary file not shown.
Binary file added home/__pycache__/views.cpython-35.pyc
Binary file not shown.
Binary file added home/__pycache__/views.cpython-37.pyc
Binary file not shown.
8 changes: 8 additions & 0 deletions home/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.contrib import admin

# Register your models here.
from .models import Fish,Product,Food,Orders
admin.site.register(Fish)
admin.site.register(Product)
admin.site.register(Food)
admin.site.register(Orders)
5 changes: 5 additions & 0 deletions home/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class HomeConfig(AppConfig):
name = 'home'
25 changes: 25 additions & 0 deletions home/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 3.0.6 on 2020-06-25 18:09

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Fish',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=50)),
('desc', models.CharField(max_length=300)),
('date', models.DateField()),
('price', models.IntegerField()),
('image', models.ImageField(upload_to='static/fish')),
],
),
]
55 changes: 55 additions & 0 deletions home/migrations/0002_auto_20200626_0822.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Generated by Django 3.0.6 on 2020-06-26 15:22

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('home', '0001_initial'),
]

operations = [
migrations.CreateModel(
name='Food',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('food_name', models.CharField(max_length=50)),
('food_desc', models.CharField(max_length=300)),
('date', models.DateField()),
('food_price', models.IntegerField()),
('food_image', models.ImageField(upload_to='static/food')),
],
),
migrations.CreateModel(
name='Product',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('product_name', models.CharField(max_length=50)),
('product_desc', models.CharField(max_length=300)),
('date', models.DateField()),
('product_price', models.IntegerField()),
('product_image', models.ImageField(upload_to='static/product')),
],
),
migrations.RenameField(
model_name='fish',
old_name='desc',
new_name='fish_desc',
),
migrations.RenameField(
model_name='fish',
old_name='image',
new_name='fish_image',
),
migrations.RenameField(
model_name='fish',
old_name='name',
new_name='fish_name',
),
migrations.RenameField(
model_name='fish',
old_name='price',
new_name='fish_price',
),
]
40 changes: 40 additions & 0 deletions home/migrations/0003_auto_20200630_2052.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Generated by Django 3.0.6 on 2020-07-01 03:52

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('home', '0002_auto_20200626_0822'),
]

operations = [
migrations.CreateModel(
name='Item',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('item_name', models.CharField(max_length=50)),
('item_desc', models.CharField(max_length=300)),
('date', models.DateField()),
('item_catagory', models.CharField(max_length=300)),
('item_price', models.IntegerField()),
('item_image', models.ImageField(upload_to='media/')),
],
),
migrations.AlterField(
model_name='fish',
name='fish_image',
field=models.ImageField(upload_to='media/'),
),
migrations.AlterField(
model_name='food',
name='food_image',
field=models.ImageField(upload_to='media/'),
),
migrations.AlterField(
model_name='product',
name='product_image',
field=models.ImageField(upload_to='media/'),
),
]
16 changes: 16 additions & 0 deletions home/migrations/0004_delete_item.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by Django 2.2.15 on 2020-08-14 03:10

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('home', '0003_auto_20200630_2052'),
]

operations = [
migrations.DeleteModel(
name='Item',
),
]
Loading

0 comments on commit ff2cea5

Please sign in to comment.