Skip to content

Instantly share code, notes, and snippets.

@andrew-rietz
Last active April 24, 2019 05:59
Show Gist options
  • Save andrew-rietz/1c2530940331d084e273ade204af1540 to your computer and use it in GitHub Desktop.
Save andrew-rietz/1c2530940331d084e273ade204af1540 to your computer and use it in GitHub Desktop.
Django Project Setup
Optional:

A. Set up a virtual environment to house your projects dependencies

$ virtualenv <<venv_name>>
$ source <<venv_name>>/bin/activate

B. Install Django

$ pip install django

Django Setup

https://docs.djangoproject.com/en/2.2/intro/tutorial01/

  1. Navigate into a directory where you want to create a project, then run:
$ django-admin startproject <<mysite>>

This will create a <> directory in the current directory. To initialize a project in an existing directory, use the command:

$ django-admin startproject <<mysite>> .
  1. Verify the Django project works. Run:
$ python manage.py runserver

Note: ignore the warning about unapplied database migrations for now.

  1. Visit http://127.0.0.1:8000/ in your web browser(http://localhost:8000/) and confirm that the default Django page is loaded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment