Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Setting Up Django For Collaboration
Jimmy McBride
Jimmy McBrideSubscriber

Posted on

     

Setting Up Django For Collaboration

Here's a quick and simple tutorial on how to start a new Django project and get it ready to collaborate with others!

In this quick and easy tutorial we will:

  • 1) Set up a new Django project
  • 2) Use pipenv for dependency management
  • 3) Upload our project to GitHub

Prerequisites

You're computer most like already has python installed. You can check by runningpython --version orpython3 --version. If it's not installed,download the latest version of python 3.x.

Once you have ensured python is installed, we just need to install 2 global dependencies. Runpip install django pipenv. Now we are ready to go! If you want to know more, feel free to check out the docs fordjango andpipenv as well!

Create Django Project

This step is easy enough! All we need to do is run this command in the folder where we want to create our Django project inside of:django-admin startproject my_project_name Note that-'s will not work here. Our project name must be in snake_case (like most things in python). This will create a new folder, in our cases, namedmy_project_name.

We can cd inside or open our project up in our favorite IDE (Pycharm for the win!). And there we have it! Our Django project is set up and ready to go. There are a few more commands we can run to setup our project before we get started.

  • python manage.py migrate tomigrate our database schema for us.
  • python manage.py createsuperuser to create a user we can use to log into the admin panel.

Setup Pipenv

Pipenv is an amazing tool we can use to setup version control. This allows us to easily save our python dependency versions so that others can others can clone our project and create an environment that downloads the same versions on dependencies we use so that nobody's project breaks because decency versions are out of sync.

  • pipenv --python 3.X replace x with the specific version, like 3.11 for example.
  • pipenv shell to activate the environment.
  • pipenv install django because while Django is installed globally, it is not installed in our fresh pipenv environment.

Push Project to GitHub

Create a totally blank repository on GitHub with the same name as the project you created and copy the ssh url for it (unless your on windows, then do https). If you need help setting up ssh,GitHub has great documentation on how to set it up!

The blank repository will have all the docs you need to push your project up to GitHub, and now you're all set! You project is not only visible to the world, but anybody can download your project and use pipenv to install the right dependencies from your Pipfile.lock withpipenv sync

Conclusion

If you enjoyed this content and want to see more Django tutorials like, comment and subscribe to let me know you want more!

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Full Stack Web 🕸️ Android Dev 🤖 Linux Wizard 🧙‍♂️ Crafting cutting-edge apps 🚀 Kotlin & Jetpack enthusiast ✨ Forever learning & evolving 🌱
  • Location
    Kyle, Texas
  • Education
    Lambda School
  • Work
    Senior Android Developer
  • Joined

More fromJimmy McBride

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp