From 1d6d68a32f571db76ccb7da0c2a4d02aa30cf6c6 Mon Sep 17 00:00:00 2001 From: ilvas Date: Mon, 4 Jan 2021 23:25:59 +0300 Subject: [PATCH] first commit --- .gitignore | 2 + .idea/.gitignore | 0 .idea/evgenApp.iml | 26 ++++ .../inspectionProfiles/profiles_settings.xml | 6 + .idea/misc.xml | 4 + .idea/modules.xml | 8 + .idea/workspace.xml | 70 +++++++++ evgen-app-ui | 1 + evgenApp/__init__.py | 0 evgenApp/__pycache__/__init__.cpython-36.pyc | Bin 0 -> 137 bytes evgenApp/__pycache__/schema.cpython-36.pyc | Bin 0 -> 395 bytes evgenApp/__pycache__/settings.cpython-36.pyc | Bin 0 -> 2520 bytes evgenApp/__pycache__/urls.cpython-36.pyc | Bin 0 -> 1417 bytes evgenApp/__pycache__/wsgi.cpython-36.pyc | Bin 0 -> 542 bytes evgenApp/schema.py | 8 + evgenApp/settings.py | 139 ++++++++++++++++++ evgenApp/urls.py | 33 +++++ evgenApp/wsgi.py | 16 ++ manage.py | 15 ++ users/__init__.py | 0 users/__pycache__/__init__.cpython-36.pyc | Bin 0 -> 134 bytes users/__pycache__/schema.cpython-36.pyc | Bin 0 -> 528 bytes users/admin.py | 3 + users/apps.py | 5 + users/migrations/__init__.py | 0 users/models.py | 3 + users/schema.py | 9 ++ users/tests.py | 3 + users/views.py | 3 + 29 files changed, 354 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/.gitignore create mode 100644 .idea/evgenApp.iml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/workspace.xml create mode 160000 evgen-app-ui create mode 100644 evgenApp/__init__.py create mode 100644 evgenApp/__pycache__/__init__.cpython-36.pyc create mode 100644 evgenApp/__pycache__/schema.cpython-36.pyc create mode 100644 evgenApp/__pycache__/settings.cpython-36.pyc create mode 100644 evgenApp/__pycache__/urls.cpython-36.pyc create mode 100644 evgenApp/__pycache__/wsgi.cpython-36.pyc create mode 100644 evgenApp/schema.py create mode 100644 evgenApp/settings.py create mode 100644 evgenApp/urls.py create mode 100644 evgenApp/wsgi.py create mode 100755 manage.py create mode 100644 users/__init__.py create mode 100644 users/__pycache__/__init__.cpython-36.pyc create mode 100644 users/__pycache__/schema.cpython-36.pyc create mode 100644 users/admin.py create mode 100644 users/apps.py create mode 100644 users/migrations/__init__.py create mode 100644 users/models.py create mode 100644 users/schema.py create mode 100644 users/tests.py create mode 100644 users/views.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..28626b1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/db.sqlite3 +/movies.json \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/.idea/evgenApp.iml b/.idea/evgenApp.iml new file mode 100644 index 0000000..6b89cd6 --- /dev/null +++ b/.idea/evgenApp.iml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..d1e22ec --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..f47e4bf --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..0d4a33c --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1609460506495 + + + + \ No newline at end of file diff --git a/evgen-app-ui b/evgen-app-ui new file mode 160000 index 0000000..4be809b --- /dev/null +++ b/evgen-app-ui @@ -0,0 +1 @@ +Subproject commit 4be809b3dbdfa14caf3adc6a5b5024a163ee3b8b diff --git a/evgenApp/__init__.py b/evgenApp/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/evgenApp/__pycache__/__init__.cpython-36.pyc b/evgenApp/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d6c5c28ca6c7bebf1eb6e84008fe18b3d49dd7e7 GIT binary patch literal 137 zcmXr!<>kssco)wA1dl-k3@`#24nSPY0whuxf*CX!{Z=v*frJsnFEjm&{M=Oi%$&?b z{nWDb)I8n9f&$&5)Eo%Uv7i9Kh>y?A%PfhH*DI*J#bJ}1pHiBWY6mi}7>F4FPL?3a literal 0 HcmV?d00001 diff --git a/evgenApp/__pycache__/schema.cpython-36.pyc b/evgenApp/__pycache__/schema.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6ef9f5399e3c9c3628abdeab244beec64b8e5280 GIT binary patch literal 395 zcmYLFu};G<5Is9_8b#^OFJx#lz`%e|nb?X@nY>sbJ~fS!)Qt&JW>^^b5O%)CD-$zY zC+t|zlkVMnvY+qH=ks~;IsAw>0Qj=`AI!3qO?_!Wf+P)aUkRtTAgK&qK?X?cpbimg z_7ZYeBMfEuPIw^61~T?--LNhl{spmQWmBgX5IB**>2#YKc0XW0uCu_zLUcuoLYPE| zb}xs<@l=SzP&EGJ1Nz85F~RX7ul6nGyJlD9_`Jn#Q7EA7^V^6I= zbh9`TlSya9u!9>To0)jq7plSzc{*t9_0n4no0N&XoNOk!d#tg1dKeX&Xfw4q&F9(7 Ub}{jlU+3C=gmxRmB&KKKFA5G}Bme*a literal 0 HcmV?d00001 diff --git a/evgenApp/__pycache__/settings.cpython-36.pyc b/evgenApp/__pycache__/settings.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0ffb747a4d8f974f16762f93c6c39aa0b5769d19 GIT binary patch literal 2520 zcmb7GS##P}6lReDw0n`_#VnEl)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{m$u z=wXI9>qDld_mzsDE8)8aL0Bp#X$mVCOj-_Zi~Gu+))r;?pw+2r zZ^U{Hg_ucDsEf_reQ{UPDy^!7ZfgxmQ(HJyxqaMjZR3aLh^lXtn?WYzDJoV#!AO-b zo8J?Z$9hJ~=O?9}Ym<^`nR+Q2^>rNabxN$!6aFtaCnm39VQ?DcezIK{TI9tXx?+F} zm&&E@XSp<&;xegZ{K}+rY2U;;j$sUn9rocE1yG;qbu_dnaD_6 literal 0 HcmV?d00001 diff --git a/evgenApp/__pycache__/urls.cpython-36.pyc b/evgenApp/__pycache__/urls.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ce745ab2a12ef65f313b0284988de26c5c43e1f1 GIT binary patch literal 1417 zcma)6OOM+&5EfyP(iA9)9(eN#*p=Gt&1ixKi{=3Y0h*>g=%Q%Fu`PoXWs*)d zxo(aP(7(~Yq-#$-_tsN~v=$W#6j%YIW=7=9H{ZK+c z=@Y4_kP2wsETt081#LN$8mIO3F|A%?8IzSx*`{n(vQ=^el}RfpGH9}k^y|#X zwytz$4`&!&XVDMWr9fYL5k1*8l|{D?>zsa*(#MR^vZ1wTr7{ajmr4pM-WMe%wl@yW zU-ai)%9y|)L%fQ~u21Llvp%o26mUkHQozHxmFG!x$xE%zuP`w-@cMr!q*;TqKvGB4 zEu3fQ%b~v`8hbu1bzz;HCjUY7ys7w()y)b?aPe$v6&CZBpXZJkicqjT_AHzxblFq6 z*weKyM`{Vb1=*iHbEMoE?G=}+3<2GJT+<7e0nuRyo5(SUlWfYk~cry|xNKK6|b?Oo#1A#Mie>xN*b z`!DnH8aS5;Q4{=t*GCGrzkBKcwZAViTiC4Tb(y(wILB(8E8u$#hvQ$tvXi#&JF@)J zhOzNHqGq^%n7D+p58=w@vE|w8gyegr-tx|0Z82_OJE`;T1X{)D79rbT2wo-E4(@)7 z(AI_D@lsr|@)1Q%dT7VU{rmjEaGl9sI?lQCI8%kh6alM zlWSIme>1Q9YG_IsR1$v>Qt8xINR5XM?Z`Tc^OOFPUgJboJEL71j;SutwSg|MTz1pG nr@Pr;3 zKSI88>ZKpRiAkc0Sn_zrGxOe?d3SV_HRWURGa=*;**huvpYZx)G?FZcOeEFGBEdJ+ zv`rUjLLg~+&4KL6gL{fmdQTRIlFrHS@a}i^Z9bW@%9^FB+0u3l)-{;1bIf(Nfhy!# zHVq7ZIP1Z)umZO05L%1x8kq1*u-3|J4I>R}&}=O_wM`k(f@EbWoYSfjL0MCli1!(3 zTH66r1{vFJf?0#$%Cn`?@RoUiY!!m@?>U#Y^0{n;sqK@d%C;N~Kgo~z%H9OaB{*$w zTQGs&_*(Jo0rx>>!z8}0ArzaxVoyeVbNXdGn_L$2v#YD=Y%(t{E>FLnpWVHB8b9|C zf-Jxi5WIZSc+>M;haBKda tpzId7(n|0x;|ME99q3&&cJ9Bk;mF->9DLYq`Qrd#{KoX?fIg=$=s!fQs+0f# literal 0 HcmV?d00001 diff --git a/evgenApp/schema.py b/evgenApp/schema.py new file mode 100644 index 0000000..d674c23 --- /dev/null +++ b/evgenApp/schema.py @@ -0,0 +1,8 @@ +import graphene +import users.schema + +class Query(users.schema.Query, graphene.ObjectType): + pass + + +schema = graphene.Schema(query=Query) \ No newline at end of file diff --git a/evgenApp/settings.py b/evgenApp/settings.py new file mode 100644 index 0000000..74b20c7 --- /dev/null +++ b/evgenApp/settings.py @@ -0,0 +1,139 @@ +""" +Django settings for evgenApp project. + +Generated by 'django-admin startproject' using Django 2.0. + +For more information on this file, see +https://docs.djangoproject.com/en/2.0/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/2.0/ref/settings/ +""" + +import os + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = '&%x4%0rf7_^)by!jrj23_e^*_ov(rv9+!=4a*rx)g)zr1^)4q=' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'graphene_django', + 'corsheaders', + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', +] +GRAPHENE = { + 'SCHEMA': 'evgenApp.schema.schema' +} + +CORS_ORIGIN_ALLOW_ALL = False + +CORS_ORIGIN_WHITELIST = ( + 'localhost:3000', +) + +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', + 'corsheaders.middleware.CorsMiddleware', + 'django.middleware.common.CommonMiddleware', +] + +CORS_ORIGIN_WHITELIST = [ + "http://localhost:3000", + "http://127.0.0.1:3000" + # your React App domain +] + +ROOT_URLCONF = 'evgenApp.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 = 'evgenApp.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/2.0/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + } +} + + +# Password validation +# https://docs.djangoproject.com/en/2.0/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/2.0/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/2.0/howto/static-files/ + +STATIC_URL = '/static/' diff --git a/evgenApp/urls.py b/evgenApp/urls.py new file mode 100644 index 0000000..fde819e --- /dev/null +++ b/evgenApp/urls.py @@ -0,0 +1,33 @@ +"""evgenApp URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/2.0/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 + +from graphene_django.views import GraphQLView +from django.views.decorators.csrf import csrf_exempt + +from django.http import HttpResponse + +from django.shortcuts import redirect + +def f(req): + return HttpResponse("hello") + +urlpatterns = [ + path('admin/', admin.site.urls), + path("graphql/", csrf_exempt(GraphQLView.as_view(graphiql=True)), name="gq"), + path("", lambda x : redirect("gq")) +] diff --git a/evgenApp/wsgi.py b/evgenApp/wsgi.py new file mode 100644 index 0000000..2c58c2c --- /dev/null +++ b/evgenApp/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for evgenApp 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/2.0/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "evgenApp.settings") + +application = get_wsgi_application() diff --git a/manage.py b/manage.py new file mode 100755 index 0000000..8aa3d67 --- /dev/null +++ b/manage.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "evgenApp.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) diff --git a/users/__init__.py b/users/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/users/__pycache__/__init__.cpython-36.pyc b/users/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..14a054120425d6a6c79fe79ddf92f3545204270c GIT binary patch literal 134 zcmXr!<>k6u@;ROX2p)q77+?f49Dul(1xTbY1T$zd`mJOr0tq9CU&i_w`MIh3nK_w> z`l)57I1qHfAsW}jyV?lv_X>n>%v3`7fW?p7Ve7s&ks3bADC4vcOPlN+xNq0`n z@N|F)_nF47pfeJB?^sW!sqqJ67)%h&2|6G#6$F1eOBdnoXzU9r*q+2a;UI&nz55o_ zHZ|XjnUf-}5slGh8?mYOGLW)*AtBRl19Gn2yqs6clvww97G+fdQ7-c&g3SWTQBv0< z1+u$c)pgW1pqi*jGboaAz12enO(i$LEw^u4S{?N1*s2=;%TL2V2b`Bl0i5eT=S3x2 zY2pFrt2U9}nP8!kI)f6lcawt@+MlgeUM`elv<3&kztUCDyqV6X!cHB~0kbb5)!xc% tDD>0-v$}uxxP)~5u&u!sAiJGM``uiBXzgwcw+=2kt(RuCT?2OHe*qm9d@29{ literal 0 HcmV?d00001 diff --git a/users/admin.py b/users/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/users/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/users/apps.py b/users/apps.py new file mode 100644 index 0000000..4ce1fab --- /dev/null +++ b/users/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class UsersConfig(AppConfig): + name = 'users' diff --git a/users/migrations/__init__.py b/users/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/users/models.py b/users/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/users/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/users/schema.py b/users/schema.py new file mode 100644 index 0000000..d7dfaa5 --- /dev/null +++ b/users/schema.py @@ -0,0 +1,9 @@ +import graphene + +class Query(graphene.ObjectType): + hello = graphene.Field(graphene.String) + + def resolve_hello(self, info): + return "hello" + +schema = graphene.Schema(query=Query) \ No newline at end of file diff --git a/users/tests.py b/users/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/users/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/users/views.py b/users/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/users/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here.