-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
53 changed files
with
143 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
SECRET_KEY=z64oc2d-4&_p@*@5pr2pdbq$i69b#jsrn5mzm(1y$!11w&fw&) | ||
SECRET_KEY=************************************************** | ||
DEBUG=True | ||
ALLOWED_HOSTS=* | ||
LANGUAGE_CODE=en-us | ||
TIME_ZONE=Europe/Moscow | ||
|
||
APPEND_SLASH=False | ||
USE_I18N=False | ||
USE_L10N=True | ||
DATE_FORMAT=F d, Y | ||
USE_TZ=False | ||
|
||
DATA_UPLOAD_MAX_MEMORY_SIZE=251658240 | ||
FILE_UPLOAD_MAX_MEMORY_SIZE=251658240 | ||
|
||
ALPHABET={'а': 'a', 'б': 'b', 'в': 'v', 'г': 'g', 'д': 'd', 'е': 'e', 'ё': 'yo', 'ж': 'zh', 'з': 'z', 'и': 'i', 'й': 'y', 'к': 'k', 'л': 'l', 'м': 'm', 'н': 'n', 'о': 'o', 'п': 'p', 'р': 'r', 'с': 's', 'т': 't', 'у': 'u', 'ф': 'f', 'х': 'kh', 'ц': 'ts', 'ч': 'ch', 'ш': 'sh', 'щ': 'shch', 'ы': 'y', 'э': 'e', 'ю': 'yu', 'я': 'ya'} | ||
|
||
DATA_UPLOAD_MAX_MEMORY_SIZE=251658240 | ||
FILE_UPLOAD_MAX_MEMORY_SIZE=251658240 | ||
LOCAL_DOMAIN=http://localhost:8000 | ||
DOMAIN=https://fla.codes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
source env/bin/activate | ||
cd src/ | ||
|
||
python manage.py migrate | ||
python build.py | ||
gunicorn --reload -b 0.0.0.0:${WEB_PORT} -c config/gunicorn.conf.py -k uvicorn.workers.UvicornWorker config.asgi:application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
source env/bin/activate | ||
cd src/ | ||
|
||
python manage.py migrate | ||
python build.py | ||
uvicorn --reload --host 0.0.0.0 --port ${WEB_PORT} config.asgi:application |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class ApiConfig(AppConfig): | ||
|
||
name = 'apps.api' | ||
verbose_name = 'API' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class CoreConfig(AppConfig): | ||
|
||
name = 'apps.core' | ||
verbose_name = 'Core' |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class ExtAuthConfig(AppConfig): | ||
|
||
name = 'apps.ext_auth' | ||
verbose_name = 'Authentication and Authorization' |
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from core.models import Article | ||
from apps.core.models import Article | ||
|
||
from .forms import UserCreationForm | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env python | ||
import os | ||
|
||
import django | ||
|
||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings') | ||
|
||
django.setup() | ||
|
||
|
||
def main(): | ||
from django.contrib.auth import get_user_model | ||
|
||
'''Create first superuser''' | ||
UserModel = get_user_model() | ||
User = UserModel.objects.filter(username='root') | ||
if User.exists(): | ||
print('Root user already exists!') | ||
else: | ||
UserModel.objects.create_superuser( | ||
username='root', | ||
password='root', | ||
email='[email protected]' | ||
) | ||
print('Root user created!') | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env python | ||
import os | ||
|
||
import packs | ||
|
||
import django | ||
|
||
|
||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings') | ||
|
||
django.setup() | ||
|
||
'''Rename tables in database''' | ||
packs.rename_tables() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import os | ||
import signal | ||
|
||
|
||
def worker_int(worker): | ||
os.kill(worker.pid, signal.SIGINT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,38 @@ | ||
def rename_tables(): | ||
def rename_tables() -> None: | ||
|
||
from django.db.migrations.recorder import MigrationRecorder | ||
from django.contrib.contenttypes.models import ContentType | ||
from django.contrib.auth.models import Group, Permission | ||
from django.contrib.sessions.models import Session | ||
from django.contrib.admin.models import LogEntry | ||
|
||
|
||
'''Init Migration class''' | ||
MigrationRecorder.Migration() | ||
|
||
'''Edit db_table in M2M field Group model''' | ||
Group.permissions.db_table = 'group_permissions' | ||
Group._meta.get_field('permissions').db_table = 'group_permissions' | ||
|
||
'''Edit db_table of Group model''' | ||
Group._meta.db_table = 'groups' | ||
Group._meta.original_attrs['db_table'] = 'groups' | ||
Group.permissions.db_table = 'group_permissions' | ||
|
||
'''Edit db_table of Permission model''' | ||
Permission._meta.db_table = 'permissions' | ||
Permission._meta.original_attrs['db_table'] = 'permissions' | ||
|
||
'''Edit db_table of LogEntry model''' | ||
LogEntry._meta.db_table = 'admin_log' | ||
LogEntry._meta.original_attrs['db_table'] = 'admin_log' | ||
|
||
'''Edit db_table of Session model''' | ||
Session._meta.db_table = 'sessions' | ||
Session._meta.original_attrs['db_table'] = 'sessions' | ||
|
||
'''Edit db_table of ContentType model''' | ||
ContentType._meta.db_table = 'content_types' | ||
ContentType._meta.original_attrs['db_table'] = 'content_types' | ||
|
||
'''Edit db_table of Migration model''' | ||
MigrationRecorder._migration_class._meta.db_table = 'migrations' | ||
MigrationRecorder._migration_class._meta.original_attrs['db_table'] = 'migrations' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters