Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: apiv2 django-ninja and device info update #239

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
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
58 changes: 29 additions & 29 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
FROM python:3.11.4
ENV PATH="/root/.local/bin:${PATH}"

# Install postgres client
RUN wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | apt-key add - && \
echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" >> /etc/apt/sources.list.d/pgdg.list && \
apt-get update -y && \
apt-get install -y postgresql-client-12 tzdata && \
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs && \
rm -rf /var/lib/apt/lists/*

# Install Heroku client
RUN curl https://cli-assets.heroku.com/install.sh | sh

# Install poetry
RUN curl -sSL https://install.python-poetry.org | python3 -

# Add files
ADD . /app
WORKDIR /app

# Install client dependencies and update path to include poetry and node module executables
RUN npm install && \
echo "export PATH=~/.local/bin:/app/node_modules/.bin:/app/client/node_modules/.bin:\$PATH\n" >> /root/.bashrc

# Run poetry to install dependencies
RUN poetry config virtualenvs.create false && \
poetry install
FROM python:3.11.10-bookworm
ENV PATH="/root/.local/bin:${PATH}"
# Install postgres client
RUN wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | apt-key add - && \
echo "deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main" >> /etc/apt/sources.list.d/pgdg.list && \
apt-get update -y && \
apt-get install -y postgresql-client-14 tzdata && \
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs && \
rm -rf /var/lib/apt/lists/*
# Install Heroku client
RUN curl https://cli-assets.heroku.com/install.sh | sh
# Install poetry
RUN curl -sSL https://install.python-poetry.org | python3 -
# Add files
ADD . /app
WORKDIR /app
# Install client dependencies and update path to include poetry and node module executables
RUN npm install && \
echo "export PATH=~/.local/bin:/app/node_modules/.bin:/app/client/node_modules/.bin:\$PATH\n" >> /root/.bashrc
# Run poetry to install dependencies
RUN poetry config virtualenvs.create false && \
poetry install
2 changes: 1 addition & 1 deletion docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ services:
ports:
- "8001:8001"
db:
image: postgres:12
image: postgres:14.12
ports:
- 5433:5432
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
db:
image: postgres:12
image: postgres:14.12
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
Expand Down
27 changes: 0 additions & 27 deletions home/migrations/0008_alter_gender_race_fields_setfield.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# Generated by Django 3.2.9 on 2021-12-28 02:13

import setfield
from django.db import migrations, models

import home.models.account


class Migration(migrations.Migration):

Expand Down Expand Up @@ -43,30 +40,6 @@ class Migration(migrations.Migration):
null=True,
),
),
migrations.RemoveField(
model_name="account",
name="race",
),
migrations.AddField(
model_name="account",
name="race",
field=setfield.SetField(
base_field=models.CharField(
choices=[
("NA", home.models.account.RaceLabels["NA"]),
("BL", home.models.account.RaceLabels["BL"]),
("AS", home.models.account.RaceLabels["AS"]),
("PI", home.models.account.RaceLabels["PI"]),
("WH", home.models.account.RaceLabels["WH"]),
("OT", home.models.account.RaceLabels["OT"]),
],
max_length=2,
),
blank=True,
default=list,
size=None,
),
),
migrations.AlterField(
model_name="dailywalk",
name="date",
Expand Down
24 changes: 0 additions & 24 deletions home/migrations/0010_auto_20220321_0407.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# Generated by Django 3.2.12 on 2022-03-21 11:07

import setfield
from django.db import migrations, models

import home.models.account


class Migration(migrations.Migration):

Expand Down Expand Up @@ -43,25 +40,4 @@ class Migration(migrations.Migration):
null=True,
),
),
migrations.AlterField(
model_name="account",
name="race",
field=setfield.SetField(
base_field=models.CharField(
choices=[
("NA", home.models.account.RaceLabels["NA"]),
("BL", home.models.account.RaceLabels["BL"]),
("AS", home.models.account.RaceLabels["AS"]),
("PI", home.models.account.RaceLabels["PI"]),
("WH", home.models.account.RaceLabels["WH"]),
("OT", home.models.account.RaceLabels["OT"]),
("DA", home.models.account.RaceLabels["DA"]),
],
max_length=2,
),
blank=True,
default=list,
size=None,
),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# Generated by Django 4.2.11 on 2024-07-01 03:35

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("home", "0013_weeklygoal"),
]

operations = [
migrations.AddField(
model_name="device",
name="device_model",
field=models.CharField(
blank=True,
help_text='''Unique identifier for the device\'s model.\n
getDeviceid() - Gets the device ID.
iOS: "iPhone7,2"
Android: "goldfish"
Windows: "Y3R94UC#AC4"''',
max_length=25,
null=True,
),
),
migrations.AddField(
model_name="device",
name="manufacturer",
field=models.CharField(
blank=True,
help_text="""Manufacturer of the device.\n
getManufacturer() - Gets the device manufacturer
iOS: "Apple"
Android: "Google"
Windows: ?""",
max_length=25,
null=True,
),
),
migrations.AddField(
model_name="device",
name="os_name",
field=models.CharField(
blank=True,
help_text="""Operating system of the device.\n
getSystemName() - Gets the device OS name.
iOS: "iOS" on newer iOS devices "iPhone OS" on older devices (including older iPad models),
\t\t"iPadOS" for iPads using iPadOS 15.0 or higher.
Android: "Android"
Windows: ?""",
max_length=25,
null=True,
),
),
migrations.AddField(
model_name="device",
name="os_version",
field=models.CharField(
blank=True,
help_text="""Device operating system version.\n
getSystemVersion() - Gets the device OS version.
iOS: "11.0"
Android: "7.1.1"
Windows: ?""",
max_length=25,
null=True,
),
),
migrations.AlterField(
model_name="account",
name="gender",
field=models.CharField(
blank=True,
choices=[
("CF", "CF"),
("CM", "CM"),
("TF", "TF"),
("TM", "TM"),
("NB", "NB"),
("OT", "OT"),
("DA", "DA"),
],
help_text="Self-identified gender identity of user",
max_length=2,
null=True,
),
),
migrations.AlterField(
model_name="account",
name="is_latino",
field=models.CharField(
blank=True,
choices=[("YE", "YE"), ("NO", "NO"), ("DA", "DA")],
help_text="Latino or Hispanic origin",
max_length=2,
null=True,
),
),
migrations.RemoveField(
model_name="account",
name="race",
),
migrations.AddField(
model_name="account",
name="race",
field=models.JSONField(
blank=True,
choices=[
("NA", "NA"),
("BL", "BL"),
("AS", "AS"),
("PI", "PI"),
("WH", "WH"),
("OT", "OT"),
("DA", "DA"),
],
null=True,
),
),
migrations.AlterField(
model_name="account",
name="sexual_orien",
field=models.CharField(
blank=True,
choices=[
("BS", "BS"),
("SG", "SG"),
("US", "US"),
("HS", "HS"),
("OT", "OT"),
("DA", "DA"),
],
help_text="Self-identified sexual orientation of user",
max_length=2,
null=True,
),
),
migrations.AlterField(
model_name="account",
name="zip",
field=models.CharField(help_text="User's zip code", max_length=25),
),
]
Loading