├── quotes ├── __init__.py ├── migrations │ ├── __init__.py │ ├── 0002_quote_category.py │ ├── 0001_initial.py │ ├── 0004_comment_like.py │ ├── 0003_alter_quote_category.py │ └── 0005_alter_quote_category.py ├── templates │ └── quotes │ │ ├── comment_item.html │ │ ├── search.html │ │ ├── category.html │ │ ├── index.html │ │ └── quote_detail.html ├── static │ └── images │ │ └── favicon.ico ├── apps.py ├── admin.py ├── serializers.py ├── urls.py ├── tests.py ├── views.py └── models.py ├── .gitignore ├── QuotesApp ├── __init__.py ├── urls.py ├── asgi.py ├── wsgi.py └── settings.py ├── db.sqlite3 ├── readme-images ├── api.png ├── category.png ├── details.png ├── homepage.png └── results.png ├── .idea ├── vcs.xml ├── .gitignore ├── inspectionProfiles │ ├── profiles_settings.xml │ └── Project_Default.xml ├── modules.xml ├── misc.xml ├── dataSources.xml └── QuotesApp.iml ├── manage.py ├── LICENSE ├── requirements.txt └── README.md /quotes/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.env 2 | -------------------------------------------------------------------------------- /QuotesApp/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /quotes/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hoangsonww/Django-Quote-Application/HEAD/db.sqlite3 -------------------------------------------------------------------------------- /readme-images/api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hoangsonww/Django-Quote-Application/HEAD/readme-images/api.png -------------------------------------------------------------------------------- /readme-images/category.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hoangsonww/Django-Quote-Application/HEAD/readme-images/category.png -------------------------------------------------------------------------------- /readme-images/details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hoangsonww/Django-Quote-Application/HEAD/readme-images/details.png -------------------------------------------------------------------------------- /readme-images/homepage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hoangsonww/Django-Quote-Application/HEAD/readme-images/homepage.png -------------------------------------------------------------------------------- /readme-images/results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hoangsonww/Django-Quote-Application/HEAD/readme-images/results.png -------------------------------------------------------------------------------- /quotes/templates/quotes/comment_item.html: -------------------------------------------------------------------------------- 1 |
{{ quotes.count }} results found for "{{ query }}".
91 |Please enter a search query.
102 | {% endif %} 103 | 104 | 105 | 106 | 109 | 110 | -------------------------------------------------------------------------------- /QuotesApp/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for QuotesApp project. 3 | 4 | Generated by 'django-admin startproject' using Django 5.0. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/5.0/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/5.0/ref/settings/ 11 | """ 12 | 13 | from pathlib import Path 14 | from decouple import config 15 | 16 | # Build paths inside the project like this: BASE_DIR / 'subdir'. 17 | BASE_DIR = Path(__file__).resolve().parent.parent 18 | 19 | 20 | # Quick-start development settings - unsuitable for production 21 | # See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/ 22 | 23 | # SECURITY WARNING: keep the secret key used in production secret! 24 | SECRET_KEY = config('DJANGO_SECRET_KEY') 25 | 26 | # SECURITY WARNING: don't run with debug turned on in production! 27 | DEBUG = False 28 | 29 | ALLOWED_HOSTS = ['*'] 30 | 31 | CORS_ALLOWED_ORIGINS = ['*'] 32 | 33 | # Application definition 34 | 35 | INSTALLED_APPS = [ 36 | 'django.contrib.admin', 37 | 'django.contrib.auth', 38 | 'django.contrib.contenttypes', 39 | 'django.contrib.sessions', 40 | 'django.contrib.messages', 41 | 'django.contrib.staticfiles', 42 | 'rest_framework', 43 | 'quotes', 44 | ] 45 | 46 | MIDDLEWARE = [ 47 | 'django.middleware.security.SecurityMiddleware', 48 | 'django.contrib.sessions.middleware.SessionMiddleware', 49 | 'django.middleware.common.CommonMiddleware', 50 | 'django.middleware.csrf.CsrfViewMiddleware', 51 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 52 | 'django.contrib.messages.middleware.MessageMiddleware', 53 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 54 | ] 55 | 56 | ROOT_URLCONF = 'QuotesApp.urls' 57 | 58 | TEMPLATES = [ 59 | { 60 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 61 | 'DIRS': [], 62 | 'APP_DIRS': True, 63 | 'OPTIONS': { 64 | 'context_processors': [ 65 | 'django.template.context_processors.debug', 66 | 'django.template.context_processors.request', 67 | 'django.contrib.auth.context_processors.auth', 68 | 'django.contrib.messages.context_processors.messages', 69 | ], 70 | }, 71 | }, 72 | ] 73 | 74 | WSGI_APPLICATION = 'QuotesApp.wsgi.application' 75 | 76 | ADMIN_SITE_HEADER = "Quotes Application Administration" 77 | 78 | 79 | # Database 80 | # https://docs.djangoproject.com/en/5.0/ref/settings/#databases 81 | 82 | DATABASES = { 83 | 'default': { 84 | 'ENGINE': 'django.db.backends.sqlite3', 85 | 'NAME': BASE_DIR / 'db.sqlite3', 86 | } 87 | } 88 | 89 | 90 | # Password validation 91 | # https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators 92 | 93 | AUTH_PASSWORD_VALIDATORS = [ 94 | { 95 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 96 | }, 97 | { 98 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 99 | }, 100 | { 101 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 102 | }, 103 | { 104 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 105 | }, 106 | ] 107 | 108 | 109 | # Internationalization 110 | # https://docs.djangoproject.com/en/5.0/topics/i18n/ 111 | 112 | LANGUAGE_CODE = 'en-us' 113 | 114 | TIME_ZONE = 'UTC' 115 | 116 | USE_I18N = True 117 | 118 | USE_TZ = True 119 | 120 | 121 | # Static files (CSS, JavaScript, Images) 122 | # https://docs.djangoproject.com/en/5.0/howto/static-files/ 123 | 124 | STATIC_URL = 'static/' 125 | 126 | # Default primary key field type 127 | # https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field 128 | 129 | DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' 130 | -------------------------------------------------------------------------------- /quotes/templates/quotes/category.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |Likes: {{ quote.like_set.count }}
121 |No quotes found in this category.
137 | {% endif %} 138 |
28 |
29 |
34 |
35 |
40 |
41 |
46 |
47 |
207 |
208 |
- By {{ quote.author }}
172 |Category: {{ quote.get_category_display }}
173 | {% if user.is_authenticated %} 174 | 183 |Likes: {{ quote.like_set.count }}
184 |Please log in to like and comment.
198 | {% endif %} 199 | {% else %} 200 |No quotes available.
201 | {% endif %} 202 |- By {{ quote.author }}
170 |Category: {{ quote.get_category_display }}
171 | {% if user.is_authenticated %} 172 | 181 |Likes: {{ quote.like_set.count }}
182 |Please log in to like and comment.
196 | {% endif %} 197 | {% else %} 198 |Quote not found.
199 | {% endif %} 200 |