DEV Community

Setting up a Django project like a pro

fceruti on May 28, 2019

In this article I'm gonna show you the way I layout a typical medium-to-complex django project that uses git for source control, pyenv and pipenv t...
Collapse
 
javaguirre profile image
Javier Aguirre

Hi! You sum up everything a Django project needs 🤩.

In the case of debugging from your editor, I just published a way of doing it from VS Code when running on Docker.

Thanks for your post! 🥇

Collapse
 
fceruti profile image
fceruti

Awesome, I'll check it out :)

Collapse
 
javaguirre profile image
Javier Aguirre

Please, let me know if you have any feedback! :-)

Collapse
 
sobolevn profile image
Nikita Sobolev

Amazing post! And a great set of tools!

Check out wemake-django-template, it shares the same idea and the same instruments.

GitHub logo wemake-services / wemake-django-template

Bleeding edge django template focused on code quality and security.

wemake-django-template

wemake.services Awesome Build Status Documentation Status Dependencies Status wemake-python-styleguide

Bleeding edge django2.2 template focused on code quality and security.


Purpose

This project is used to scaffold a django project structure Just like django-admin.py startproject but better.

Features

Installation

Firstly, you will need to install dependencies:

pip install cookiecutter jinja2-git

Then, create a project itself:

cookiecutter gh:wemake-services/wemake-django-template

Who are using this template?

If you use our template, please add yourself or your company in the list.

We offer free email support for anyone who is using this If you have any problems or questions, drop…

Collapse
 
fceruti profile image
fceruti

Great, I'll check it out to see if there's anything good to learn :)

Collapse
 
sobolevn profile image
Nikita Sobolev

I hope so :)

Collapse
 
devanghingu profile image
Devang Hingu

hello. actually i newbie in django. therefore i have questions that what is difference in virtualenv and pipenv.?

Collapse
 
fceruti profile image
fceruti

They are not the same, but they are related. Think of your whole computer as an environment where you can install pieces software. Because we are developing different projects, with different dependencies, if we just installed all of them in your "computer environment", they would get mixed and that would be awful.

Here comes Virtual Environments to the rescue. This is the technique of creating a sandbox for each project, where you can install dependencies without affecting the rest of your projects. pipenv is a tool to manage such environments.

Collapse
 
devanghingu profile image
Devang Hingu

can i install both at time over machine?

Thread Thread
 
fceruti profile image
fceruti

I'm not sure what you mean. Can you explain it again?

Thread Thread
 
devanghingu profile image
Devang Hingu

umm.. i mean, can i install virtualenv and pipenv both at time in my machine(on Debian based system).

Thread Thread
 
fceruti profile image
fceruti

Yes you can and you should. I think you need to review this subject with a little more depth. I suggest you read this article realpython.com/python-virtual-envi...

Collapse
 
devanghingu profile image
Devang Hingu

ok got it. thanks you..

Collapse
 
sobolevn profile image
Nikita Sobolev

Awesome!

You can take some inspiration from github.com/wemake-services/wemake-...
It has a lot of goodies as well.

Collapse
 
campbellbartlett profile image
campbellbartlett

Amazing post, heaps of detail in a simple, easy to follow manner.

TIL about pyenv - looks miles better than pip and virtualenv. I’ll be giving it a shot on my next Python project.

Collapse
 
fceruti profile image
fceruti

Thanks!

Yeah, you should, it's way easier :)

Collapse
 
abodacs profile image
Abdullah Mohammed

Great sum up 👌
Keep posting such informative articles

Collapse
 
fceruti profile image
fceruti

Thanks for the kind reply! I'm thinking about my next article. What do you think about kubernetes? Is that so.ething you are interested in?

Collapse
 
donalhunt profile image
Donal Hunt

The webpack config referenced in the article is now here: github.com/fceruti/django-starter-... (looks like it moved slightly in the repo).

Collapse
 
fceruti profile image
fceruti

Thanks for taking the time to report this issue ;)