Code Monkey home page Code Monkey logo

dockerize-django-with-nextjs's Introduction

Dockerize Django with Nextjs

A Bootstrapped Template of Django with Nextjs using Docker!

Stack

  • Next Js - The React Framework for the Web.
  • Django - Django makes it easier to build better web apps more quickly and with less code.
  • Typescript - JavaScript with syntax for types.
  • Docker - Docker is a platform designed to help developers build, share, and run modern applications. We handle the tedious setup, so you can focus on the code.
  • Nginx - Advanced Load Balancer, Web Server, & Reverse Proxy.

Project structure

$PROJECT_ROOT
│  
├── apps/web  # Django Backend
│  
├── apps/docker  # Docker files for web, www, nginx
│  
├── apps/www  # Nextjs App
│   
├── apps/web/requirements # Python Requirements
│
├── app.py # Entry Point for Django Backend
│
├── apps/web/manage.py # Run Django Commands
│
├── apps/www/package.json # npm commands.

Get the Code

  • Clone Repo
mkdir dockerize-django-with-nextjs
cd dockerize-django-with-nextjs
git clone https://github.com/codingforinnovations/dockerize-django-with-nextjs .
  • Using Docker
docker-compose up --build

Open Django Server in : http://0.0.0.0:8000

Open Django Admin in : http://0.0.0.0:8000/admin

Open Nextjs Server in : http://0.0.0.0

Manual Way:

For Django:

  • Create Virtual Environment for Python
pip install virtualenv
python -m venv .
  • Activate Virtual Environment
source Scripts/activate

Window Users use: .\Scripts\activate

  • Install Dependencies
pip install -r apps/web/requirements.txt
  • Make Migrations
python manage.py apps/web/makemigrations
python manage.py apps/web/migrate

For Frontend

  • Install Dependencies
npm install --prefix apps/www
  • Run Dev Server
npm run dev
  • Now for Bundling Your Frontend
npm run build

LICENSE:

MIT LICENSE .

Change Log:

Change Log .

dockerize-django-with-nextjs's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.