fixing sqlite

This commit is contained in:
2024-08-28 13:41:19 +02:00
parent 0f86a8ae69
commit 1e16059580
7 changed files with 15 additions and 9 deletions

1
.env Normal file
View File

@@ -0,0 +1 @@
SECRET_KEY = "django-insecure-4u__7o5r4h=k@qn_wk-h5$u_+bwo&gzvz5oph#+cny(#2wt6+)"

View File

@@ -2,7 +2,6 @@ FROM python:3.8.1-slim-buster
ENV PYTHONUNBUFFERED=1
# Install system dependencies
RUN apt-get update --yes && apt-get install --yes --no-install-recommends \
build-essential \
libpq-dev \
@@ -12,22 +11,17 @@ RUN apt-get update --yes && apt-get install --yes --no-install-recommends \
gettext \
&& rm -rf /var/lib/apt/lists/*
# Add and set up the working directory
WORKDIR /app
# Copy requirements file and install dependencies
COPY requirements.txt /app/
RUN pip install --upgrade pip \
&& pip install -r /app/requirements.txt
# Copy application code
COPY . /app/
# Collect static files
RUN python manage.py collectstatic --noinput --clear
RUN python manage.py migrate --noinput
# Expose the port the app runs on
EXPOSE 8000
# Run the application server
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "saburly.wsgi:application"]
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "saburly.wsgi:application"]

1
Procfile Normal file
View File

@@ -0,0 +1 @@
web: gunicorn saburly.wsgi:application --bind 0.0.0.0:8000

View File

@@ -1 +0,0 @@
web: gunicorn saburly.wsgi:application --log-file -

View File

@@ -0,0 +1,8 @@
import os
from django.core.exceptions import ImproperlyConfigured
def get_env_variable(var_name):
try:
return os.environ[var_name]
except KeyError:
raise ImproperlyConfigured(f"Set the {var_name} environment variable")

View File

@@ -1,9 +1,12 @@
from .base import *
from .getenv import get_env_variable
DEBUG = False
ALLOWED_HOSTS = ['18.196.202.28']
SECRET_KEY = get_env_variable('SECRET_KEY')
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',