Skip to content

Instantly share code, notes, and snippets.

@rodolfobandeira
Last active December 21, 2017 03:00
Show Gist options
  • Save rodolfobandeira/06d8afd52f204a254ca083912596ef41 to your computer and use it in GitHub Desktop.
Save rodolfobandeira/06d8afd52f204a254ca083912596ef41 to your computer and use it in GitHub Desktop.
Install Django on Ubuntu

pip install virtualenv

cd ~

virtualenv newenv

cd newenv

source newenv/bin/activate

pip install django

django-admin --version

django-admin startproject django_studies

cd django_studies

python manage.py migrate

python manage.py createsuperuser

vim django_studies/settings.py (Add 127.0.0.1 to ALLOWED_HOSTS)

cd ..

python manage.py runserver 127.0.0.1:8000

Create an app: python manage.py startapp polls


To deactivate virtualenv: deactivate

To activate again: source newenv/bin/activate


Reference: https://www.digitalocean.com/community/tutorials/how-to-install-the-django-web-framework-on-ubuntu-16-04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment