Skip to content

Commit

Permalink
feat: updated code base
Browse files Browse the repository at this point in the history
  • Loading branch information
syedfaiqueali committed Jul 17, 2024
1 parent 3936674 commit 60551a4
Show file tree
Hide file tree
Showing 59 changed files with 1,729 additions and 1,834 deletions.
6 changes: 0 additions & 6 deletions .env.sample

This file was deleted.

11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM python:3.9-alpine3.13
LABEL maintainer="github.com/faiqueali017"
FROM python:3.10-alpine3.19
LABEL maintainer="koderlabs.com"

ENV PYTHONUNBUFFERED 1

Expand All @@ -11,9 +11,10 @@ WORKDIR /app
EXPOSE 8000

ARG DEV=false
RUN python -m venv /py && \
RUN apk update && \
python -m venv /py && \
/py/bin/pip install --upgrade pip && \
apk add --update --no-cache postgresql-client jpeg-dev && \
apk add --update --no-cache postgresql-client && \
apk add --update --no-cache --virtual .tmp-build-deps \
build-base postgresql-dev musl-dev zlib zlib-dev linux-headers && \
/py/bin/pip install -r /tmp/requirements.txt && \
Expand All @@ -36,4 +37,4 @@ ENV PATH="/scripts:/py/bin:$PATH"

USER django-user

CMD ["run.sh"]
CMD ["run.sh"]
52 changes: 34 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Elevate-BE

# Django-base-code

This repo contains ready-to use base code for django applications.

This repo contains code base code for django.

## Features

Expand All @@ -11,19 +9,14 @@ This repo contains ready-to use base code for django applications.
- PostgreSQL
- Docker
- Ready to deploy configs
- Github Actions
- Swagger (API Docs)
- Ready to use as a base code
- Usage Examples
- Example:01 - Recipe, Ingredients, Recipe-Tags APIs
- Example:02 - *[Work in Process]* E-commerce APIs

- Bitbucket pipelines

## Prerequisites

- Python 3.9
- Python 3.10
- Docker
- VScode

## How to use?

**To build docker image**
Expand All @@ -44,15 +37,42 @@ This repo contains ready-to use base code for django applications.
docker-compose down
```

**To create new app**

```bash
docker-compose run --rm app sh -c "python manage.py startapp <app-name>"
```

**To migrate database schema**

```bash
docker-compose run --rm app sh -c "python manage.py makemigrations"
docker-compose run --rm app sh -c "python manage.py migrate"
```

**To create superuser**

```bash
docker-compose run --rm app sh -c "python manage.py createsuperuser"
```

**To execute tests**

```bash
docker-compose run --rm app sh -c "python manage.py test"
```
## Authors

- [Faique Ali](https://www.github.com/faiqueali017)
**To check linting**

```bash
docker-compose run --rm app sh -c "flake8"
```

**To format code**

```bash
docker-compose run --rm app sh -c "black ."
```

## Contributing

Expand All @@ -64,7 +84,3 @@ Contributions are always welcome!
- Open a Pull Request

Please adhere to this project's `code of conduct`.
## 🔗 Connect Me
[![Gmail](https://img.shields.io/badge/Gmail-D14836?style=for-the-badge&logo=gmail&logoColor=white)](mailto:[email protected])

[![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/faique-ali/)
8 changes: 5 additions & 3 deletions app/.flake8
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

[flake8]
exclude =
migrations,
__pycache__,
manage.py,
settings.py
settings.py,
migrations,
manage.py

max-line-length = 88
4 changes: 2 additions & 2 deletions app/app/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
https://docs.djangoproject.com/en/5.0/howto/deployment/asgi/
"""

import os

from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.settings")

application = get_asgi_application()
Loading

0 comments on commit 60551a4

Please sign in to comment.