Skip to content

Commit

Permalink
Add All
Browse files Browse the repository at this point in the history
  • Loading branch information
sinalalebakhsh committed Jul 10, 2024
1 parent bbb8338 commit 7156b90
Show file tree
Hide file tree
Showing 169 changed files with 244 additions and 32,208 deletions.
4 changes: 1 addition & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
venv/
Pipfile
Pipfile.lock
/Steps
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
venv/
db.sqlite3
.idea/
.env
.env
14 changes: 5 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
# For Django5 use python:3.10
# Use Python 3.10 image
FROM python:3.10
# For Django4 use python:3.9 OR between 3.0 to 3.9
# FROM python:3.9

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# Set the working directory to /code
WORKDIR /code

RUN pip install --upgrade pip

# Copy the requirements.txt file into the container at /code
COPY requirements.txt /code/

# Install any dependencies specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# RUN pip install -r requirements.txt
RUN pip install -r requirements.txt

# Copy all files in the current directory to /code
COPY . /code/

CMD ["gunicorn", "--bind", "0.0.0.0:8000", "config.wsgi:application"]
2 changes: 0 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ name = "pypi"

[packages]
django = "*"
psycopg2-binary = "*"
environs = "*"
gunicorn = "*"

[dev-packages]

Expand Down
90 changes: 1 addition & 89 deletions Pipfile.lock

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

53 changes: 0 additions & 53 deletions Steps /offline steps to run docker-compose-yml.txt

This file was deleted.

File renamed without changes.
55 changes: 55 additions & 0 deletions Steps/Archive/offline steps to run docker-compose-yml.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
##### Option 1: Adjust System Settings

## Open the sysctl.conf file:
sudo nano /etc/sysctl.conf



## Add the following line to allow non-root users to bind to port 443:
net.ipv4.ip_unprivileged_port_start=443


## Save the file and exit the editor.


## Reload the sysctl configuration:
sudo sysctl -p



##### Option 2: Use Ports Above 1024

## Updated docker-compose.yml:
version: '3.9'
services:
web:
build: .
command: sh -c "python manage.py makemigrations && python manage.py migrate && gunicorn myproject.wsgi:application --bind 0.0.0.0:8000"
volumes:
- .:/code
ports:
- "8000:8000"
expose:
- "8000"
env_file:
- .env
nginx:
image: nginx:latest
ports:
- "8080:80"
- "8443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./certs:/etc/nginx/certs:ro
depends_on:
- web
db:
image: postgres:14
environment:
- "POSTGRES_HOST_AUTH_METHOD=trust"

docker-compose down
docker-compose up --build



Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,12 @@ class AboutUsPageView(TemplateView):
template_name = 'pages/aboutus.html'


## CREATE templates directory

## Create in templates/ -> home.html

## Write in templates/home.html -> something ...

## add in config/setting.py in TEMPLATES = [ { ... 'DIRS': [str(BASE_DIR.joinpath('templates'))],}]


File renamed without changes.
Loading

0 comments on commit 7156b90

Please sign in to comment.