Skip to content

Commit

Permalink
initialized the project
Browse files Browse the repository at this point in the history
  • Loading branch information
shaheenhyderk committed Jan 19, 2023
0 parents commit 62bff75
Show file tree
Hide file tree
Showing 24 changed files with 350 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

.DS_Store
._*
# Django #
*.log
*.pot
*.pyc
__pycache__/
*/__pycache__/
*/*/__pycache__/

migrations/*.py
*/migrations/*.py
*/*/migrations/*.py

!migrations/__init__.py
!*/migrations/__init__.py
!*/*/migrations/__init__.py

media/

# Environments #
.env
.venv
env/
venv/
.vscode
.idea
Empty file added README.md
Empty file.
Empty file added api/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions api/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions api/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class ApiConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'api'
Empty file added api/migrations/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions api/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
3 changes: 3 additions & 0 deletions api/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
8 changes: 8 additions & 0 deletions api/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.urls import path

from . import views

# app_name will help us do a reverse look-up latter.
urlpatterns = [
path('', views.ArticleView.as_view()),
]
9 changes: 9 additions & 0 deletions api/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework import status


class ArticleView(APIView):
def get(self, request):
print("sdf")
return Response(data={"data": "Hello Mulearn"}, status=status.HTTP_200_OK)
22 changes: 22 additions & 0 deletions manage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys


def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mulearnbackend.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)


if __name__ == '__main__':
main()
Empty file added mulearnbackend/__init__.py
Empty file.
16 changes: 16 additions & 0 deletions mulearnbackend/asgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
ASGI config for mulearnbackend project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.1/howto/deployment/asgi/
"""

import os

from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mulearnbackend.settings')

application = get_asgi_application()
126 changes: 126 additions & 0 deletions mulearnbackend/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
"""
Django settings for mulearnbackend project.
Generated by 'django-admin startproject' using Django 4.1.5.
For more information on this file, see
https://docs.djangoproject.com/en/4.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.1/ref/settings/
"""

from pathlib import Path
from decouple import config

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = config('SECRET_KEY')

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = config('DEBUG', default=False, cast=bool)

ALLOWED_HOSTS = []

# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
# custom apps
'utils.apps.UtilsConfig',
'api.apps.ApiConfig',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'mulearnbackend.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'mulearnbackend.wsgi.application'

# Database
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': config('DATABASE_ENGINE'),
'NAME': config('DATABASE_NAME'),
'USER': config('DATABASE_USER'),
'PASSWORD': config('DATABASE_PASSWORD'),
'HOST': config('DATABASE_HOST'),
'PORT': config('DATABASE_PORT')
}
}

# Password validation
# https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]

# Internationalization
# https://docs.djangoproject.com/en/4.1/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_TZ = True

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.1/howto/static-files/

STATIC_URL = 'static/'

# Default primary key field type
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
22 changes: 22 additions & 0 deletions mulearnbackend/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""mulearnbackend URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include

urlpatterns = [
path('admin/', admin.site.urls),
path('api/', include('api.urls')),
]
16 changes: 16 additions & 0 deletions mulearnbackend/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
WSGI config for mulearnbackend project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.1/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mulearnbackend.settings')

application = get_wsgi_application()
70 changes: 70 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
altgraph==0.17.2
asgiref==3.6.0
async-generator==1.10
attrs==22.2.0
Babel==2.10.3
beautifulsoup4==4.11.1
certifi==2022.12.7
cffi==1.15.1
charset-normalizer==2.1.1
click==8.1.3
colorama==0.4.5
configparser==5.3.0
crayons==0.4.0
Django==4.1.5
djangorestframework==3.14.0
exceptiongroup==1.1.0
Flask==2.1.3
future==0.18.2
h11==0.14.0
idna==3.4
itsdangerous==2.1.2
Jinja2==3.1.2
joblib==1.1.0
MarkupSafe==2.1.1
MouseInfo==0.1.3
numpy==1.22.4
outcome==1.2.0
packaging==22.0
pandas==1.4.3
pefile==2022.5.30
Pillow==9.3.0
psycopg2==2.9.5
PyAutoGUI==0.9.53
pycparser==2.21
PyGetWindow==0.0.9
pyinstaller==5.1
pyinstaller-hooks-contrib==2022.7
PyMsgBox==1.0.9
pyperclip==1.8.2
PyRect==0.2.0
PyScreeze==0.1.28
PySocks==1.7.1
python-dateutil==2.8.2
python-decouple==3.7
python-dotenv==0.21.0
pytweening==1.0.4
pytz==2022.1
pywhatkit==5.4
pywin32-ctypes==0.2.0
requests==2.28.1
scikit-learn==1.1.1
scipy==1.8.1
selenium==3.141.0
six==1.16.0
sklearn==0.0
sniffio==1.3.0
sortedcontainers==2.4.0
soupsieve==2.3.2.post1
sqlparse==0.4.3
threadpoolctl==3.1.0
tkcalendar==1.6.1
tqdm==4.64.1
trio==0.22.0
trio-websocket==0.9.2
tzdata==2022.7
urllib3==1.26.13
webdriver-manager==3.4.2
Werkzeug==2.1.2
wikipedia==1.4.0
wsproto==1.2.0
Empty file added utils/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions utils/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions utils/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class UtilsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'utils'
Empty file added utils/migrations/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions utils/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
3 changes: 3 additions & 0 deletions utils/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
3 changes: 3 additions & 0 deletions utils/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.shortcuts import render

# Create your views here.

0 comments on commit 62bff75

Please sign in to comment.