Skip to content

Commit

Permalink
Fix #39 Temporal change to clever cloud
Browse files Browse the repository at this point in the history
stariluz committed Aug 4, 2024
1 parent 62cb8db commit d1df40e
Showing 25 changed files with 57 additions and 426 deletions.
20 changes: 10 additions & 10 deletions myFacegram/settings.py
Original file line number Diff line number Diff line change
@@ -84,16 +84,16 @@

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': os.environ['AWS_DB_NAME'],
'USER': os.environ['AWS_DB_USER'],
'PASSWORD': os.environ['AWS_DB_PASSWORD'],
'HOST': os.environ['AWS_DB_HOST'],
'PORT': os.environ['AWS_DB_PORT'],
'OPTIONS':{
'sql_mode': 'STRICT_TRANS_TABLES',
# 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
}
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.environ['POSTGRESQL_ADDON_DB'],
'USER': os.environ['POSTGRESQL_ADDON_USER'],
'PASSWORD': os.environ['POSTGRESQL_ADDON_PASSWORD'],
'HOST': os.environ['POSTGRESQL_ADDON_HOST'],
'PORT': os.environ['POSTGRESQL_ADDON_PORT'],
# 'OPTIONS':{
# 'sql_mode': 'STRICT_TRANS_TABLES',
# # 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
# }
}
}
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
20 changes: 10 additions & 10 deletions myFacegram/settings_production.py
Original file line number Diff line number Diff line change
@@ -100,16 +100,16 @@

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': os.environ['AWS_DB_NAME'],
'USER': os.environ['AWS_DB_USER'],
'PASSWORD': os.environ['AWS_DB_PASSWORD'],
'HOST': os.environ['AWS_DB_HOST'],
'PORT': os.environ['AWS_DB_PORT'],
'OPTIONS':{
'sql_mode': 'STRICT_TRANS_TABLES',
# 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
}
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': os.environ['POSTGRESQL_ADDON_DB'],
'USER': os.environ['POSTGRESQL_ADDON_USER'],
'PASSWORD': os.environ['POSTGRESQL_ADDON_PASSWORD'],
'HOST': os.environ['POSTGRESQL_ADDON_HOST'],
'PORT': os.environ['POSTGRESQL_ADDON_PORT'],
# 'OPTIONS':{
# 'sql_mode': 'STRICT_TRANS_TABLES',
# # 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
# }
}
}
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
42 changes: 23 additions & 19 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions posts/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
# Generated by Django 3.1 on 2020-08-26 00:55
# Generated by Django 5.0.7 on 2024-08-04 00:28

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('users', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name='Post',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=255)),
('photo', models.ImageField(upload_to='posts/pictures')),
('title', models.CharField(blank=True, max_length=255, null=True)),
('content_text', models.TextField()),
('photo', models.ImageField(blank=True, null=True, upload_to='posts/pictures')),
('created', models.DateTimeField(auto_now_add=True)),
('modified', models.DateTimeField(auto_now=True)),
('profile', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.profile')),
18 changes: 0 additions & 18 deletions posts/migrations/0002_auto_20200826_2039.py

This file was deleted.

18 changes: 0 additions & 18 deletions posts/migrations/0003_post_content_text.py

This file was deleted.

23 changes: 0 additions & 23 deletions posts/migrations/0004_auto_20200911_0432.py

This file was deleted.

18 changes: 0 additions & 18 deletions posts/migrations/0005_auto_20200911_0533.py

This file was deleted.

23 changes: 0 additions & 23 deletions posts/migrations/0006_auto_20200911_1947.py

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ sqlparse = "^0.5.1"
daphne = "^4.1.2"
django-storages = {extras = ["s3"], version = "^1.14.3"}
twisted = {extras = ["http2", "tls"], version = "^24.3.0"}
mysqlclient = "^2.2.4"
psycopg2 = "^2.9.9"


[build-system]
2 changes: 1 addition & 1 deletion tests/test-storage.py
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
# Environment variables
access_key_id = os.environ.get('ACCESS_KEY_ID')
secret_access_key = os.environ.get('SECRET_ACCESS_KEY')
endpoint_url = 'https://5868f1c65dbb2a8c20cd09e90d5d3c29.r2.cloudflarestorage.com'
endpoint_url = f'https://{os.environ.get('SECRET_ACCESS_KEY')}.r2.cloudflarestorage.com'
bucket_name = 'my-facegram-storage'

s3 = boto3.client(
9 changes: 6 additions & 3 deletions users/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Generated by Django 3.1 on 2020-08-25 01:29
# Generated by Django 5.0.7 on 2024-08-04 00:28

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):
@@ -19,8 +19,11 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('description', models.TextField(blank=True)),
('birthday', models.IntegerField(blank=True, default='0', unique_for_date=True)),
('birthmonth', models.IntegerField(blank=True, default='0', unique_for_month=True)),
('birthyear', models.IntegerField(blank=True, default='0', unique_for_year=True)),
('phone_number', models.CharField(blank=True, max_length=20)),
('picture', models.ImageField(blank=True, null=True, upload_to='users/pictures')),
('picture', models.ImageField(null=True, upload_to='users/pictures')),
('created', models.DateTimeField(auto_now_add=True)),
('modified', models.DateTimeField(auto_now=True)),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
19 changes: 0 additions & 19 deletions users/migrations/0002_profile_age.py

This file was deleted.

18 changes: 0 additions & 18 deletions users/migrations/0003_auto_20200828_0144.py

This file was deleted.

18 changes: 0 additions & 18 deletions users/migrations/0004_auto_20200828_0339.py

This file was deleted.

18 changes: 0 additions & 18 deletions users/migrations/0005_auto_20200911_0057.py

This file was deleted.

18 changes: 0 additions & 18 deletions users/migrations/0006_auto_20200912_0135.py

This file was deleted.

18 changes: 0 additions & 18 deletions users/migrations/0007_auto_20200912_0141.py

This file was deleted.

18 changes: 0 additions & 18 deletions users/migrations/0008_auto_20200930_1610.py

This file was deleted.

20 changes: 0 additions & 20 deletions users/migrations/0009_auto_20200930_1613.py

This file was deleted.

30 changes: 0 additions & 30 deletions users/migrations/0010_auto_20201025_2146.py

This file was deleted.

28 changes: 0 additions & 28 deletions users/migrations/0011_auto_20201025_2326.py

This file was deleted.

25 changes: 0 additions & 25 deletions users/migrations/0012_auto_20201025_2329.py

This file was deleted.

19 changes: 0 additions & 19 deletions users/migrations/0013_auto_20201026_1925.py

This file was deleted.

This file was deleted.

0 comments on commit d1df40e

Please sign in to comment.