Coder Social home page Coder Social logo

mu-team / django-project-template Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 13 KB

Common Django project template for MUTeam existing and future projects.

License: MIT License

Python 53.88% Shell 43.73% Dockerfile 2.39%
django django-template-project

django-project-template's Introduction

Django Project Template

Common Django project template for MU-Team existing and future projects.

Installation

echo -n "Project name: "   && read PROJECT_NAME
git clone https://github.com/mu-team/django-project-template.git ${PWD}/${PROJECT_NAME}
cd ${PWD}/${PROJECT_NAME}

echo -n "Git user name: "  && read GIT_USER
echo -n "Git user email: " && read GIT_EMAIL
echo -n "Origin url: "     && read ORIGIN

git config --local user.name  ${GIT_USER}
git config --local user.email ${GIT_EMAIL}
git remote set-url origin     ${ORIGIN}

git add .
git commit -m "Initial commit"
git push -u origin master

# after activation python virtualenv
scripts/dev_setup.sh

System requirements

python --version >= 3.4.0

The project template hierarchy

- docker/*                   # all docker integration files, except `.dockerignore`
- requirements/
              / - common.txt # common dependencies for development and production environments
              / - dev.txt    # only for development environment
              / - prod.txt   # only for production environment
- src/
     / - apps/*              # all user-defined apps collect here (via `./manage.py startapp`)
     / - project/*           # all project-wide configuration (settings, urls, etc.) collect here
     / - static/*            # all static sources collect here (js, css, etc.)
     / - templates/*         # all common/non-standard templates collect here
- static/*                   # `./manage.py collectstatic` root directory
- manage.py                  # project controls

Conventions

  1. The different settings for the development/production environment are placed in local.example.py with --PLACEHOLDER--. Specific values are specified in local.py. Example: DEBUG = '--DEBUG -' --> DEBUG = True.
  2. All user-defined apps must be placed in apps directory. Example: mkdir -p src/apps/core && ./manage.py startapp core src/apps/core.
  3. Installed apps must be separated by INSTALLED_APPS, THIRD_PARTY_APPS, PROJECT_APPS. INSTALLED_APPS contains only django core apps.

Docker support

Supported by docker and docker-compose as ready-to-update services. Need to specify -f on each docker-compose or docker command.

docker-compose -f docker/docker-compose.yml up --build
docker-compose -f docker/docker-compose.yml down

Useful scripts

  1. Setup development environment from scratch:
scripts/dev_setup.sh

django-project-template's People

Contributors

therenotomorrow avatar

Stargazers

 avatar

Watchers

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