KEMBAR78
Starting A Project Manage - Py Commands Git Commands: by Steven King - Unc Jschool | PDF | Software Engineering | Computing
0% found this document useful (0 votes)
59 views1 page

Starting A Project Manage - Py Commands Git Commands: by Steven King - Unc Jschool

This document provides a cheat sheet for Django beginners that summarizes key commands and file structures for starting a Django project. It outlines steps for creating a virtual environment, installing Django, setting up a project with manage.py commands, creating apps and views, enabling URLs, downloading Bootstrap for templates, and the basic request sequence. It also includes notes on Git commands and the typical file structure for templates, static files, and apps.

Uploaded by

Anuj Kaushik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views1 page

Starting A Project Manage - Py Commands Git Commands: by Steven King - Unc Jschool

This document provides a cheat sheet for Django beginners that summarizes key commands and file structures for starting a Django project. It outlines steps for creating a virtual environment, installing Django, setting up a project with manage.py commands, creating apps and views, enabling URLs, downloading Bootstrap for templates, and the basic request sequence. It also includes notes on Git commands and the typical file structure for templates, static files, and apps.

Uploaded by

Anuj Kaushik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

DJANGO [beginners] CHEAT SHEET

By Steven King | UNC jSchool

Starting a Project manage.py Commands Git Commands


Create a virtual environment $ python manage.py command options $ git command options
$ virtualenv projectname-env help init
$ . projectname-env/bin/activate startproject project name clone githuburl.git
Install Django startapp appname add filename
$ pip install Django==1.4.3 runserver rm filename
Setup Django Project shell status
$ django-admin.py startproject projectname syncdb commit
Edit settings.py validate fetch origin
bit.ly/djSetPy dumpdata push origin master
Search/Replace projectname & appname loaddata myjsonfile.json merge branchversion
PROJECT_PATH & PROJECT_ROOT collectstatic bit.ly/YlrAmK
DEBUG
DATABASES
STATIC_ROOT & MEDIA_ROOT File Structure Notes
STATIC_URL & MEDIA_URL /projectname/
TEMPLATE_DIRS /projecname/
INSTALLED_APPS settings.py
Create database
/static_media/
$ python manage.py syncdb
Run Server /css/
$ python manage.py runserver /img/
Create App /js/
$ python manage.py startapp appname
/templates/
Add to INATALLED_APPS list
Create Views base.html
views.py urls.py
Enable URLs wsgi.py
urls.py
manage.py
Create Templates
$ mkdir appname/templates projectname.db (sqlite)
Download Bootstrap /appname/
$ curl http://twitter.github.com/bootstrap/ __init__.py
assets/bootstrap.zip > bootstrap.zip
admin.py
$ unzip bootstrap.zip
$mv bootstrap/* static_media models.py
clean up /templates/
/appname/
Request Sequence (simplified) home.html
Browser tests.py
urls.py
Server
views.py

urls.py /static_media/ *
/css/
views.py /img/ NOTE: Created specifically for UNC jSchool class
JOMC 583 Advanced Journalism Programing.
/js/
Use freely with credit. Steven King | UNC Chapel Hill
templates.html only after collectstatic command www.steventking.com | @steven_king

You might also like