Skip to content

Commit

Permalink
feat: Update .gitignore to exclude static, media, and compiled Python…
Browse files Browse the repository at this point in the history
… files; modify requirements and render configuration for deployment
  • Loading branch information
AhmedNassar7 committed Dec 13, 2024
1 parent 08c48a0 commit 2f97a8a
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 23 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ db.sqlite3
*.py[cod]
commands.md

# Ignore static files
/static/
staticfiles/

# Ignore media files
/media/

# Ignore compiled python files
*.pyc

# Node.js
node_modules/
npm-debug.log
Expand Down
88 changes: 69 additions & 19 deletions poetry.lock

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

9 changes: 7 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ name = "egypt-metro-backend"
version = "0.1.0"
description = "Backend for Egypt Metro project"
authors = ["Ahmed Nassar <[email protected]>"]
package-mode = false # Disable packaging mode

[tool.poetry.dependencies]
python = "^3.9"
Expand All @@ -15,8 +16,7 @@ uvicorn = "^0.15.0"
pydantic = "^1.8.2"
httpx = "^0.21.1"
starlette = "^0.14.2"
asyncpg = "^0.24.0"

asyncpg = "^0.30.0"
pywin32 = { version = "306", optional = true, markers = "sys_platform == 'win32'" }

[tool.poetry.dev-dependencies]
Expand All @@ -28,3 +28,8 @@ pytest-mock = "^3.6.1"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

# Add this section to specify the package directory
packages = [
{ include = "egypt_metro" }, # Main package
]
5 changes: 4 additions & 1 deletion render.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Render configuration file for deploying a Django application to Render

services:
- type: web
name: egypt-metro
Expand All @@ -6,11 +8,12 @@ services:
rootDirectory: backend # Root directory of the project
plan: free
buildCommand:
- apt-get update && apt-get install -y gcc libpq-dev python3-dev
- pip install --upgrade pip
- pip install -r requirements.txt
- python manage.py collectstatic --noinput
- python manage.py migrate --noinput
startCommand: "gunicorn egypt_metro.wsgi:application --bind 0.0.0.0:8000"
startCommand: "uvicorn egypt_metro.wsgi:application --host 0.0.0.0 --port 8000"
envVars:
- key: ENVIRONMENT # Environment for loading specific config
value: prod
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
anyio==3.7.1 ; python_version >= "3.9" and python_version < "4.0"
asgiref==3.8.1 ; python_version >= "3.9" and python_version < "4.0"
asyncpg==0.24.0 ; python_version >= "3.9" and python_version < "4.0"
async-timeout==5.0.1 ; python_version >= "3.9" and python_version < "3.11.0"
asyncpg==0.30.0 ; python_version >= "3.9" and python_version < "4.0"
certifi==2024.8.30 ; python_version >= "3.9" and python_version < "4.0"
charset-normalizer==3.4.0 ; python_version >= "3.9" and python_version < "4.0"
click==8.1.7 ; python_version >= "3.9" and python_version < "4.0"
Expand Down

0 comments on commit 2f97a8a

Please sign in to comment.