Skip to content

Commit

Permalink
Create a new template using poetry and django
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyjuareza committed Jun 14, 2024
1 parent 939a5c3 commit 0857689
Show file tree
Hide file tree
Showing 11 changed files with 93 additions and 88 deletions.
6 changes: 0 additions & 6 deletions backend/.env.dev

This file was deleted.

41 changes: 0 additions & 41 deletions backend/Dockerfile

This file was deleted.

File renamed without changes.
4 changes: 2 additions & 2 deletions backend/server/asgi.py → backend/api/asgi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
ASGI config for server project.
ASGI config for api project.
It exposes the ASGI callable as a module-level variable named ``application``.
Expand All @@ -11,6 +11,6 @@

from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'server.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'api.settings')

application = get_asgi_application()
17 changes: 6 additions & 11 deletions backend/server/settings.py → backend/api/settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Django settings for server project.
Django settings for api project.
Generated by 'django-admin startproject' using Django 5.0.6.
Expand All @@ -10,7 +10,6 @@
https://docs.djangoproject.com/en/5.0/ref/settings/
"""

import os
from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
Expand All @@ -21,7 +20,7 @@
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-z)j#obh&=my7d)70&ruq2)*^(&z7m*$^kq6_c+^t*=s!+ji$16'
SECRET_KEY = 'django-insecure-!ph@!3)-3@c(eh0usp&wypxs+@*tdbkoy9_e)+e&jp5-7*(ih_'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
Expand Down Expand Up @@ -50,7 +49,7 @@
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'server.urls'
ROOT_URLCONF = 'api.urls'

TEMPLATES = [
{
Expand All @@ -68,20 +67,16 @@
},
]

WSGI_APPLICATION = 'server.wsgi.application'
WSGI_APPLICATION = 'api.wsgi.application'


# Database
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE':os.environ.get("SQL_ENGINE"),
'NAME': os.environ.get('SQL_DATABASE'),
'USER': os.environ.get('SQL_USER'),
'PASSWORD': os.environ.get('SQL_PASSWORD'),
'HOST': os.environ.get('SQL_HOST'),
'PORT': os.environ.get('SQL_PORT'),
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}

Expand Down
2 changes: 1 addition & 1 deletion backend/server/urls.py → backend/api/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
URL configuration for server project.
URL configuration for api project.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/5.0/topics/http/urls/
Expand Down
4 changes: 2 additions & 2 deletions backend/server/wsgi.py → backend/api/wsgi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
WSGI config for server project.
WSGI config for api project.
It exposes the WSGI callable as a module-level variable named ``application``.
Expand All @@ -11,6 +11,6 @@

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'server.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'api.settings')

application = get_wsgi_application()
24 changes: 0 additions & 24 deletions backend/docker-compose.yml

This file was deleted.

2 changes: 1 addition & 1 deletion backend/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'server.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'api.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
Expand Down
66 changes: 66 additions & 0 deletions backend/poetry.lock

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

15 changes: 15 additions & 0 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[tool.poetry]
name = "backend"
version = "0.1.0"
description = ""
authors = ["Your Name <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.12"
django = "^5.0.6"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

0 comments on commit 0857689

Please sign in to comment.