All Projects → codingforentrepreneurs → CFE-Blank-Project

codingforentrepreneurs / CFE-Blank-Project

Licence: MIT license
A blank Django Starter Project that includes Docker support.

Programming Languages

python
139335 projects - #7 most used programming language
Dockerfile
14818 projects
shell
77523 projects

Projects that are alternatives of or similar to CFE-Blank-Project

restrictfe
TYPO3 extension restrictfe. Blocks access to frontend and allows to show it only to some defined exception's like if the request is from an authorized backend user, has specific IP, header etc.
Stars: ✭ 12 (-29.41%)
Mutual labels:  development, production
dwoole
⚙️ Docker image for Swoole apps with Composer, auto-restart on development and a production-ready version.
Stars: ✭ 32 (+88.24%)
Mutual labels:  development, production
Dotenv Flow
Loads environment variables from .env.[development|test|production][.local] files for Node.js® projects.
Stars: ✭ 537 (+3058.82%)
Mutual labels:  development, production
Checklist Going Live
The checklist that is used when a project is going live
Stars: ✭ 1,334 (+7747.06%)
Mutual labels:  production, project
Bitnami Docker Node
Bitnami Node.js Docker Image
Stars: ✭ 111 (+552.94%)
Mutual labels:  development, production
emptyproject-flow
Empty project: Flow
Stars: ✭ 77 (+352.94%)
Mutual labels:  project
soft-skills
🍦List of Soft Skills for software engineers/developers.
Stars: ✭ 36 (+111.76%)
Mutual labels:  development
devproxy
A local development http proxy with hosts spoofing written in Go
Stars: ✭ 35 (+105.88%)
Mutual labels:  development
todo-cli
✅ Command-line tool to manage Todo lists
Stars: ✭ 88 (+417.65%)
Mutual labels:  project
Plant-Disease-Identification-using-CNN
Plant Disease Identification Using Convulutional Neural Network
Stars: ✭ 89 (+423.53%)
Mutual labels:  project
go-askme
My GoLang learning journey by building an AskFm clone
Stars: ✭ 96 (+464.71%)
Mutual labels:  project
AROS
www.axrt.org
Stars: ✭ 33 (+94.12%)
Mutual labels:  development
cxfuse
Crossmeta FUSE Windows Port
Stars: ✭ 55 (+223.53%)
Mutual labels:  development
errors
errors with paired message and caller stack frame
Stars: ✭ 19 (+11.76%)
Mutual labels:  production
Medi-Consult
Diseases Checker Application 🚑 | Android Application
Stars: ✭ 38 (+123.53%)
Mutual labels:  project
ar-simulation
AR Simulation for Unity • Right in the Editor • Minimally Invasive
Stars: ✭ 101 (+494.12%)
Mutual labels:  development
charpente
Seamlessly design robust 'shiny' extensions
Stars: ✭ 36 (+111.76%)
Mutual labels:  development
flutter ume
UME is an in-app debug kits platform for Flutter. Produced by Flutter Infra team of ByteDance
Stars: ✭ 1,792 (+10441.18%)
Mutual labels:  development
call
Make remote development more elegant
Stars: ✭ 20 (+17.65%)
Mutual labels:  development
tmpo
Command line interface to create new workspaces based on templates
Stars: ✭ 25 (+47.06%)
Mutual labels:  project

Create a Blank Django Project Logo

CFE Blank Project

This is a blank Django project that can be used as a starting point for any Django project. It includes related Docker and Docker Compose configuration for local development with Postgres and Redis.

We'll continue to refine this project based on requests from people like you. If you have any suggestions or want to submit ideas, please do so on github discussions.

Reference blog post coming soon.

Get Started

Clone project

mkdir -p ~/Dev/your-project
cd ~/Dev/your-project
git clone https://github.com/codingforentrepreneurs/CFE-Blank-Project .

Create a Python Virtual Environment

Using Python 3.11, create a virtual environment using the built-in venv module:

macOS/Linux:

python3.11 -m venv venv
source venv/bin/activate
$(venv) python --version

Windows:

c:\>Python311\python -m venv venv
.\venv\Scripts\activate
(venv) > python --version

If you're on Windows, consider install Python using this guide or this blog post.

Install requirements

$(venv) python -m pip install -r src/requirements.txt

Configure Environment Variables

In src/.env add:

DJANGO_DEBUG=True
DJANGO_SECRET_KEY=your-secret-key
ALLOWED_HOSTS=.codingforentrepreneurs.com,.cfe.sh,localhost,127.0.0.1

You can generate a Django Secret Key with (reference post) the following:

$(venv) python -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())'

Various Django Commands

Below are a few commands that will work for this configuration both before and after using the database configuration and the docker-compose-based configuration below.

$(venv) python manage.py makemigrations
$(venv) python manage.py migrate
$(venv) python manage.py createsuperuser

Configuring for Postgres Database

In src/cfehome/db.py you will see a Postgres database configuration based on available environment variables. Do not change the variable names without changing several other configurations (at least src/cfehome/db.py, docker-compose.yaml).

Update .env or your environment variables to include the following configuration

POSTGRES_USER=...
POSTGRES_PASSWORD=...
POSTGRES_DB=...
POSTGRES_HOST=localhost
POSTGRES_PORT=5432

You can also set POSTGRES_DB_REQUIRE_SSL=True if you want to require SSL connections to the database.

Using Docker Compose for Postgres and Redis

Assuming you have the POSTGRES environment variables set, you can use Docker Compose to create development Postgres database for your project.

To start the Postgres database and Redis, run:

docker compose -f docker-compose.dev.yaml up -d

This sets our Postgres database to be available at localhost:5432 and Redis at localhost:6379.

To stop and remove your Postgres database and Redis, run:

docker compose -f docker-compose.dev.yaml down

Use docker compose -f docker-compose.dev.yaml down -v to remove the volumes as well.

If you need to learn about how to use Docker & Docker Compose, consider this course.

Docker Image for Django Local Development

To build the Docker image, run:

docker build -t cfe-blank-project .

Update POSTGRES_HOST in .env to use host.docker.internal if you are using the local docker-compose Postgres database.

To run the Docker image locally, run:

docker run --network cfe_blank_network -p 8000:8000 -e  -e PORT=8000 --env-file src/.env cfe-blank-project --name cfe-blank-project 

To stop the Docker container, run:

docker stop cfe-blank-project

In this case cfe-blank-project is the name of the container we set in the previous command with --name cfe-blank-project.

Production Configuration

Would you like this project to be augmented for a minimal production environment as well? If so, please start a discussion requesting so.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].