Skip to content

Latest commit

 

History

History
96 lines (67 loc) · 3.19 KB

README-EN.md

File metadata and controls

96 lines (67 loc) · 3.19 KB

Django boilerplate

Django boilerplate to start new projects. Based on 7ws logfreak project.

In the age of web application using React and stuff, we still believe that there is good use cases for a "bare metal" Django project. So with that in mind, we created this boilerplate which uses a basic Django structure with some tweaks.

What this boilerplate is using?

  • Python +3.6
  • Django 3.0.8
  • Pytest - Helps you write better programs
  • Bower - A package manager for the frontend
  • Poetry - Python packaging and dependency management
  • Bootstrap 4.5 - the world’s most popular framework
  • pre-commit - Framework to manage and run some git commit hooks:

What is next?

  • mypy
  • Set up Docker for production
  • Finish Heroku setup

How to use - without docker

First you will need to install Django so that you have the django-admin command available. Activate your virtual env and run pip install Django==3.0.8. Now inside the directory where your project will live, run the following command:

django-admin startproject project_name --template=https://github.com/dunderlabs/django-boilerplate/archive/main.zip

When the above command finishes, you should make a new copy of the example.env file renaming this new copy with .env. Inside this new new you can change the environment variable values as you need.

After that, all the files from this repo will be inside the directory you created previously. Now to fully install all the requirements, you can just run:

$ make local-install-requirements

If you want to update your requirements, this is the command:

$ make local-update-requirements

Now, let's install the frontend dependencies with:

$ make local-setup-frontend

And start the server:

$ python manage.py runserver

Running the tests

It's as easy as just:

$ make local-test-all

How to use - with docker

Firstly make sure you have Docker and Docker Compose installed on your machine. After that the second step is to build the project, where docker will pull the images to be able to execute our commands. So in order to build it you can run:

make docker-build

When it is finished, you will be ready to run the project using the following commmand:

make docker-up

We also created a shortcut in bin/run that you can use to run commands. For example, to run migrate:

./bin/run python manage.py migrate

If you just run ./bin/run it will start the development server.

How to contribute?

Report bugs in our issues or just fork this project and submit a PR with improvements! 😃