Git Product home page Git Product logo

docker-ci's Introduction

Django project

Project structure

The main django app is called app. It contains .env file for django-environ. For examples see src/app/.env.ci. Here are some usefull app-wide tools:

Django user model is located in the separate users app.

Also, feel free to add as much django apps as you want.

Installing on a local machine

This project requires python 3.8. Deps are managed by pip-tools

Install requirements:

$ pip install --upgrade pip pip-tools
$ make

Run the server:

$ cd src && cp app/.env.ci app/.env  # default environment variables
$ ./manage.py migrate
$ ./manage.py createsuperuser
$ ./manage.py runserver

Testing:

# run lint
$ make lint

# run unit tests
$ make test

Development servers:

# run django dev server
$ ./manage.py runserver

Backend Code requirements

Style

  • Obey django's style guide.
  • Configure your IDE to use flake8 for checking your python code. For running flake8 manualy, do cd src && flake8
  • Prefer English over your native language in comments and commit messages.
  • Commit messages should contain the unique id of issue they are linked to (refs #100500)
  • Every model and a model method should have a docstring.

Code organisation

  • KISS and DRY.
  • Obey django best practices.
  • No logic is allowed within the views or serializers. Only models and services. When a model grows beyond 500 lines of code — create a service for that.
  • Use PEP-484 type hints when possible.
  • Prefer composition over inheritance.
  • Prefer Manager methods over static models methods.
  • Do not use signals or GenericRelations in your own code.
  • No l10n is allowed in python code, use django translation.

docker-ci's People

Contributors

f213 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.