diff --git a/.gitignore b/.gitignore index 681ceb5..07b766b 100644 --- a/.gitignore +++ b/.gitignore @@ -135,3 +135,6 @@ GitHub.sublime-settings !.vscode/launch.json !.vscode/extensions.json .history + +#postgres pass files +*.my_pgpass diff --git a/artel/Dockerfile b/artel/Dockerfile index ef47bd3..a8b15d3 100644 --- a/artel/Dockerfile +++ b/artel/Dockerfile @@ -1,5 +1,5 @@ # Use an official Python runtime based on Debian 10 "buster" as a parent image. -FROM python:3.8.1-slim-buster +FROM python:3.11.3-buster # Add user that will be used in the container. RUN useradd wagtail diff --git a/artel/Dockerfile.local b/artel/Dockerfile.local new file mode 100644 index 0000000..e42726d --- /dev/null +++ b/artel/Dockerfile.local @@ -0,0 +1,36 @@ +# Use an official Python runtime based on Debian 10 "buster" as a parent image. +FROM python:3.11.3-buster + +# Port used by this container to serve HTTP. +EXPOSE 8000 + +# Set environment variables. +# 1. Force Python stdout and stderr streams to be unbuffered. +# 2. Set PORT variable that is used by Gunicorn. This should match "EXPOSE" +# command. +ENV PYTHONDONTWRITEBYTECODE 1 +ENV PYTHONUNBUFFERED 1 + +# Install system packages required by Wagtail and Django. +RUN apt-get update --yes --quiet && apt-get install --yes --quiet --no-install-recommends \ + build-essential \ + libpq-dev \ + libmariadbclient-dev \ + libjpeg62-turbo-dev \ + zlib1g-dev \ + libwebp-dev \ + && rm -rf /var/lib/apt/lists/* + +# Install the project requirements. +COPY requirements.txt / +RUN pip install -r /requirements.txt + +# Use /app folder as a directory where the source code is stored. +WORKDIR /app + +# Copy the source code of the project into the container. +COPY ./ /app + +# Collect static files. +RUN python manage.py collectstatic --noinput --clear +CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] diff --git a/artel/artel/settings/base.py b/artel/artel/settings/base.py index 8663caf..36fcf80 100644 --- a/artel/artel/settings/base.py +++ b/artel/artel/settings/base.py @@ -88,12 +88,13 @@ WSGI_APPLICATION = "artel.wsgi.application" # Database # https://docs.djangoproject.com/en/4.1/ref/settings/#databases +import dj_database_url as db_url + DATABASES = { - "default": { - "ENGINE": "django.db.backends.sqlite3", - "NAME": os.path.join(BASE_DIR, "db.sqlite3"), - } + "default": db_url.parse( + "postgres://comfy:password@db/comfy_shop" + ) } diff --git a/artel/artel/static/images/las_ruinas_PL.png b/artel/artel/static/images/las_ruinas_PL.png new file mode 100644 index 0000000..fa4327d Binary files /dev/null and b/artel/artel/static/images/las_ruinas_PL.png differ diff --git a/artel/artel/templates/base.html b/artel/artel/templates/base.html index 1b32201..3b2ad3c 100644 --- a/artel/artel/templates/base.html +++ b/artel/artel/templates/base.html @@ -26,6 +26,7 @@ {# Global stylesheets #} + {% block extra_css %} {# Override this in templates to add extra stylesheets #} @@ -34,17 +35,20 @@
{% wagtailuserbar %} -