Giter Club home page Giter Club logo

django-docker-template's Introduction

Print Back End

Prerequisites

  • Install python3
  • Install docker
  • Install docker-compose

Installation

  • $ sh scripts/docker_init.sh => To create postgres directory and build docker container
  • change 'sample.env' to '.env' (optional change values)
  • $ docker-compose up => To compose up docker containers
  • $ sh scripts/enter-container.sh => To enter docker web container
    • $ sh scripts/initial_db_setup.sh => To set up docker for the first time OR (if the command above does not work)
    • $ python3 manage.py createsuperuser => To create a super user
  • $ exit => To leave container
  • $ python3 -m venv venv => To create a virtualenv
  • $ source venv/bin/activate => To activate virtualenv
  • $ pip install -r requirements.txt => To install dependencies
  • $ pre-commit install => To install git hooks

Getting Started

Workflow

Create New App

  • $ cd config
  • $ python3 manage.py startapp <app_name> => To create a new app
  • create urls.py file and add routes
  • create models in models.py
  • create a serializers.py file and add serializers there
  • add views to views.py
  • register models in admin.py
  • write your tests in tests.py
  • include your app urls in config/urls.py

Info Commands

$ python3 manage.py show_urls => To show all existing urls (See https://github.com/django-extensions/django-extensions for more commands)

Conventional Commits

  • This project uses conventional commits
  • ex: $ git commit -a -m"<type>[optional scope]: <description>"
  • feat: introduces a new feature to the codebase (this correlates with a MINORin SemVer es: 2.0.0 -> 2.1.0).
  • fix: a bugfix in your codebase (this correlates with a PATCH in semVer es: 2.0.0 -> 2.0.1).
  • BREAKING CHANGE: is a total change of your code, this is also can be used with a previous tag like BREAKING CHANGE: feat: (this correlates with a MAJOR in SemVer es: 2.0.0 -> 3.0.0).
  • docs: a change in the README or documentation refactor: a change in production code focused on upgrade code readability and style
  • Try out the conventional commits vscode extension

Changelog

  • python-semantic-release
  • $ semantic-release publish --<patch|minor|major|prerelease|prerelease-patch>
    • Updates CHANGELOG.md from conventional commits
    • Increments version number in setup.py

Testing

  • $ python3 manage.py test => To run tests

Helpful Links

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.