GithubHelp home page GithubHelp logo

django-docker-full's Introduction

Django Docker Full - by osw4l

enter image description here

It is a beautiful Django image simple to configure, run and deploy, it was made with a lot of love and dedication for all human beings who love simple things.

this project contains the next libraries

and more pretty stuff like

  • Docker compose
  • Daphne
  • UWSGI (no gunicorn)
  • Postgis as Database
  • Geo Django
  • Leaflet and Google Maps
  • Django Admin Themes
  • Celery Worker and Celery Beat
  • Nginx with django static files support
  • Static files working fine !
  • AWS S3 Storage
  • Natural structure, like you weren't using docker
  • Production deploy steps click here

Django Rest Framework Swagger

the project contains its own auth backend with register, login and reset password

enter image description here

Each endpoint contains its own serializer and swagger collection enter image description here

enter image description here

if you want to disable the register and the confirmation after register you have to go to setup in the admin

http://localhost:4500/admin/

Go to main and then go to setup

enter image description here

enter image description here Now go to the detail

I'll disabled the register for now

enter image description here

Then if I try to register in the register endpoint this gonna be the result

enter image description here

Django Google Maps Widget

enter image description here

Django Leaflet

enter image description here

enter image description here

Django Admin custom themes by django-admin-interface

enter image description here

Custom Commands

enter image description here

to use the custom commands just give permissions

Command to collect Statics

chmod +x run_collect_static.sh

Command to make migrations and migrate

chmod +x run_migrate.sh

Command to create super user

chmod +x run_create_user.sh

Command to load django admin themes

chmod +x run_theme.sh

Simple and beautiful structure

enter image description here
to run the image follow the next instructions, just for local environment

Create Environment file

cp env_template .env

Build image

docker-compose build

Up image

 docker-compose up -d

Migrations

you can create migrations and migrate the new models changes using the custom commands

this command just run migrate command

 docker-compose exec backend python3 manage.py migrate

this command just run makemigrations and migrate commands

./run_migrate.sh

Restart Celery Beat

 docker-compose restart beat

Create Superuser

command

docker-compose exec backend python3 manage.py createsuperuser

sh file

./run_create_user.sh

collect statics

this command just works in local doesn't work in production

docker-compose exec backend python3 manage.py collectstatic    

this command works in local and production

sh file

./run_collect_static.sh

Load Django Admin Themes

./run_theme.sh

Pycharm Support first, we need to setup the common stuff to active the autocomplete adding the Django Support choosing the manage.py and settings.py files location.

enter image description here
now we need add the python interpreter what live inside the docker container to the project

Go to preferences and to click in Interpreter then in Project Interpreter and press add

enter image description here
now, do click in Docker, select the image what contains the project name, then write python3 and press ok

enter image description here
press apply and ok, done!.

enter image description here
now we have configured the interpreter what lives inside our Docker Container in our project

Please, DON'T UPDATE THE DEPENDENCIES ! unless necessary

if you wanna deploy this project in production, go to here

Thanks for using my project, if you need something else, feel you free to contact me [email protected]

Enjoy the project ๐Ÿฅณ ๐ŸŸก ๐Ÿ”ต ๐Ÿ’› ๐Ÿ’™ ๐Ÿ’Ÿ

django-docker-full's People

Contributors

osw4l avatar

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.