added venv to .gitignore and initiated the app
This commit is contained in:
@@ -28,6 +28,7 @@ wheels/
|
|||||||
|
|
||||||
# Virtual environments
|
# Virtual environments
|
||||||
.venv/
|
.venv/
|
||||||
|
venvArvin/
|
||||||
venv/
|
venv/
|
||||||
ENV/
|
ENV/
|
||||||
env/
|
env/
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
# Register your models here.
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class AddressesConfig(AppConfig):
|
||||||
|
default_auto_field = 'django.db.models.BigAutoField'
|
||||||
|
name = 'addresses'
|
||||||
@@ -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]}..."
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
# Create your tests here.
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
from django.shortcuts import render
|
||||||
|
|
||||||
|
# Create your views here.
|
||||||
Binary file not shown.
+3
-3
@@ -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}
|
||||||
|
|||||||
Reference in New Issue
Block a user