added venv to .gitignore and initiated the app

This commit is contained in:
arvinbehbahani562@gmail.com
2026-05-13 00:41:18 +03:30
parent 78d0c52b11
commit cf99039c8d
10 changed files with 57 additions and 3 deletions
+1
View File
@@ -28,6 +28,7 @@ wheels/
# Virtual environments # Virtual environments
.venv/ .venv/
venvArvin/
venv/ venv/
ENV/ ENV/
env/ env/
View File
+3
View File
@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.
+6
View File
@@ -0,0 +1,6 @@
from django.apps import AppConfig
class AddressesConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'addresses'
View File
+38
View File
@@ -0,0 +1,38 @@
from django.db import models
class Province(models.Model):
province_id = models.IntegerField(primary_key=True)
province_name = models.CharField(max_length=255)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
def __str__(self) -> str:
return f"{self.province_name}"
class City(models.Model):
province = models.ForeignKey("Province", on_delete=models.CASCADE, related_name="city")
city_id = models.IntegerField(primary_key=True)
city_name = models.CharField(max_length=255)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
def __str__(self) -> str:
return f"{self.city_name}"
class Address(models.Model):
province = models.ForeignKey("Province", on_delete=models.CASCADE, related_name="province")
city = models.ForeignKey("City", on_delete=models.CASCADE, related_name="city")
address_detail = models.TextField()
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
def __str__(self) -> str:
return f"{self.address_detail[:10]}..."
+3
View File
@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.
+3
View File
@@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.
Binary file not shown.
+3 -3
View File
@@ -66,7 +66,7 @@ services:
ports: ports:
- "8000:8000" - "8000:8000"
env_file: env_file:
- .env - .env.example
environment: environment:
DOCKER_VERSION: ${DOCKER_VERSION:-develop} DOCKER_VERSION: ${DOCKER_VERSION:-develop}
ALLOWED_HOSTS: ${ALLOWED_HOSTS:-localhost,127.0.0.1,0.0.0.0,web,backend-web} ALLOWED_HOSTS: ${ALLOWED_HOSTS:-localhost,127.0.0.1,0.0.0.0,web,backend-web}
@@ -101,7 +101,7 @@ services:
- .:/app - .:/app
- ./logs:/app/logs - ./logs:/app/logs
env_file: env_file:
- .env - .env.example
environment: environment:
DOCKER_VERSION: ${DOCKER_VERSION:-develop} DOCKER_VERSION: ${DOCKER_VERSION:-develop}
ALLOWED_HOSTS: ${ALLOWED_HOSTS:-localhost,127.0.0.1,0.0.0.0,web,backend-web} ALLOWED_HOSTS: ${ALLOWED_HOSTS:-localhost,127.0.0.1,0.0.0.0,web,backend-web}
@@ -135,7 +135,7 @@ services:
- .:/app - .:/app
- ./logs:/app/logs - ./logs:/app/logs
env_file: env_file:
- .env - .env.example
environment: environment:
DOCKER_VERSION: ${DOCKER_VERSION:-develop} DOCKER_VERSION: ${DOCKER_VERSION:-develop}
ALLOWED_HOSTS: ${ALLOWED_HOSTS:-localhost,127.0.0.1,0.0.0.0,web,backend-web} ALLOWED_HOSTS: ${ALLOWED_HOSTS:-localhost,127.0.0.1,0.0.0.0,web,backend-web}