├── Memer ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-310.pyc │ ├── settings.cpython-310.pyc │ ├── urls.cpython-310.pyc │ └── wsgi.cpython-310.pyc ├── asgi.py ├── settings.py ├── urls.py └── wsgi.py ├── README.md ├── db.sqlite3 ├── manage.py ├── media └── myimage │ ├── 1.jfif │ ├── 2.jfif │ ├── 3.jfif │ ├── 5.jfif │ ├── 7.jfif │ ├── 8.jfif │ ├── India.jpg │ ├── plan.jfif │ ├── plan_KmMEtzz.jfif │ ├── plan_SbEfWsV.jfif │ ├── plan_nVsJtAE.jfif │ └── plan_rlgR58O.jfif ├── myapp ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-310.pyc │ ├── admin.cpython-310.pyc │ ├── apps.cpython-310.pyc │ ├── forms.cpython-310.pyc │ ├── models.cpython-310.pyc │ └── views.cpython-310.pyc ├── admin.py ├── apps.py ├── forms.py ├── migrations │ ├── 0001_initial.py │ ├── __init__.py │ └── __pycache__ │ │ ├── 0001_initial.cpython-310.pyc │ │ └── __init__.cpython-310.pyc ├── models.py ├── templates │ └── myapp │ │ └── home.html ├── tests.py └── views.py ├── myimage └── lion.png └── requirements.txt /Memer/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/Memer/__init__.py -------------------------------------------------------------------------------- /Memer/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/Memer/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /Memer/__pycache__/settings.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/Memer/__pycache__/settings.cpython-310.pyc -------------------------------------------------------------------------------- /Memer/__pycache__/urls.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/Memer/__pycache__/urls.cpython-310.pyc -------------------------------------------------------------------------------- /Memer/__pycache__/wsgi.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/Memer/__pycache__/wsgi.cpython-310.pyc -------------------------------------------------------------------------------- /Memer/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for Memer 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/4.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', 'Memer.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /Memer/settings.py: -------------------------------------------------------------------------------- 1 | 2 | from pathlib import Path 3 | 4 | # Build paths inside the project like this: BASE_DIR / 'subdir'. 5 | BASE_DIR = Path(__file__).resolve().parent.parent 6 | 7 | 8 | # Quick-start development settings - unsuitable for production 9 | # See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/ 10 | 11 | # SECURITY WARNING: keep the secret key used in production secret! 12 | SECRET_KEY = 'django-insecure-a349fu$8#4$b$7qv24^09-hnj9zvc))8_&4!^i&o3m&l0-%=84' 13 | 14 | # SECURITY WARNING: don't run with debug turned on in production! 15 | DEBUG = True 16 | 17 | ALLOWED_HOSTS = [] 18 | 19 | 20 | # Application definition 21 | 22 | INSTALLED_APPS = [ 23 | 'django.contrib.admin', 24 | 'django.contrib.auth', 25 | 'django.contrib.contenttypes', 26 | 'django.contrib.sessions', 27 | 'django.contrib.messages', 28 | 'django.contrib.staticfiles', 29 | 'myapp', 30 | ] 31 | 32 | MIDDLEWARE = [ 33 | 'django.middleware.security.SecurityMiddleware', 34 | 'django.contrib.sessions.middleware.SessionMiddleware', 35 | 'django.middleware.common.CommonMiddleware', 36 | 'django.middleware.csrf.CsrfViewMiddleware', 37 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 38 | 'django.contrib.messages.middleware.MessageMiddleware', 39 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 40 | ] 41 | 42 | ROOT_URLCONF = 'Memer.urls' 43 | 44 | TEMPLATES = [ 45 | { 46 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 47 | 'DIRS': [], 48 | 'APP_DIRS': True, 49 | 'OPTIONS': { 50 | 'context_processors': [ 51 | 'django.template.context_processors.debug', 52 | 'django.template.context_processors.request', 53 | 'django.contrib.auth.context_processors.auth', 54 | 'django.contrib.messages.context_processors.messages', 55 | ], 56 | }, 57 | }, 58 | ] 59 | 60 | WSGI_APPLICATION = 'Memer.wsgi.application' 61 | 62 | 63 | # Database 64 | # https://docs.djangoproject.com/en/4.0/ref/settings/#databases 65 | 66 | DATABASES = { 67 | 'default': { 68 | 'ENGINE': 'django.db.backends.sqlite3', 69 | 'NAME': BASE_DIR / 'db.sqlite3', 70 | } 71 | } 72 | 73 | 74 | # Password validation 75 | # https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators 76 | 77 | AUTH_PASSWORD_VALIDATORS = [ 78 | { 79 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 80 | }, 81 | { 82 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 83 | }, 84 | { 85 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 86 | }, 87 | { 88 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 89 | }, 90 | ] 91 | 92 | 93 | # Internationalization 94 | # https://docs.djangoproject.com/en/4.0/topics/i18n/ 95 | 96 | LANGUAGE_CODE = 'en-us' 97 | 98 | TIME_ZONE = 'UTC' 99 | 100 | USE_I18N = True 101 | 102 | USE_TZ = True 103 | 104 | 105 | # Static files (CSS, JavaScript, Images) 106 | # https://docs.djangoproject.com/en/4.0/howto/static-files/ 107 | 108 | STATIC_URL = '/static/' 109 | MEDIA_URL = '/media/' 110 | MEDIA_ROOT = BASE_DIR / 'media' 111 | 112 | # Default primary key field type 113 | # https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field 114 | 115 | DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' 116 | -------------------------------------------------------------------------------- /Memer/urls.py: -------------------------------------------------------------------------------- 1 | 2 | from django.contrib import admin 3 | from django.urls import path 4 | from myapp import views 5 | from django.conf import settings 6 | from django.conf.urls.static import static 7 | 8 | urlpatterns = [ 9 | path('admin/', admin.site.urls), 10 | path('',views.home) 11 | ]+ static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT) 12 | -------------------------------------------------------------------------------- /Memer/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for Memer 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/4.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', 'Memer.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Meme-Book 2 | A Django website to upload and share memes anonymously 3 | 4 | ![s1](https://user-images.githubusercontent.com/64016811/153739549-47920cc3-0aad-4546-b714-d5aa996d28e9.jpg) 5 | ![s2](https://user-images.githubusercontent.com/64016811/153739551-a38b27f9-d7ae-4836-b9fe-4f28c1c01321.jpg) 6 | -------------------------------------------------------------------------------- /db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/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 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Memer.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /media/myimage/1.jfif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/media/myimage/1.jfif -------------------------------------------------------------------------------- /media/myimage/2.jfif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/media/myimage/2.jfif -------------------------------------------------------------------------------- /media/myimage/3.jfif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/media/myimage/3.jfif -------------------------------------------------------------------------------- /media/myimage/5.jfif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/media/myimage/5.jfif -------------------------------------------------------------------------------- /media/myimage/7.jfif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/media/myimage/7.jfif -------------------------------------------------------------------------------- /media/myimage/8.jfif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/media/myimage/8.jfif -------------------------------------------------------------------------------- /media/myimage/India.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/media/myimage/India.jpg -------------------------------------------------------------------------------- /media/myimage/plan.jfif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/media/myimage/plan.jfif -------------------------------------------------------------------------------- /media/myimage/plan_KmMEtzz.jfif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/media/myimage/plan_KmMEtzz.jfif -------------------------------------------------------------------------------- /media/myimage/plan_SbEfWsV.jfif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/media/myimage/plan_SbEfWsV.jfif -------------------------------------------------------------------------------- /media/myimage/plan_nVsJtAE.jfif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/media/myimage/plan_nVsJtAE.jfif -------------------------------------------------------------------------------- /media/myimage/plan_rlgR58O.jfif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/media/myimage/plan_rlgR58O.jfif -------------------------------------------------------------------------------- /myapp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/myapp/__init__.py -------------------------------------------------------------------------------- /myapp/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/myapp/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /myapp/__pycache__/admin.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/myapp/__pycache__/admin.cpython-310.pyc -------------------------------------------------------------------------------- /myapp/__pycache__/apps.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/myapp/__pycache__/apps.cpython-310.pyc -------------------------------------------------------------------------------- /myapp/__pycache__/forms.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/myapp/__pycache__/forms.cpython-310.pyc -------------------------------------------------------------------------------- /myapp/__pycache__/models.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/myapp/__pycache__/models.cpython-310.pyc -------------------------------------------------------------------------------- /myapp/__pycache__/views.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/myapp/__pycache__/views.cpython-310.pyc -------------------------------------------------------------------------------- /myapp/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import Image 3 | # Register your models here. 4 | @admin.register(Image) 5 | 6 | class ImageAdmin(admin.ModelAdmin): 7 | list_display = ['id','photo','date'] 8 | 9 | -------------------------------------------------------------------------------- /myapp/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class MyappConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'myapp' 7 | -------------------------------------------------------------------------------- /myapp/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | from . models import Image 3 | 4 | class ImageForm(forms.ModelForm): 5 | class Meta: 6 | model = Image 7 | fields = '__all__' 8 | labels = {'photo':''} -------------------------------------------------------------------------------- /myapp/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 4.0.2 on 2022-02-11 03:31 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='Image', 16 | fields=[ 17 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 18 | ('photo', models.ImageField(upload_to='myimage')), 19 | ('date', models.DateTimeField(auto_now_add=True)), 20 | ], 21 | ), 22 | ] 23 | -------------------------------------------------------------------------------- /myapp/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/myapp/migrations/__init__.py -------------------------------------------------------------------------------- /myapp/migrations/__pycache__/0001_initial.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/myapp/migrations/__pycache__/0001_initial.cpython-310.pyc -------------------------------------------------------------------------------- /myapp/migrations/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/myapp/migrations/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /myapp/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | class Image(models.Model): 4 | photo = models.ImageField(upload_to='myimage') 5 | date = models.DateTimeField(auto_now_add=True) 6 | 7 | -------------------------------------------------------------------------------- /myapp/templates/myapp/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Meme-Book 12 | 13 | 14 |

Meme-Book

15 |
16 |
17 |

Upload Image

18 |
19 | {% csrf_token %} 20 | {{form}} 21 | 22 |
23 |
24 |
25 | {% for x in img %} 26 |
27 |
28 | 29 | 32 |
33 |
34 | 35 | {% endfor %} 36 |
37 |
38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /myapp/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /myapp/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | from .forms import ImageForm 3 | from .models import Image 4 | # Create your views here. 5 | def home(request): 6 | if request.method == "POST": 7 | form = ImageForm(request.POST, request.FILES) 8 | if form.is_valid(): 9 | form.save() 10 | form = ImageForm() 11 | img = Image.objects.all() 12 | return render(request,'myapp/home.html',{'img':img,'form':form}) -------------------------------------------------------------------------------- /myimage/lion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/myimage/lion.png -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MainakRepositor/Meme-Book/3617fd3b5e7357f1953d5a2ae8bc9625ee38b6d0/requirements.txt --------------------------------------------------------------------------------