Skip to content

Commit dd66a94

Browse files
author
mohammad masoumi
committed
add 14 15 resources
1 parent 4cc7a8a commit dd66a94

1,176 files changed

Lines changed: 92907 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

resource/14/README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# django-tutorial
2+
3+
This project is an open-source project which I made due to sharing my experience around the Django framework.
4+
5+
## What is Django?
6+
7+
Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. Built by experienced developers, it takes care of much of the hassle of web development, so you can focus on writing your app without needing to reinvent the wheel. It’s free and open source.
8+
9+
- Ridiculously fast.
10+
- Reassuringly secure.
11+
- Exceedingly scalable.
12+
13+
## What you will learn?
14+
15+
- Install Django
16+
- Django project
17+
- Django application
18+
- Setup virtual env
19+
- Django Settings
20+
- Django Models
21+
- Django URLs
22+
- Django Views
23+
- Django Forms
24+
- Django Authentication
25+
- Django Middleware
26+
- Django Admin
27+
- Django Internationalization
28+
- Django Security
29+
- Django tempalte
30+
- Django rest-framework (DRF)
31+
- DRF Routers
32+
- DRF Serializers
33+
- DRF ViewSets
34+
- DRF Permissions
35+
- DRF Authentication
36+
- Nginx Webserver
37+
- Dockerize project
38+
- Django + Celery Integration
39+
- Celery Task
40+
- Celery Periodic Task
41+
- Sentry Integration
42+
- Logging
43+
- Databases
44+
- Database Design
45+
- PostgreSQL
46+
- MongoDB
47+
48+
## Tutorial
49+
50+
- [01-introduction](https://github.com/mohammadmasoumi/django-tutorial/tree/master/tutorials/01-introduction)
51+
- [02-create-app](https://github.com/mohammadmasoumi/django-tutorial/tree/master/tutorials/02-create-app)

resource/14/commands/sqlite3.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
pip install ipython
2+
python manage.py shell
3+
4+
from store.customer import Customer
5+
Customer.objects.create(..data)
6+
Customer.objects.all()
7+
Customer.objects.filter(name="ali").values_list("last_name", )
8+
Customer.objects.delete(name="ali")
9+
10+
# https://sqlite.org/download.html
11+
# sqlite-tools-win32-x86-3380000.zip
12+
# https://sqlite.org/2022/sqlite-tools-win32-x86-3380000.zip
13+
# .open FILE_NAME
14+
# .databases
15+
# .tables
16+
# .help

resource/14/commands/superuser.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# python manage.py makemigrations
2+
# python manage.py migrate
3+
# python manage.py createsuperuser
4+
# email
5+
# password
6+
# paasword
7+
#

resource/14/commands/vscode.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

resource/14/homework/01/01.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
تمرین اول:
2+
3+
سعی کنید یک محیط مجازی بر روی سیستم خود درست کنید و سپس پروژه جنگو onlineshop را بر روی سیستم خود بسازید.
4+
5+
پروژه خود را بر روی گیت پوش کنید و لینک پروژه رو در گروه بفرستید.

resource/14/old-onlineshop/Pipfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
8+
[dev-packages]
9+
10+
[requires]
11+
python_version = "3.9"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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', 'onlineshop.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()

resource/14/old-onlineshop/onlineshop/__init__.py

Whitespace-only changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
ASGI config for onlineshop 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', 'onlineshop.settings')
15+
16+
application = get_asgi_application()
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
"""
2+
Django settings for onlineshop project.
3+
4+
Generated by 'django-admin startproject' using Django 4.0.2.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/4.0/topics/settings/
8+
9+
For the full list of settings and their values, see
10+
https://docs.djangoproject.com/en/4.0/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/4.0/howto/deployment/checklist/
21+
22+
# SECURITY WARNING: keep the secret key used in production secret!
23+
SECRET_KEY = 'django-insecure-2fazirtxo5o2(8spkwl32!803*plzwd3d@&)!$u$rf+z-=j=^j'
24+
25+
# SECURITY WARNING: don't run with debug turned on in production!
26+
DEBUG = True
27+
28+
ALLOWED_HOSTS = []
29+
INTERNAL_IPS = ('127.0.0.1',)
30+
31+
# Application definition
32+
33+
INSTALLED_APPS = [
34+
'django.contrib.admin',
35+
'django.contrib.auth',
36+
'django.contrib.sessions',
37+
'django.contrib.contenttypes',
38+
'django.contrib.messages',
39+
'django.contrib.staticfiles',
40+
'debug_toolbar',
41+
'playground',
42+
'store',
43+
'tags'
44+
]
45+
46+
47+
MIDDLEWARE = [
48+
'debug_toolbar.middleware.DebugToolbarMiddleware',
49+
'django.middleware.security.SecurityMiddleware',
50+
'django.contrib.sessions.middleware.SessionMiddleware',
51+
'django.middleware.common.CommonMiddleware',
52+
'django.middleware.csrf.CsrfViewMiddleware',
53+
'django.contrib.auth.middleware.AuthenticationMiddleware',
54+
'django.contrib.messages.middleware.MessageMiddleware',
55+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
56+
]
57+
58+
ROOT_URLCONF = 'onlineshop.urls'
59+
60+
TEMPLATES = [
61+
{
62+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
63+
'DIRS': [],
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 = 'onlineshop.wsgi.application'
77+
78+
79+
# Database
80+
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
81+
82+
DATABASES = {
83+
'default': {
84+
'ENGINE': 'django.db.backends.sqlite3',
85+
'NAME': BASE_DIR / 'db.sqlite3',
86+
}
87+
}
88+
89+
90+
# Password validation
91+
# https://docs.djangoproject.com/en/4.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/4.0/topics/i18n/
111+
112+
LANGUAGE_CODE = 'en-us'
113+
114+
TIME_ZONE = 'UTC'
115+
116+
USE_I18N = True
117+
118+
USE_TZ = True
119+
120+
121+
# Static files (CSS, JavaScript, Images)
122+
# https://docs.djangoproject.com/en/4.0/howto/static-files/
123+
124+
STATIC_URL = 'static/'
125+
126+
# Default primary key field type
127+
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
128+
129+
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

0 commit comments

Comments
 (0)