mkdir -p api/admin && \
touch api/urls.py \
api/admin/__init__.py api/admin/urls.py \
api/admin/views.py api/admin/serializers.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Author: sh1mu7 | |
# Date: 2024-02-06 | |
# Description: Django deployment automation. | |
# Prompt for service name | |
# shellcheck disable=SC2162 | |
#!/bin/bash | |
#!/bin/bash | |
echo "=== Deployment Automation Script ===" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Author: sh1mu7 | |
# Date: 2024-02-06 | |
# Description: Django deployment automation. | |
# Prompt for service name | |
# shellcheck disable=SC2162 | |
read -p "Enter service name: " NAME | |
# Prompt for domain name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
from django.conf import settings | |
from coreapp.base import BaseModel | |
from delivery import constants | |
class RiderDocuments(BaseModel): | |
title = models.CharField(max_length=100) | |
documents = models.ForeignKey('coreapp.Document', on_delete=models.CASCADE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# docker-compose ym | |
version: '3' | |
services: | |
# Django application | |
web: | |
build: | |
context: . | |
dockerfile: Dockerfile | |
ports: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################## Installing Postgress ######################## | |
sudo apt update | |
sudo apt install python3-venv python3-dev libpq-dev postgresql postgresql-contrib nginx curl | |
###################### Creating SuperUser ############################ | |
CREATE ROLE user_name SUPERUSER LOGIN PASSWORD 'password'; | |
or |