Code Monkey home page Code Monkey logo

django-template's Introduction

Django Project Template

This template is my own personal (evolving) preference. You may do wahtever you wish with it (see the license) without mentioning that I even exist.

Template includes

included django modules (see requirements.txt):

  • south
  • werkzeurg
  • django-compressor
  • django-appconf
  • django-devserver
  • guppy
  • sqlparse
  • wsgiref
  • six

How to use this template

Preliminary requirements

  • Install python 2.7X. NB: install python-devel if you're using a package manager such as apt-get. The following command should print a path (if this command raises an exception, make sure that you have the python-devel version installed):

  •       python -c 'from distutils.sysconfig import get_makefile_filename as m; print m()'
    
  • Install gcc (OSX users: installing the OSX developer tools is probably the easiest way to do this). The following command should not throw an error:

      gcc -v  
    
  • Install pip; here are pip's installation instructions. The following command should not throw an error:

      pip -V
    

Creating a virtual environment

  1. install virtualenv pip install virtualenv (you may need to instead run sudo pip install virtualenv)

  2. create a top-level (container) project directory in a desired location, e.g. mkdir -p ~/MyProjects/<project container name>

  3. go to the top-level directory cd ~/MyProjects/<project container name>

  4. initialize a virtual environment in this directory

     virtualenv --no-site-packages .
    
  5. activate your virtual environment

     source bin/activate 
    

creating your project with this template

  1. install django

     pip install django>=1.6
    
  2. rerun your virtual env script

     source bin/activate 
    
  3. from within the container directory run # TODO why isn't this chaning the dir names?

     django-admin.py startproject --template=https://github.com/cjrd/django-template/archive/master.zip <project name>
    
  4. go into the project directory

     cd <project name>
    
  5. install the dependencies

     pip install -r requirements.txt
    
  6. copy the local settings file

     cd  <project name>/<project name>; cp settings_local_template.py settings_local.py; cd ..
    
  7. add the project directory to your virtualenv PYTHONPATH

     echo "PYTHONPATH=.:$PWD:$PYTHONPATH" >> ../../bin/activate
    
  8. reset your environment

     source ../../bin/activate
    
  9. sync the databse

     python manage.py syncdb
    
  10. run the server

     python manage.py runserver
    
  11. navigate to test page http://127.0.0.1:8000

django-template's People

Contributors

cjrd avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.