Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"python.testing.unittestArgs": [
"-v",
"-s",
"./mainapp",
"-p",
"test*.py"
],
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": true
}
1 change: 1 addition & 0 deletions 001_courses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
17 changes: 17 additions & 0 deletions authapp/migrations/0002_alter_customuser_options.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 4.0.4 on 2022-06-06 12:30

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('authapp', '0001_initial'),
]

operations = [
migrations.AlterModelOptions(
name='customuser',
options={'verbose_name': 'user', 'verbose_name_plural': 'users'},
),
]
3 changes: 3 additions & 0 deletions config/pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pytest]
DJANGO_SETTINGS_MODULE = config.settings
python_files = tests.py
3 changes: 3 additions & 0 deletions config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
"debug_toolbar.middleware.DebugToolbarMiddleware",
'django.middleware.locale.LocaleMiddleware',
]

ROOT_URLCONF = 'config.urls'
Expand All @@ -68,6 +69,7 @@
"mainapp.context_processors.example.simple_context_processor",
"social_django.context_processors.backends",
"social_django.context_processors.login_redirect",

],

'libraries':{'email_to_link':'mainapp.context_processors.example'}
Expand Down Expand Up @@ -122,6 +124,7 @@
TIME_ZONE = 'Europe/Moscow'

USE_I18N = True
LOCALE_PATH = [BASE_DIR / 'locale']

USE_TZ = True

Expand Down
2 changes: 1 addition & 1 deletion config/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

from django.contrib import admin

from django.conf import settings
from django.urls import path, include
from django.views.generic import RedirectView
Expand All @@ -9,6 +8,7 @@
urlpatterns = [
path('admin/', admin.site.urls),
path("", RedirectView.as_view(url="mainapp/")),
path("i18n/", include("django.conf.urls.i18n")),
path("mainapp/", include("mainapp.urls", namespace='mainapp')),
path("authapp/", include("authapp.urls", namespace="authapp")),
path("social_auth/", include("social_django.urls", namespace='social'))
Expand Down
Binary file modified db.sqlite3
Binary file not shown.
114 changes: 114 additions & 0 deletions fixtures/001_courses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
[
{
"model": "mainapp.courses",
"pk": 1,
"fields": {
"name": "Курс_1",
"description": "описание",
"description_as_markdown": false,
"cost": "2000.00",
"cover": "no_image.svg",
"created": "2022-06-06T14:41:33.551Z",
"updated": "2022-06-06T14:41:33.551Z",
"deleted": false
}
}
{
"model": "mainapp.courses",
"pk": 2,
"fields": {
"name": "Курс_2",
"description": "описание",
"description_as_markdown": false,
"cost": "2000.00",
"cover": "no_image.svg",
"created": "2022-06-06T14:41:33.551Z",
"updated": "2022-06-06T14:41:33.551Z",
"deleted": false
}
}
{
"model": "mainapp.courses",
"pk": 3,
"fields": {
"name": "Курс_3",
"description": "описание",
"description_as_markdown": false,
"cost": "2000.00",
"cover": "no_image.svg",
"created": "2022-06-06T14:41:33.551Z",
"updated": "2022-06-06T14:41:33.551Z",
"deleted": false
}
}
{
"model": "mainapp.courses",
"pk": 4,
"fields": {
"name": "Курс_4",
"description": "описание",
"description_as_markdown": false,
"cost": "2000.00",
"cover": "no_image.svg",
"created": "2022-06-06T14:41:33.551Z",
"updated": "2022-06-06T14:41:33.551Z",
"deleted": false
}
}
{
"model": "mainapp.courses",
"pk": 5,
"fields": {
"name": "Курс_5",
"description": "описание",
"description_as_markdown": false,
"cost": "2000.00",
"cover": "no_image.svg",
"created": "2022-06-06T14:41:33.551Z",
"updated": "2022-06-06T14:41:33.551Z",
"deleted": false
}
}
{
"model": "mainapp.courses",
"pk": 6,
"fields": {
"name": "Курс_6",
"description": "описание",
"description_as_markdown": false,
"cost": "2000.00",
"cover": "no_image.svg",
"created": "2022-06-06T14:41:33.551Z",
"updated": "2022-06-06T14:41:33.551Z",
"deleted": false
}
}
{
"model": "mainapp.courses",
"pk": 7,
"fields": {
"name": "Курс_7",
"description": "описание",
"description_as_markdown": false,
"cost": "2000.00",
"cover": "no_image.svg",
"created": "2022-06-06T14:41:33.551Z",
"updated": "2022-06-06T14:41:33.551Z",
"deleted": false
}
}
{
"model": "mainapp.courses",
"pk": 8,
"fields": {
"name": "Курс_8",
"description": "описание",
"description_as_markdown": false,
"cost": "2000.00",
"cover": "no_image.svg",
"created": "2022-06-06T14:41:33.551Z",
"updated": "2022-06-06T14:41:33.551Z",
"deleted": false
}
}
]
1 change: 1 addition & 0 deletions fixtures/001_news.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"model": "mainapp.news", "pk": 1, "fields": {"title": "Заголовок 1", "preambule": "вступлене", "body": "текст", "body_as_markdown": false, "created": "2022-06-06T12:32:34.332Z", "updated": "2022-06-06T12:32:34.332Z", "deleted": false}}, {"model": "mainapp.news", "pk": 2, "fields": {"title": "заголовок 2", "preambule": "вступление", "body": "текст", "body_as_markdown": false, "created": "2022-06-06T12:32:54.839Z", "updated": "2022-06-06T12:32:54.839Z", "deleted": false}}]
42 changes: 42 additions & 0 deletions fixtures/001_user.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[
{
"model": "authapp.customuser",
"pk": 1,
"fields": {
"password": "pbkdf2_sha256$320000$PIuI7VUQVdk60J6ijcX2KD$tRryChpq4Wt/reIEo3NONSeJqCj8HCI+P/71AJRML7k=",
"last_login": "2022-06-06T12:32:03.027Z",
"is_superuser": true,
"username": "test",
"first_name": "",
"last_name": "",
"age": null,
"avatar": "",
"email": "test@df.ua",
"is_staff": true,
"is_active": true,
"date_joined": "2022-06-02T13:28:07.406Z",
"groups": [],
"user_permissions": []
}
},
{
"model": "authapp.customuser",
"pk": 2,
"fields": {
"password": "pbkdf2_sha256$320000$pEp2GBrzmPB6kUInt71Wjj$pRCK/+xaM3LJhHS7oA0bNWqHI5UQT7twUfIuvLRB6Bs=",
"last_login": "2022-06-02T14:01:43.713Z",
"is_superuser": false,
"username": "test2",
"first_name": "jkhb",
"last_name": "kj",
"age": 20,
"avatar": "",
"email": "dgefdghdf@dfg.uf",
"is_staff": false,
"is_active": true,
"date_joined": "2022-06-02T13:59:28.263Z",
"groups": [],
"user_permissions": []
}
}
]
90 changes: 90 additions & 0 deletions locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-06-06 18:25+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: authapp/forms.py:55
msgid "Please, enter a valid age!"
msgstr ""

#: authapp/models.py:18
msgid "username"
msgstr ""

#: authapp/models.py:22
msgid "Required. 150 characters or fewer. Letters, digits and @/./+/-/_only."
msgstr ""

#: authapp/models.py:25
msgid "A user with that username already exists."
msgstr ""

#: authapp/models.py:28
msgid "first name"
msgstr ""

#: authapp/models.py:29
msgid "last name"
msgstr ""

#: authapp/models.py:35
msgid "email address"
msgstr ""

#: authapp/models.py:39
msgid "A user with that email address already exists."
msgstr ""

#: authapp/models.py:43
msgid "staff status"
msgstr ""

#: authapp/models.py:46
msgid "Designates whether the user can log into this admin site."
msgstr ""

#: authapp/models.py:50
msgid "active"
msgstr ""

#: authapp/models.py:53
msgid ""
"Designates whether this user should be treated as active. Unselect this "
"instead of deleting accounts."
msgstr ""

#: authapp/models.py:57
msgid "date joined"
msgstr ""

#: authapp/models.py:64
msgid "user"
msgstr ""

#: authapp/models.py:65
msgid "users"
msgstr ""

#: authapp/views.py:18
msgid ""
"Вход совершен<br>Привет, {name if name else self.request.user.get_username()}"
msgstr ""

#: authapp/views.py:30
msgid "Досвидания!"
msgstr ""
Loading