Skip to content
This repository has been archived by the owner on Mar 30, 2019. It is now read-only.

Working with Django

dilmac edited this page Apr 11, 2018 · 3 revisions

Preliminaries

Prerequisites: Python3, pip, virtualenv, Django

  1. Python 3: For Linux and MacOS, it's pre-installed. For Windows install it here: https://www.python.org/ Make sure that you have python added to the system path.
  2. pip is a python package manager. To install, download get-pip.py here: https://pip.pypa.io/en/stable/installing/ Then run this command: python3 get-pip.py or python get-pip.py
  3. virtualenv is a tool to create isolated python environments. To install, run this: pip install virtualenv

You need to create a new virtualenv. Run this: virtualenv -p python3 envname where envname is the name of your environments. It's recommended to use the name of the project + 'env' Ex: twitterapienv

  1. Django To install it, first activate our virtualenv. Run this: source envname/bin/activate in Linux and Mac OS where envname is your virtualenv project folder. For Windows: .\envname\Scripts\activate

Install Django by typing: pip install Django==2.0.4 (as of April"18)

Disable virtualenv: deactivate

Running Django Apps

From now on you have your virtual environment set up. Every time you want to run your Django app locally, you have to activate your virtualenv first.

For Linux, Mac OS: source envname/bin/activate where envname is your virtualenv project folder.

For Windows: .\envname\Scripts\activate

Navigate to the folder that contains manage.py file. Now you can run Django development server: python manage.py runserver 8000 where 8000 is port number. You can view the result by typing localhost:8000 to a browser.

Deploying Django

Make sure that you've checked here: https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/

Resources

Meeting Notes

Team Members

Researches

Templates

Clone this wiki locally