├── 267d7ea4-66e9-47a8-8412-97d869dea9e5.zip ├── accounts ├── __init__.py ├── admin.py ├── apps.py ├── migrations │ └── __init__.py ├── models.py ├── tests.py └── views.py ├── db.sqlite3 ├── fileupload ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-39.pyc │ ├── settings.cpython-39.pyc │ ├── urls.cpython-39.pyc │ └── wsgi.cpython-39.pyc ├── asgi.py ├── settings.py ├── urls.py └── wsgi.py ├── home ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-39.pyc │ ├── admin.cpython-39.pyc │ ├── apps.cpython-39.pyc │ ├── models.cpython-39.pyc │ ├── serializers.cpython-39.pyc │ └── views.cpython-39.pyc ├── admin.py ├── apps.py ├── migrations │ ├── 0001_initial.py │ ├── 0002_alter_files_file.py │ ├── __init__.py │ └── __pycache__ │ │ ├── 0001_initial.cpython-39.pyc │ │ ├── 0002_alter_files_file.cpython-39.pyc │ │ └── __init__.cpython-39.pyc ├── models.py ├── serializers.py ├── templates │ ├── download.html │ └── home.html ├── tests.py └── views.py ├── htmls ├── download.html ├── download.svg ├── home.html ├── main.py └── undraw.svg ├── manage.py └── public └── static ├── 05194a9c-7611-468e-b69a-a2584981887b └── pexels-maria-borisenko-10162332.jpg ├── 14eadcf3-c8d0-4bb8-aa36-cf0d3789106a └── pexels-maria-borisenko-10162332.jpg ├── 223d6db7-e7ff-4928-bf42-a5efc678ab38 └── pexels-maria-borisenko-10162332.jpg ├── bade15c9-cb7a-4c80-9783-e800e0dbb1ba ├── pexels-camille-robinson-10822212.jpg ├── pexels-maria-borisenko-10162332.jpg └── top_backend_framework_in_2022.png ├── c6dc1c22-0b45-4573-83da-ab911a706111 ├── pexels-camille-robinson-10822212.jpg ├── pexels-maria-borisenko-10162332.jpg └── top_backend_framework_in_2022.png ├── c9a04b5c-2f27-49aa-bffd-1ecfff7a50e6 └── pexels-maria-borisenko-10162332.jpg ├── dadb9253-91af-4705-a5b1-2c4a86136fcb ├── pexels-camille-robinson-10822212.jpg └── pexels-maria-borisenko-10162332.jpg ├── dc571dcb-6770-4d5f-aa51-e51ef8d167da ├── WhatsApp_Image_2022-01-30_at_9.25.37_PM.jpeg └── yt1s.com_-_Inspiring_Emotional_Corporate_by_Infrac_kywTp00.webm ├── image ├── download.html ├── download.svg └── undraw.svg └── zip ├── 05194a9c-7611-468e-b69a-a2584981887b.zip ├── 14eadcf3-c8d0-4bb8-aa36-cf0d3789106a.zip ├── 223d6db7-e7ff-4928-bf42-a5efc678ab38.zip ├── bade15c9-cb7a-4c80-9783-e800e0dbb1ba.zip ├── c6dc1c22-0b45-4573-83da-ab911a706111.zip ├── c9a04b5c-2f27-49aa-bffd-1ecfff7a50e6.zip ├── dadb9253-91af-4705-a5b1-2c4a86136fcb.zip └── dc571dcb-6770-4d5f-aa51-e51ef8d167da.zip /267d7ea4-66e9-47a8-8412-97d869dea9e5.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/267d7ea4-66e9-47a8-8412-97d869dea9e5.zip -------------------------------------------------------------------------------- /accounts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/accounts/__init__.py -------------------------------------------------------------------------------- /accounts/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /accounts/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AccountsConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'accounts' 7 | -------------------------------------------------------------------------------- /accounts/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/accounts/migrations/__init__.py -------------------------------------------------------------------------------- /accounts/models.py: -------------------------------------------------------------------------------- 1 | import imp 2 | from django.db import models 3 | from django.auth.models import Ab 4 | 5 | class User() -------------------------------------------------------------------------------- /accounts/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /accounts/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/db.sqlite3 -------------------------------------------------------------------------------- /fileupload/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/fileupload/__init__.py -------------------------------------------------------------------------------- /fileupload/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/fileupload/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /fileupload/__pycache__/settings.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/fileupload/__pycache__/settings.cpython-39.pyc -------------------------------------------------------------------------------- /fileupload/__pycache__/urls.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/fileupload/__pycache__/urls.cpython-39.pyc -------------------------------------------------------------------------------- /fileupload/__pycache__/wsgi.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/fileupload/__pycache__/wsgi.cpython-39.pyc -------------------------------------------------------------------------------- /fileupload/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for fileupload 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.2/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', 'fileupload.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /fileupload/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for fileupload project. 3 | 4 | Generated by 'django-admin startproject' using Django 3.2.9. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.2/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/3.2/ref/settings/ 11 | """ 12 | 13 | from pathlib import Path 14 | 15 | # Build paths inside the project like this: BASE_DIR / 'subdir'. 16 | BASE_DIR = Path(__file__).resolve().parent.parent 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = 'django-insecure-7mrmmq#aw(z4@@ux9@!z^@2n&#!_&*&npnmrse5$i9!@d6r_3y' 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 | 'home', 42 | 43 | ] 44 | 45 | MIDDLEWARE = [ 46 | 'django.middleware.security.SecurityMiddleware', 47 | 'django.contrib.sessions.middleware.SessionMiddleware', 48 | 'django.middleware.common.CommonMiddleware', 49 | 'django.middleware.csrf.CsrfViewMiddleware', 50 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 51 | 'django.contrib.messages.middleware.MessageMiddleware', 52 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 53 | ] 54 | 55 | ROOT_URLCONF = 'fileupload.urls' 56 | 57 | TEMPLATES = [ 58 | { 59 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 60 | 'DIRS': [], 61 | 'APP_DIRS': True, 62 | 'OPTIONS': { 63 | 'context_processors': [ 64 | 'django.template.context_processors.debug', 65 | 'django.template.context_processors.request', 66 | 'django.contrib.auth.context_processors.auth', 67 | 'django.contrib.messages.context_processors.messages', 68 | ], 69 | }, 70 | }, 71 | ] 72 | 73 | WSGI_APPLICATION = 'fileupload.wsgi.application' 74 | 75 | 76 | # Database 77 | # https://docs.djangoproject.com/en/3.2/ref/settings/#databases 78 | 79 | DATABASES = { 80 | 'default': { 81 | 'ENGINE': 'django.db.backends.sqlite3', 82 | 'NAME': BASE_DIR / 'db.sqlite3', 83 | } 84 | } 85 | 86 | 87 | # Password validation 88 | # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators 89 | 90 | AUTH_PASSWORD_VALIDATORS = [ 91 | { 92 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 93 | }, 94 | { 95 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 96 | }, 97 | { 98 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 99 | }, 100 | { 101 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 102 | }, 103 | ] 104 | 105 | 106 | # Internationalization 107 | # https://docs.djangoproject.com/en/3.2/topics/i18n/ 108 | 109 | LANGUAGE_CODE = 'en-us' 110 | 111 | TIME_ZONE = 'UTC' 112 | 113 | USE_I18N = True 114 | 115 | USE_L10N = True 116 | 117 | USE_TZ = True 118 | 119 | 120 | # Static files (CSS, JavaScript, Images) 121 | # https://docs.djangoproject.com/en/3.2/howto/static-files/ 122 | 123 | STATIC_URL = '/static/' 124 | 125 | # Default primary key field type 126 | # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field 127 | 128 | DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' 129 | import os 130 | 131 | STATIC_ROOT = 'staticfiles' 132 | STATIC_URL = '/static/' 133 | STATIC_ROOT = os.path.join(BASE_DIR,'staticfiles') 134 | 135 | STATICFILES_DIR = { 136 | os.path.join(BASE_DIR , "public/static") 137 | } 138 | 139 | MEDIA_ROOT = os.path.join(BASE_DIR, 'public/static') 140 | MEDIA_URL = '/media/' -------------------------------------------------------------------------------- /fileupload/urls.py: -------------------------------------------------------------------------------- 1 | """fileupload URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.2/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 18 | from django.conf.urls.static import static 19 | from django.conf import settings 20 | from django.contrib.staticfiles.urls import staticfiles_urlpatterns 21 | from home.views import * 22 | 23 | urlpatterns = [ 24 | path('' , home), 25 | path('download//' ,download), 26 | path('handle/', HandleFileUpload.as_view()), 27 | 28 | path('admin/', admin.site.urls), 29 | ] 30 | 31 | 32 | 33 | if settings.DEBUG: 34 | urlpatterns += static(settings.MEDIA_URL, 35 | document_root=settings.MEDIA_ROOT) 36 | 37 | 38 | urlpatterns += staticfiles_urlpatterns() -------------------------------------------------------------------------------- /fileupload/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for fileupload 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.2/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', 'fileupload.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /home/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/home/__init__.py -------------------------------------------------------------------------------- /home/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/home/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /home/__pycache__/admin.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/home/__pycache__/admin.cpython-39.pyc -------------------------------------------------------------------------------- /home/__pycache__/apps.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/home/__pycache__/apps.cpython-39.pyc -------------------------------------------------------------------------------- /home/__pycache__/models.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/home/__pycache__/models.cpython-39.pyc -------------------------------------------------------------------------------- /home/__pycache__/serializers.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/home/__pycache__/serializers.cpython-39.pyc -------------------------------------------------------------------------------- /home/__pycache__/views.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/home/__pycache__/views.cpython-39.pyc -------------------------------------------------------------------------------- /home/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | from .models import Folder,Files 5 | 6 | 7 | admin.site.register(Files) 8 | admin.site.register(Folder) 9 | -------------------------------------------------------------------------------- /home/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class HomeConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'home' 7 | -------------------------------------------------------------------------------- /home/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.9 on 2022-02-07 09:43 2 | 3 | from django.db import migrations, models 4 | import django.db.models.deletion 5 | import uuid 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | initial = True 11 | 12 | dependencies = [ 13 | ] 14 | 15 | operations = [ 16 | migrations.CreateModel( 17 | name='Folder', 18 | fields=[ 19 | ('uid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), 20 | ('created_at', models.DateField(auto_now=True)), 21 | ], 22 | ), 23 | migrations.CreateModel( 24 | name='Files', 25 | fields=[ 26 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 27 | ('file', models.FileField(upload_to='')), 28 | ('created_at', models.DateField(auto_now=True)), 29 | ('folder', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='home.folder')), 30 | ], 31 | ), 32 | ] 33 | -------------------------------------------------------------------------------- /home/migrations/0002_alter_files_file.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.9 on 2022-02-07 09:47 2 | 3 | from django.db import migrations, models 4 | import home.models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('home', '0001_initial'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AlterField( 15 | model_name='files', 16 | name='file', 17 | field=models.FileField(upload_to=home.models.get_upload_path), 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /home/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/home/migrations/__init__.py -------------------------------------------------------------------------------- /home/migrations/__pycache__/0001_initial.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/home/migrations/__pycache__/0001_initial.cpython-39.pyc -------------------------------------------------------------------------------- /home/migrations/__pycache__/0002_alter_files_file.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/home/migrations/__pycache__/0002_alter_files_file.cpython-39.pyc -------------------------------------------------------------------------------- /home/migrations/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/home/migrations/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /home/models.py: -------------------------------------------------------------------------------- 1 | from pyexpat import model 2 | from statistics import mode 3 | from uuid import uuid4 4 | from django.db import models 5 | import uuid 6 | import os 7 | 8 | class Folder(models.Model): 9 | uid = models.UUIDField(primary_key= True , editable= False , default=uuid.uuid4) 10 | created_at = models.DateField(auto_now= True) 11 | 12 | 13 | def get_upload_path(instance , filename): 14 | return os.path.join(str(instance.folder.uid) , filename) 15 | 16 | 17 | class Files(models.Model): 18 | folder = models.ForeignKey(Folder , on_delete=models.CASCADE) 19 | file = models.FileField(upload_to=get_upload_path) 20 | created_at = models.DateField(auto_now= True) 21 | -------------------------------------------------------------------------------- /home/serializers.py: -------------------------------------------------------------------------------- 1 | import shutil 2 | from numpy import require 3 | from rest_framework import serializers 4 | from .models import * 5 | 6 | 7 | class FileSerializer(serializers.ModelSerializer): 8 | 9 | class Meta: 10 | model = Files 11 | fields = '__all__' 12 | 13 | class FileListSerializer(serializers.Serializer): 14 | files = serializers.ListField( 15 | child = serializers.FileField(max_length = 100000 , allow_empty_file = False , use_url = False) 16 | ) 17 | folder = serializers.CharField(required = False) 18 | 19 | def zip_files(self,folder): 20 | shutil.make_archive(f'public/static/zip/{folder}' , 'zip' ,f'public/static/{folder}' ) 21 | 22 | def create(self , validated_data): 23 | folder = Folder.objects.create() 24 | files = validated_data.pop('files') 25 | files_objs = [] 26 | for file in files: 27 | files_obj = Files.objects.create(folder = folder , file = file) 28 | files_objs.append(files_obj) 29 | 30 | 31 | self.zip_files(folder.uid) 32 | 33 | 34 | return {'files' : {} , 'folder' : str(folder.uid)} -------------------------------------------------------------------------------- /home/templates/download.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Document 9 | 11 | 12 | 13 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 88 | 89 | 90 | 91 | 92 | 93 |
94 | 95 | 96 |
97 | 98 | 99 |
100 |
101 | 102 | 103 |
104 |
105 | Download Files 106 |

Have you already clicked?

107 |
108 |
109 | 110 |
111 |
112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /home/templates/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Document 9 | 11 | 12 | 13 | 83 | 84 | 85 | 86 | 87 | 89 | 90 | 93 | 94 | 95 | 96 | 97 | 98 |
99 | 100 | 101 |
102 | 103 | 104 | 105 |
106 | 107 |
108 | 109 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 182 | 183 | 184 | 185 | -------------------------------------------------------------------------------- /home/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /home/views.py: -------------------------------------------------------------------------------- 1 | from tkinter import E 2 | from django.shortcuts import render 3 | from rest_framework.views import APIView 4 | from rest_framework.response import Response 5 | 6 | from .serializers import * 7 | from rest_framework.parsers import MultiPartParser 8 | 9 | 10 | def home(request): 11 | return render(request ,'home.html') 12 | 13 | 14 | 15 | def download(request , uid): 16 | return render(request , 'download.html' , context = {'uid' : uid}) 17 | 18 | class HandleFileUpload(APIView): 19 | parser_classes = [MultiPartParser] 20 | def post(self , request): 21 | try: 22 | data = request.data 23 | 24 | serializer = FileListSerializer(data = data) 25 | 26 | if serializer.is_valid(): 27 | serializer.save() 28 | return Response({ 29 | 'status' : 200, 30 | 'message' : 'files uploaded successfully', 31 | 'data' : serializer.data 32 | }) 33 | 34 | return Response({ 35 | 'status' : 400, 36 | 'message' : 'somethign went wrong', 37 | 'data' : serializer.errors 38 | }) 39 | except Exception as e: 40 | print(e) 41 | -------------------------------------------------------------------------------- /htmls/download.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Document 9 | 11 | 12 | 13 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 88 | 89 | 90 | 91 | 92 | 93 |
94 | 95 | 96 |
97 | 98 | 99 |
100 |
101 | 102 | 103 |
104 |
105 | 106 |

Have you already clicked?

107 |
108 |
109 | 110 |
111 |
112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /htmls/download.svg: -------------------------------------------------------------------------------- 1 | cloud_files -------------------------------------------------------------------------------- /htmls/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Document 9 | 11 | 12 | 13 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 88 | 89 | 90 | 91 | 92 | 93 |
94 | 95 | 96 |
97 | 98 | 99 | 100 |
101 | 102 |
103 | 104 |
105 |
106 | 107 | 108 |
109 |
110 | 111 |

Have you already clicked?

112 |
113 |
114 | 115 |
116 |
117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 136 | 137 | 138 | 139 | -------------------------------------------------------------------------------- /htmls/main.py: -------------------------------------------------------------------------------- 1 | import shutil 2 | 3 | shutil.make_archive('hello', 'zip', 'htmls') -------------------------------------------------------------------------------- /htmls/undraw.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /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', 'fileupload.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 | -------------------------------------------------------------------------------- /public/static/05194a9c-7611-468e-b69a-a2584981887b/pexels-maria-borisenko-10162332.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/public/static/05194a9c-7611-468e-b69a-a2584981887b/pexels-maria-borisenko-10162332.jpg -------------------------------------------------------------------------------- /public/static/14eadcf3-c8d0-4bb8-aa36-cf0d3789106a/pexels-maria-borisenko-10162332.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/public/static/14eadcf3-c8d0-4bb8-aa36-cf0d3789106a/pexels-maria-borisenko-10162332.jpg -------------------------------------------------------------------------------- /public/static/223d6db7-e7ff-4928-bf42-a5efc678ab38/pexels-maria-borisenko-10162332.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/public/static/223d6db7-e7ff-4928-bf42-a5efc678ab38/pexels-maria-borisenko-10162332.jpg -------------------------------------------------------------------------------- /public/static/bade15c9-cb7a-4c80-9783-e800e0dbb1ba/pexels-camille-robinson-10822212.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/public/static/bade15c9-cb7a-4c80-9783-e800e0dbb1ba/pexels-camille-robinson-10822212.jpg -------------------------------------------------------------------------------- /public/static/bade15c9-cb7a-4c80-9783-e800e0dbb1ba/pexels-maria-borisenko-10162332.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/public/static/bade15c9-cb7a-4c80-9783-e800e0dbb1ba/pexels-maria-borisenko-10162332.jpg -------------------------------------------------------------------------------- /public/static/bade15c9-cb7a-4c80-9783-e800e0dbb1ba/top_backend_framework_in_2022.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/public/static/bade15c9-cb7a-4c80-9783-e800e0dbb1ba/top_backend_framework_in_2022.png -------------------------------------------------------------------------------- /public/static/c6dc1c22-0b45-4573-83da-ab911a706111/pexels-camille-robinson-10822212.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/public/static/c6dc1c22-0b45-4573-83da-ab911a706111/pexels-camille-robinson-10822212.jpg -------------------------------------------------------------------------------- /public/static/c6dc1c22-0b45-4573-83da-ab911a706111/pexels-maria-borisenko-10162332.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/public/static/c6dc1c22-0b45-4573-83da-ab911a706111/pexels-maria-borisenko-10162332.jpg -------------------------------------------------------------------------------- /public/static/c6dc1c22-0b45-4573-83da-ab911a706111/top_backend_framework_in_2022.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/public/static/c6dc1c22-0b45-4573-83da-ab911a706111/top_backend_framework_in_2022.png -------------------------------------------------------------------------------- /public/static/c9a04b5c-2f27-49aa-bffd-1ecfff7a50e6/pexels-maria-borisenko-10162332.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/public/static/c9a04b5c-2f27-49aa-bffd-1ecfff7a50e6/pexels-maria-borisenko-10162332.jpg -------------------------------------------------------------------------------- /public/static/dadb9253-91af-4705-a5b1-2c4a86136fcb/pexels-camille-robinson-10822212.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/public/static/dadb9253-91af-4705-a5b1-2c4a86136fcb/pexels-camille-robinson-10822212.jpg -------------------------------------------------------------------------------- /public/static/dadb9253-91af-4705-a5b1-2c4a86136fcb/pexels-maria-borisenko-10162332.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/public/static/dadb9253-91af-4705-a5b1-2c4a86136fcb/pexels-maria-borisenko-10162332.jpg -------------------------------------------------------------------------------- /public/static/dc571dcb-6770-4d5f-aa51-e51ef8d167da/WhatsApp_Image_2022-01-30_at_9.25.37_PM.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/public/static/dc571dcb-6770-4d5f-aa51-e51ef8d167da/WhatsApp_Image_2022-01-30_at_9.25.37_PM.jpeg -------------------------------------------------------------------------------- /public/static/dc571dcb-6770-4d5f-aa51-e51ef8d167da/yt1s.com_-_Inspiring_Emotional_Corporate_by_Infrac_kywTp00.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/public/static/dc571dcb-6770-4d5f-aa51-e51ef8d167da/yt1s.com_-_Inspiring_Emotional_Corporate_by_Infrac_kywTp00.webm -------------------------------------------------------------------------------- /public/static/image/download.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Document 9 | 11 | 12 | 13 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 88 | 89 | 90 | 91 | 92 | 93 |
94 | 95 | 96 |
97 | 98 | 99 |
100 |
101 | 102 | 103 |
104 |
105 | 106 |

Have you already clicked?

107 |
108 |
109 | 110 |
111 |
112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /public/static/image/download.svg: -------------------------------------------------------------------------------- 1 | cloud_files -------------------------------------------------------------------------------- /public/static/image/undraw.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/static/zip/05194a9c-7611-468e-b69a-a2584981887b.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/public/static/zip/05194a9c-7611-468e-b69a-a2584981887b.zip -------------------------------------------------------------------------------- /public/static/zip/14eadcf3-c8d0-4bb8-aa36-cf0d3789106a.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/public/static/zip/14eadcf3-c8d0-4bb8-aa36-cf0d3789106a.zip -------------------------------------------------------------------------------- /public/static/zip/223d6db7-e7ff-4928-bf42-a5efc678ab38.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/public/static/zip/223d6db7-e7ff-4928-bf42-a5efc678ab38.zip -------------------------------------------------------------------------------- /public/static/zip/bade15c9-cb7a-4c80-9783-e800e0dbb1ba.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/public/static/zip/bade15c9-cb7a-4c80-9783-e800e0dbb1ba.zip -------------------------------------------------------------------------------- /public/static/zip/c6dc1c22-0b45-4573-83da-ab911a706111.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/public/static/zip/c6dc1c22-0b45-4573-83da-ab911a706111.zip -------------------------------------------------------------------------------- /public/static/zip/c9a04b5c-2f27-49aa-bffd-1ecfff7a50e6.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/public/static/zip/c9a04b5c-2f27-49aa-bffd-1ecfff7a50e6.zip -------------------------------------------------------------------------------- /public/static/zip/dadb9253-91af-4705-a5b1-2c4a86136fcb.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/public/static/zip/dadb9253-91af-4705-a5b1-2c4a86136fcb.zip -------------------------------------------------------------------------------- /public/static/zip/dc571dcb-6770-4d5f-aa51-e51ef8d167da.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boxabhi/file-sharing-app-django-websocket/94e91c5550cccce681a9387c5ea78df95a8d4e42/public/static/zip/dc571dcb-6770-4d5f-aa51-e51ef8d167da.zip --------------------------------------------------------------------------------