Skip to content
This repository was archived by the owner on Mar 27, 2023. It is now read-only.

Commit 6d62904

Browse files
committed
refactored single stack into nested stacks,, fixed channels auth middleware
1 parent 657ec75 commit 6d62904

File tree

132 files changed

+16977
-1023
lines changed

Some content is hidden

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

132 files changed

+16977
-1023
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ backend/celerybeat-schedule
1717
.pytest_cache
1818
.~lock.*
1919
notes/
20-
.vscode
20+
.vscode
21+
cdk.out

awscdk/app.py

100644100755
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@
66
from awscdk.cdk_app_root import ApplicationStack
77

88
# naming conventions, also used for ACM certs, DNS Records, resource naming
9-
# Note: dynamically generated resource names created in CDK are used
10-
# in GitLab CI, such as cluster name, task definitions, etc.
9+
# Dynamically generated resource names created in CDK are used in GitLab CI
10+
# such as cluster name, task definitions, etc.
1111
environment_name = f"{os.environ.get('ENVIRONMENT', 'dev')}"
1212
base_domain_name = os.environ.get("DOMAIN_NAME", "mysite.com")
13+
# if the the production environent subdomain should nott be included in the URL
14+
# redefine `full_domain_name` to `base_domain_name` for that environment
1315
full_domain_name = f"{environment_name}.{base_domain_name}" # dev.mysite.com
16+
# if environment_name == "prod":
17+
# full_domain_name = base_domain_name
1418
base_app_name = os.environ.get("APP_NAME", "mysite-com")
1519
full_app_name = f"{environment_name}-{base_app_name}" # dev-mysite-com
20+
aws_region = os.environ.get("AWS_DEFAULT_REGION", "us-east-1")
1621

1722

1823
app = core.App()
@@ -24,7 +29,7 @@
2429
full_domain_name=full_domain_name,
2530
base_app_name=base_app_name,
2631
full_app_name=full_app_name,
27-
env={"region": "us-east-1"},
32+
env={"region": aws_region},
2833
)
2934

3035
# in order to be able to tag ECS resources, you need to go to
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[flake8]
2+
exclude =
3+
*/migrations/*
4+
notebooks
5+
ignore = C812, E226, C819, W503, C815, E203, E266, E501
6+
select = B,C,E,F,W,T4,B9
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
__pycache__
2+
.coverage
3+
4+
celerybeat-schedule
5+
celerybeat.pid
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[settings]
2+
multi_line_output=3
3+
line_length=60
4+
known_third_party=rest_framework_simplejwt

awscdk/asset.3fdc94c5be2f683173c0dc26f90051b2cdc7e43b5c67f85cb1836c07eff7c887/apps/__init__.py

Whitespace-only changes.

awscdk/asset.3fdc94c5be2f683173c0dc26f90051b2cdc7e43b5c67f85cb1836c07eff7c887/apps/accounts/__init__.py

Whitespace-only changes.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
from django.contrib import admin
2+
from django.contrib.auth.admin import UserAdmin
3+
4+
from .forms import CustomUserChangeForm, CustomUserCreationForm
5+
from .models import CustomUser
6+
7+
8+
class CustomUserAdmin(UserAdmin):
9+
add_form = CustomUserCreationForm
10+
form = CustomUserChangeForm
11+
model = CustomUser
12+
list_display = (
13+
"email",
14+
"is_staff",
15+
"is_active",
16+
)
17+
list_filter = (
18+
"email",
19+
"is_staff",
20+
"is_active",
21+
)
22+
fieldsets = (
23+
(None, {"fields": ("email", "password")}),
24+
("Permissions", {"fields": ("is_staff", "is_active")},),
25+
)
26+
add_fieldsets = (
27+
(
28+
None,
29+
{
30+
"classes": ("wide",),
31+
"fields": (
32+
"email",
33+
"password1",
34+
"password2",
35+
"is_staff",
36+
"is_active",
37+
),
38+
},
39+
),
40+
)
41+
search_fields = ("email",)
42+
ordering = ("email",)
43+
44+
45+
admin.site.register(CustomUser, CustomUserAdmin)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.apps import AppConfig
2+
3+
4+
class AccountsConfig(AppConfig):
5+
name = "accounts"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
2+
3+
from .models import CustomUser
4+
5+
6+
class CustomUserCreationForm(UserCreationForm):
7+
class Meta(UserCreationForm):
8+
model = CustomUser
9+
fields = ("email",)
10+
11+
12+
class CustomUserChangeForm(UserChangeForm):
13+
class Meta:
14+
model = CustomUser
15+
fields = ("email",)

0 commit comments

Comments
 (0)