├── .gitignore ├── README.md ├── birthday_api ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-38.pyc │ ├── admin.cpython-38.pyc │ ├── models.cpython-38.pyc │ ├── serializers.cpython-38.pyc │ ├── urls.cpython-38.pyc │ └── views.cpython-38.pyc ├── admin.py ├── apps.py ├── migrations │ ├── 0001_initial.py │ ├── __init__.py │ └── __pycache__ │ │ ├── 0001_initial.cpython-38.pyc │ │ └── __init__.cpython-38.pyc ├── models.py ├── serializers.py ├── tests.py ├── urls.py └── views.py ├── birthday_reminder ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-38.pyc │ ├── settings.cpython-38.pyc │ ├── urls.cpython-38.pyc │ └── wsgi.cpython-38.pyc ├── asgi.py ├── settings.py ├── urls.py └── wsgi.py ├── db.sqlite3 ├── manage.py ├── media └── person │ ├── 20190210_091412.jpg │ ├── IMG_20190530_144021.jpg │ ├── IMG_20191012_123700.jpg │ ├── IMG_20191012_124115.jpg │ ├── IMG_20200228_155908.jpg │ ├── IMG_20200811_191643.jpg │ └── pp_shaon.jpg ├── react_birthday_reminder ├── .eslintcache ├── package-lock.json ├── package.json ├── public │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt └── src │ ├── App.js │ ├── App.test.js │ ├── List.js │ ├── index.css │ ├── index.js │ ├── reportWebVitals.js │ └── setupTests.js └── requirements.txt /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /react_birthday_reminder/node_modules 5 | /react_birthday_reminder/.pnp 6 | /react_birthday_reminder/.pnp.js 7 | 8 | # testing 9 | /react_birthday_reminder/coverage 10 | 11 | # production 12 | /react_birthday_reminder/build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Birthday Reminder 2 | `https://github.com/rkshaon/react_django_birthday_reminder` 3 | 4 | ## Requirements 5 | 1. You need to install Python (`https://www.python.org/downloads/`) 6 | 3. You need to install node (`https://nodejs.org/en/download/`) 7 | 4. You need to install npm (`https://www.npmjs.com/get-npm`) 8 | 5. You need to install npx (`https://www.npmjs.com/package/npx`) 9 | 10 | ## How to run? 11 | Open CLI and type mkdir project and hit enter\ 12 | $ cd project\ 13 | $ git clone `https://github.com/rkshaon/react_django_birthday_reminder.git`\ 14 | $ pip install -r requirements.txt\ 15 | $ cd react_birthday_reminder\ 16 | $ npm run build\ 17 | $ cd ..\ 18 | $ python manage.py runserver\ 19 | then open the browser and hit `http://127.0.0.1:8000/` 20 | 21 | ### Front End 22 | ReactJS 23 | 24 | ### Back End 25 | Django Rest Framework 26 | -------------------------------------------------------------------------------- /birthday_api/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/birthday_api/__init__.py -------------------------------------------------------------------------------- /birthday_api/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/birthday_api/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /birthday_api/__pycache__/admin.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/birthday_api/__pycache__/admin.cpython-38.pyc -------------------------------------------------------------------------------- /birthday_api/__pycache__/models.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/birthday_api/__pycache__/models.cpython-38.pyc -------------------------------------------------------------------------------- /birthday_api/__pycache__/serializers.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/birthday_api/__pycache__/serializers.cpython-38.pyc -------------------------------------------------------------------------------- /birthday_api/__pycache__/urls.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/birthday_api/__pycache__/urls.cpython-38.pyc -------------------------------------------------------------------------------- /birthday_api/__pycache__/views.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/birthday_api/__pycache__/views.cpython-38.pyc -------------------------------------------------------------------------------- /birthday_api/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from birthday_api.models import Person 3 | 4 | admin.site.register(Person) 5 | -------------------------------------------------------------------------------- /birthday_api/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class BirthdayApiConfig(AppConfig): 5 | name = 'birthday_api' 6 | -------------------------------------------------------------------------------- /birthday_api/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.1 on 2020-12-16 17:40 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | initial = True 9 | 10 | dependencies = [ 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='person', 16 | fields=[ 17 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 18 | ('name', models.CharField(blank=True, max_length=100)), 19 | ('age', models.IntegerField(blank=True)), 20 | ('image', models.ImageField(blank=True, upload_to='person/')), 21 | ], 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /birthday_api/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/birthday_api/migrations/__init__.py -------------------------------------------------------------------------------- /birthday_api/migrations/__pycache__/0001_initial.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/birthday_api/migrations/__pycache__/0001_initial.cpython-38.pyc -------------------------------------------------------------------------------- /birthday_api/migrations/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/birthday_api/migrations/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /birthday_api/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | class Person(models.Model): 4 | name = models.CharField(max_length=100, blank=True) 5 | age = models.IntegerField(blank=True) 6 | image = models.ImageField(upload_to='person/', blank=True) 7 | 8 | def __str__(self): 9 | return self.name 10 | -------------------------------------------------------------------------------- /birthday_api/serializers.py: -------------------------------------------------------------------------------- 1 | from rest_framework import serializers 2 | from birthday_api.models import Person 3 | 4 | class PersonSerializer(serializers.ModelSerializer): 5 | class Meta: 6 | model = Person 7 | # fields = ['name', 'age', 'image'] 8 | fields = '__all__' 9 | -------------------------------------------------------------------------------- /birthday_api/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /birthday_api/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | 4 | urlpatterns = [ 5 | path('person-list/', views.personList, name="person-list"), 6 | ] 7 | -------------------------------------------------------------------------------- /birthday_api/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | from django.http import JsonResponse 3 | from rest_framework.decorators import api_view 4 | from rest_framework.response import Response 5 | 6 | from birthday_api.models import Person 7 | from birthday_api.serializers import PersonSerializer 8 | 9 | @api_view(['GET']) 10 | def personList(request): 11 | persons = Person.objects.all().order_by('-id') 12 | serializer = PersonSerializer(persons, many=True) 13 | return Response(serializer.data) 14 | -------------------------------------------------------------------------------- /birthday_reminder/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/birthday_reminder/__init__.py -------------------------------------------------------------------------------- /birthday_reminder/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/birthday_reminder/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /birthday_reminder/__pycache__/settings.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/birthday_reminder/__pycache__/settings.cpython-38.pyc -------------------------------------------------------------------------------- /birthday_reminder/__pycache__/urls.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/birthday_reminder/__pycache__/urls.cpython-38.pyc -------------------------------------------------------------------------------- /birthday_reminder/__pycache__/wsgi.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/birthday_reminder/__pycache__/wsgi.cpython-38.pyc -------------------------------------------------------------------------------- /birthday_reminder/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for birthday_reminder project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'birthday_reminder.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /birthday_reminder/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for birthday_reminder project. 3 | 4 | Generated by 'django-admin startproject' using Django 3.0.7. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/3.0/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = '(mnu)s@ig^fd=fwgqpqiy+9hx4vx$gqglol)!4iig4*+5+ped(' 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = True 27 | 28 | ALLOWED_HOSTS = [] 29 | 30 | 31 | # Application definition 32 | 33 | INSTALLED_APPS = [ 34 | 'django.contrib.admin', 35 | 'django.contrib.auth', 36 | 'django.contrib.contenttypes', 37 | 'django.contrib.sessions', 38 | 'django.contrib.messages', 39 | 'django.contrib.staticfiles', 40 | 'rest_framework', 41 | 'birthday_api', 42 | 'corsheaders', 43 | ] 44 | 45 | MIDDLEWARE = [ 46 | 'corsheaders.middleware.CorsMiddleware', 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 = 'birthday_reminder.urls' 57 | 58 | TEMPLATES = [ 59 | { 60 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 61 | 'DIRS': [ 62 | os.path.join(BASE_DIR, 'react_birthday_reminder/build'), 63 | ], 64 | 'APP_DIRS': True, 65 | 'OPTIONS': { 66 | 'context_processors': [ 67 | 'django.template.context_processors.debug', 68 | 'django.template.context_processors.request', 69 | 'django.contrib.auth.context_processors.auth', 70 | 'django.contrib.messages.context_processors.messages', 71 | ], 72 | }, 73 | }, 74 | ] 75 | 76 | WSGI_APPLICATION = 'birthday_reminder.wsgi.application' 77 | 78 | 79 | # Database 80 | # https://docs.djangoproject.com/en/3.0/ref/settings/#databases 81 | 82 | DATABASES = { 83 | 'default': { 84 | 'ENGINE': 'django.db.backends.sqlite3', 85 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 86 | } 87 | } 88 | 89 | 90 | # Password validation 91 | # https://docs.djangoproject.com/en/3.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/3.0/topics/i18n/ 111 | 112 | LANGUAGE_CODE = 'en-us' 113 | 114 | TIME_ZONE = 'UTC' 115 | 116 | USE_I18N = True 117 | 118 | USE_L10N = True 119 | 120 | USE_TZ = True 121 | 122 | 123 | # Static files (CSS, JavaScript, Images) 124 | # https://docs.djangoproject.com/en/3.0/howto/static-files/ 125 | 126 | STATIC_URL = '/static/' 127 | STATICFILES_DIRS = [ 128 | os.path.join(BASE_DIR, 'react_birthday_reminder/build/static') 129 | ] 130 | 131 | MEDIA_URL = '/media/' 132 | MEDIA_ROOT = os.path.join(BASE_DIR, 'media') 133 | 134 | CORS_ORIGIN_WHITELIST = [ 135 | "http://localhost:3000", 136 | ] 137 | -------------------------------------------------------------------------------- /birthday_reminder/urls.py: -------------------------------------------------------------------------------- 1 | """birthday_reminder URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.0/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path, include 18 | from django.views.generic import TemplateView 19 | from django.conf import settings 20 | from django.conf.urls.static import static 21 | 22 | urlpatterns = [ 23 | path('', TemplateView.as_view(template_name='index.html')), 24 | path('admin/', admin.site.urls), 25 | path('birthday-api/', include('birthday_api.urls')), 26 | ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) 27 | -------------------------------------------------------------------------------- /birthday_reminder/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for birthday_reminder project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'birthday_reminder.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/db.sqlite3 -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'birthday_reminder.settings') 9 | try: 10 | from django.core.management import execute_from_command_line 11 | except ImportError as exc: 12 | raise ImportError( 13 | "Couldn't import Django. Are you sure it's installed and " 14 | "available on your PYTHONPATH environment variable? Did you " 15 | "forget to activate a virtual environment?" 16 | ) from exc 17 | execute_from_command_line(sys.argv) 18 | 19 | 20 | if __name__ == '__main__': 21 | main() 22 | -------------------------------------------------------------------------------- /media/person/20190210_091412.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/media/person/20190210_091412.jpg -------------------------------------------------------------------------------- /media/person/IMG_20190530_144021.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/media/person/IMG_20190530_144021.jpg -------------------------------------------------------------------------------- /media/person/IMG_20191012_123700.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/media/person/IMG_20191012_123700.jpg -------------------------------------------------------------------------------- /media/person/IMG_20191012_124115.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/media/person/IMG_20191012_124115.jpg -------------------------------------------------------------------------------- /media/person/IMG_20200228_155908.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/media/person/IMG_20200228_155908.jpg -------------------------------------------------------------------------------- /media/person/IMG_20200811_191643.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/media/person/IMG_20200811_191643.jpg -------------------------------------------------------------------------------- /media/person/pp_shaon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/media/person/pp_shaon.jpg -------------------------------------------------------------------------------- /react_birthday_reminder/.eslintcache: -------------------------------------------------------------------------------- 1 | [{"C:\\Users\\shaon\\OneDrive\\Desktop\\react\\react_birthday_reminder\\src\\index.js":"1","C:\\Users\\shaon\\OneDrive\\Desktop\\react\\react_birthday_reminder\\src\\App.js":"2","C:\\Users\\shaon\\OneDrive\\Desktop\\react\\react_birthday_reminder\\src\\reportWebVitals.js":"3","C:\\Users\\shaon\\OneDrive\\Desktop\\react\\react_birthday_reminder\\src\\List.js":"4","C:\\Users\\shaon\\OneDrive\\Desktop\\python-lecture\\my_django_staff\\birthday_reminder\\react_birthday_reminder\\src\\index.js":"5","C:\\Users\\shaon\\OneDrive\\Desktop\\python-lecture\\my_django_staff\\birthday_reminder\\react_birthday_reminder\\src\\App.js":"6","C:\\Users\\shaon\\OneDrive\\Desktop\\python-lecture\\my_django_staff\\birthday_reminder\\react_birthday_reminder\\src\\reportWebVitals.js":"7","C:\\Users\\shaon\\OneDrive\\Desktop\\python-lecture\\my_django_staff\\birthday_reminder\\react_birthday_reminder\\src\\List.js":"8"},{"size":500,"mtime":499162500000,"results":"9","hashOfConfig":"10"},{"size":745,"mtime":1608149525242,"results":"11","hashOfConfig":"10"},{"size":362,"mtime":499162500000,"results":"12","hashOfConfig":"10"},{"size":425,"mtime":1608149593253,"results":"13","hashOfConfig":"10"},{"size":500,"mtime":499162500000,"results":"14","hashOfConfig":"15"},{"size":745,"mtime":1608149525242,"results":"16","hashOfConfig":"15"},{"size":362,"mtime":499162500000,"results":"17","hashOfConfig":"15"},{"size":425,"mtime":1608150809090,"results":"18","hashOfConfig":"15"},{"filePath":"19","messages":"20","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"sdi6zy",{"filePath":"21","messages":"22","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"23","messages":"24","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"25","messages":"26","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"27","messages":"28","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"29"},"1gotoff",{"filePath":"30","messages":"31","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"29"},{"filePath":"32","messages":"33","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"29"},{"filePath":"34","messages":"35","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\shaon\\OneDrive\\Desktop\\react\\react_birthday_reminder\\src\\index.js",[],"C:\\Users\\shaon\\OneDrive\\Desktop\\react\\react_birthday_reminder\\src\\App.js",[],"C:\\Users\\shaon\\OneDrive\\Desktop\\react\\react_birthday_reminder\\src\\reportWebVitals.js",[],"C:\\Users\\shaon\\OneDrive\\Desktop\\react\\react_birthday_reminder\\src\\List.js",[],"C:\\Users\\shaon\\OneDrive\\Desktop\\python-lecture\\my_django_staff\\birthday_reminder\\react_birthday_reminder\\src\\index.js",[],["36","37"],"C:\\Users\\shaon\\OneDrive\\Desktop\\python-lecture\\my_django_staff\\birthday_reminder\\react_birthday_reminder\\src\\App.js",[],"C:\\Users\\shaon\\OneDrive\\Desktop\\python-lecture\\my_django_staff\\birthday_reminder\\react_birthday_reminder\\src\\reportWebVitals.js",[],"C:\\Users\\shaon\\OneDrive\\Desktop\\python-lecture\\my_django_staff\\birthday_reminder\\react_birthday_reminder\\src\\List.js",[],{"ruleId":"38","replacedBy":"39"},{"ruleId":"40","replacedBy":"41"},"no-native-reassign",["42"],"no-negated-in-lhs",["43"],"no-global-assign","no-unsafe-negation"] -------------------------------------------------------------------------------- /react_birthday_reminder/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react_birthday_reminder", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.11.6", 7 | "@testing-library/react": "^11.2.2", 8 | "@testing-library/user-event": "^12.6.0", 9 | "react": "^17.0.1", 10 | "react-dom": "^17.0.1", 11 | "react-scripts": "4.0.1", 12 | "web-vitals": "^0.2.4" 13 | }, 14 | "scripts": { 15 | "start": "react-scripts start", 16 | "build": "react-scripts build", 17 | "test": "react-scripts test", 18 | "eject": "react-scripts eject" 19 | }, 20 | "eslintConfig": { 21 | "extends": [ 22 | "react-app", 23 | "react-app/jest" 24 | ] 25 | }, 26 | "browserslist": { 27 | "production": [ 28 | ">0.2%", 29 | "not dead", 30 | "not op_mini all" 31 | ], 32 | "development": [ 33 | "last 1 chrome version", 34 | "last 1 firefox version", 35 | "last 1 safari version" 36 | ] 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /react_birthday_reminder/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/react_birthday_reminder/public/favicon.ico -------------------------------------------------------------------------------- /react_birthday_reminder/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | Birthday Reminder 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /react_birthday_reminder/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/react_birthday_reminder/public/logo192.png -------------------------------------------------------------------------------- /react_birthday_reminder/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rkshaon/react_django_birthday_reminder/92c40a730a77698e0fd44a9d1a328c2eb48d66db/react_birthday_reminder/public/logo512.png -------------------------------------------------------------------------------- /react_birthday_reminder/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /react_birthday_reminder/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /react_birthday_reminder/src/App.js: -------------------------------------------------------------------------------- 1 | import React, { useState, useEffect } from 'react'; 2 | import List from './List'; 3 | 4 | function App() { 5 | const [people, setPeople] = useState([]); 6 | 7 | useEffect( () => { 8 | getPersons(); 9 | console.log('we are fetching data'); 10 | }, []); 11 | 12 | const getPersons = async () => { 13 | const response = await fetch(`http://127.0.0.1:8000/birthday-api/person-list/`); 14 | const data = await response.json(); 15 | console.log(data); 16 | setPeople(data); 17 | console.log('Get Person Method'); 18 | } 19 | return ( 20 |
21 |
22 |

{people.length} birthdays today

23 | 24 | 25 |
26 |
27 | ); 28 | } 29 | 30 | export default App; 31 | -------------------------------------------------------------------------------- /react_birthday_reminder/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /react_birthday_reminder/src/List.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const List = ({people}) => { 4 | return ( 5 | <> 6 | {people.map((person)=>{ 7 | const {id, name, age, image} = person; 8 | return
9 | {name} 10 |
11 |

{name}

12 |

{age} years

13 |
14 |
15 | })} 16 | 17 | ); 18 | }; 19 | 20 | export default List; 21 | -------------------------------------------------------------------------------- /react_birthday_reminder/src/index.css: -------------------------------------------------------------------------------- 1 | /* 2 | =============== 3 | Variables 4 | =============== 5 | */ 6 | 7 | :root { 8 | /* dark shades of primary color*/ 9 | --clr-primary-1: hsl(162, 61%, 89%); 10 | --clr-primary-2: hsl(162, 60%, 78%); 11 | --clr-primary-3: hsl(162, 61%, 67%); 12 | --clr-primary-4: hsl(162, 61%, 57%); 13 | /* primary/main color */ 14 | --clr-primary-5: hsl(162, 73%, 46%); 15 | /* lighter shades of primary color */ 16 | --clr-primary-6: #1aa179; 17 | --clr-primary-7: #13795b; 18 | --clr-primary-8: #0d503c; 19 | --clr-primary-9: #06281e; 20 | /* darkest grey - used for headings */ 21 | --clr-grey-1: hsl(212, 33%, 89%); 22 | --clr-grey-2: hsl(210, 31%, 80%); 23 | --clr-grey-3: hsl(211, 27%, 70%); 24 | --clr-grey-4: hsl(209, 23%, 60%); 25 | /* grey used for paragraphs */ 26 | --clr-grey-5: hsl(210, 22%, 49%); 27 | --clr-grey-6: hsl(209, 28%, 39%); 28 | --clr-grey-7: hsl(209, 34%, 30%); 29 | --clr-grey-8: hsl(211, 39%, 23%); 30 | --clr-grey-9: hsl(209, 61%, 16%); 31 | --clr-white: #fff; 32 | --clr-red-dark: hsl(360, 67%, 44%); 33 | --clr-red-light: hsl(360, 71%, 66%); 34 | --clr-green-dark: hsl(125, 67%, 44%); 35 | --clr-green-light: hsl(125, 71%, 66%); 36 | --clr-black: #222; 37 | --transition: all 0.3s linear; 38 | --spacing: 0.1rem; 39 | --radius: 0.25rem; 40 | --light-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); 41 | --dark-shadow: 0 5px 15px rgba(0, 0, 0, 0.4); 42 | --max-width: 1170px; 43 | --fixed-width: 450px; 44 | --clr-pink: #f28ab2; 45 | } 46 | /* 47 | =============== 48 | Global Styles 49 | =============== 50 | */ 51 | 52 | *, 53 | ::after, 54 | ::before { 55 | margin: 0; 56 | padding: 0; 57 | box-sizing: border-box; 58 | } 59 | body { 60 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, 61 | Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; 62 | background: var(--clr-pink); 63 | color: var(--clr-grey-9); 64 | line-height: 1.5; 65 | font-size: 0.875rem; 66 | } 67 | ul { 68 | list-style-type: none; 69 | } 70 | a { 71 | text-decoration: none; 72 | } 73 | h1, 74 | h2, 75 | h3, 76 | h4 { 77 | letter-spacing: var(--spacing); 78 | text-transform: capitalize; 79 | line-height: 1.25; 80 | margin-bottom: 0.75rem; 81 | } 82 | h1 { 83 | font-size: 3rem; 84 | } 85 | h2 { 86 | font-size: 2rem; 87 | } 88 | h3 { 89 | font-size: 1.25rem; 90 | } 91 | h4 { 92 | font-size: 0.875rem; 93 | } 94 | p { 95 | margin-bottom: 1.25rem; 96 | color: var(--clr-grey-5); 97 | } 98 | @media screen and (min-width: 800px) { 99 | h1 { 100 | font-size: 4rem; 101 | } 102 | h2 { 103 | font-size: 2.5rem; 104 | } 105 | h3 { 106 | font-size: 1.75rem; 107 | } 108 | h4 { 109 | font-size: 1rem; 110 | } 111 | body { 112 | font-size: 1rem; 113 | } 114 | h1, 115 | h2, 116 | h3, 117 | h4 { 118 | line-height: 1; 119 | } 120 | } 121 | /* global classes */ 122 | 123 | /* section */ 124 | .section { 125 | width: 90vw; 126 | margin: 0 auto; 127 | max-width: var(--max-width); 128 | } 129 | 130 | @media screen and (min-width: 992px) { 131 | .section { 132 | width: 95vw; 133 | } 134 | } 135 | 136 | main { 137 | min-height: 100vh; 138 | display: flex; 139 | justify-content: center; 140 | align-items: center; 141 | } 142 | 143 | .container { 144 | width: 90vw; 145 | margin: 5rem 0; 146 | max-width: var(--fixed-width); 147 | background: var(--clr-white); 148 | border-radius: var(--radius); 149 | padding: 1.5rem 2rem; 150 | box-shadow: var(--dark-shadow); 151 | } 152 | .container h3 { 153 | font-weight: normal; 154 | text-transform: none; 155 | margin-bottom: 2rem; 156 | } 157 | .person { 158 | display: grid; 159 | grid-template-columns: auto 1fr; 160 | column-gap: 0.75rem; 161 | margin-bottom: 1.5rem; 162 | align-items: center; 163 | } 164 | .person img { 165 | width: 75px; 166 | height: 75px; 167 | object-fit: cover; 168 | border-radius: 50%; 169 | box-shadow: var(--light-shadow); 170 | } 171 | .person h4 { 172 | margin-bottom: 0.35rem; 173 | } 174 | .person p { 175 | margin-bottom: 0; 176 | } 177 | .container button { 178 | color: var(--clr-white); 179 | display: block; 180 | width: 100%; 181 | border-color: transparent; 182 | background: var(--clr-pink); 183 | margin: 2rem auto 0 auto; 184 | text-transform: capitalize; 185 | font-size: 1.2rem; 186 | padding: 0.5rem 0; 187 | letter-spacing: var(--spacing); 188 | border-radius: var(--radius); 189 | outline: 1px solid rgba(242, 138, 178, 0.8); 190 | cursor: pointer; 191 | } 192 | -------------------------------------------------------------------------------- /react_birthday_reminder/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | ReactDOM.render( 8 | 9 | 10 | , 11 | document.getElementById('root') 12 | ); 13 | 14 | // If you want to start measuring performance in your app, pass a function 15 | // to log results (for example: reportWebVitals(console.log)) 16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 17 | reportWebVitals(); 18 | -------------------------------------------------------------------------------- /react_birthday_reminder/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /react_birthday_reminder/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Django == 3.0.7 2 | Pillow == 6.2.2 3 | djangorestframework 4 | django-cors-headers 5 | --------------------------------------------------------------------------------