Skip to content

Instantly share code, notes, and snippets.

@Lagnarok
Last active April 7, 2019 15:56
Setting up your Django project

Downloading The Django Project

To access the Django project, please follow these steps:

  1. Install Docker. Docker is available here: https://www.docker.com/products/docker-desktop. Please note that the Windows edition requires Windows Pro or Enterprise.
  2. Visit https://github.com/bribroder/django_skeleton. If you have not installed Git on your computer, visit https://git-scm.com/downloads and choose the version for your operating system.
  3. From your system terminal (if you are using Windows, use "Git Bash" instead of cmd.exe or PowerShell), navigate to the directory you want the project to live in. Note that the project will download contained in its own directory. Then run git clone https://github.com/bribroder/django_skeleton.git This will download a copy of the project.

Starting The Django Project

To start the project, first make sure that Docker is running. Then follow these steps:

  1. Navigate to the project folder in your terminal (this time, use cmd.exe if you are on Windows). It should be named django_skeleton unless you chose to name it something else.
  2. Run docker run --rm -v $(pwd):/opt/skeleton --workdir /opt/skeleton -it python:3.7.3 bash This will start a simple virtual machine and automaticall log you into it.
  3. Run pip install -e . This will install various bits of software the Django project needs to be able to function.
  4. Run python manage.py migrate This will update your copy of the project's database to the most recent available.
  5. Run python manage.py test This will run the project's test suites to make sure everything is working correctly. The output from this command should look like this:
root@[random-number]:/opt/skeleton# python manage.py test
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
Installed 5 object(s) from 1 fixture(s)
The database has 5 birds.
.The airspeed velocity of an unladen Budgerigar (Melopsittacus Undulatus) is 6.3 m/s.
.
----------------------------------------------------------------------
Ran 2 tests in 0.013s

OK
Destroying test database for alias 'default'...

References

References were primarily to make sure I was correct about deleting the dependency_links line.

  1. https://docs.djangoproject.com/en/2.1/intro/reusable-apps/
  2. https://stackoverflow.com/questions/12518499/pip-ignores-dependency-links-in-setup-py
  3. https://toxi.nu/blog/pip-installable-django-project/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment