Giter VIP home page Giter VIP logo

django-skeleton's Introduction

Django Skeleton by ImustAdmit

Main features ๐Ÿ’€

Contains ready-to-go files for working with poetry, tox, pytest, pre-commit, django-debug-toolbar, pytest-cov, separated settings (base/local/test/production) with choice about hiding sensitive data and Users app (as recommended by Django).

How to use it? ๐Ÿ’€

  • Initializing poetry with django as dependency and installing.
$ poetry init --no-interaction --dependency django
$ poetry install
  • Starting project.
$ poetry run django-admin startproject --template https://github.com/ImustAdmit/django-skeleton/archive/main.zip \
--name=config.json,pyproject.toml,pytest.ini,.flake8 <your-project-name>
  • Remove unnecessary environment.
$ poetry env list

this will show you the venv for that dir

$ poetry env remove whatever-It-Shows-py3.8
  • Now move file poetry.lock from main folder to newly created with command django-admin. Copy content of pyproject.toml and paste into newly created. Delete copied file.

  • Creating virtual environment using poetry and adding required packages.

$ cd <your-project-name>
$ poetry install
$ poetry add -D pre-commit pytest-django  pytest-pythonpath factory-boy pytest-cov tox django-debug-toolbar
$ poetry add psycopg2
  • Go to base settings (project_name/conf/settings/base.py) and choose wheter you want to hide sensitive settings in config.json or in the environment.

Required data: NAME_DB = database name (project name by default) USER_DB = username-access to database PASS_DB = user password-access to database

Extra data: HOST_DB = database host PORT_DB = database port

  • Prepare project to run.
$ cd <your-project-name>
$ poetry run python manage.py makemigrations
$ poetry run python manage.py migrate
$ poetry run python manage.py collectstatic

Additional info ๐Ÿ’€

  • Running tests and coverage.
$ poetry run pytest
$ poetry run pytest --cov
  • Installing pre-commit hook.
$ git init
$ poetry run pre-commit install
$ poetry run pre-commit run --all-files
  • Running tests & pre-commit hooks.
$ poetry run tox

django-skeleton's People

Contributors

adamszustak avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 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.