Giter VIP home page Giter VIP logo

effective-django's Introduction

Effective Django

This is the repository for the text Effective Django, an ongoing work in progress by Nathan Yergler. The sample code is maintained in the effective-django-tutorial repository.

Effective Django is authored using ReStructured Text and Sphinx. If you're interested in building HTML, PDF, ePub, or other generated formats, you can do so by:

  1. If you want to build PDF or ePub output, make sure LaTeX is installed on your machine. If you only care about HTML output, you can skip this step.

    For Macs, it is recommended you use MacTeX

    $ brew install Caskroom/cask/mactex
    

    If you're building on Ubuntu, you should install the texlive and texlive-latex-extra packages.

    $ sudo apt-get install texlive texlive-latex-extra
    
  2. Check out this repository:

    $ git clone --recursive https://github.com/nyergler/effective-django.git
    

    Note that in order to build Effective Django, the sample code must be cloned into the src submodule. Using --recursive will accomplish that.

  3. Create a virtualenv and install the dependencies:

    $ virtualenv .
    $ . bin/activate
    $ pip install -r requirements.txt
    
  4. Run make:

    $ make all
    

    The output will be in the _build sub-directory.

    To only build HTML, specify the target explicitly:

    $ make html
    

Run make without any parameters for a list of possible targets.

effective-django's People

Contributors

marios-zindilis avatar msabramo avatar nyergler avatar romgar avatar saex avatar therealphildini avatar thijsdezoete avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

effective-django's Issues

Could you please build a epub?

When I try to build epub on Ubuntu, some error occurred and I did install LaTeX. I still didn't figured out why.
So could you please build a epub?
Thanks.

Make fails on Mac OS X 10.8.5

The virtualenv step is ok, but make fails.

$ uname -a
Darwin harveys-MacBook-Pro-2.local 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64

$ python -V
Python 2.7.2

$ make html
./bin/sphinx-build -b html -d _build/doctrees -D latex_paper_size=letter . _build/
Running Sphinx v1.2b3
loading pickled environment... not yet created
building [html]: targets for 21 source files that are out of date
updating environment: 21 added, 0 changed, 0 removed
/Users/harvey/effective-django/lib/python2.7/site-packages/docutils/parsers/rst/states.py:2103: UserWarning: The notslides directive has been deprecated; replace with ifnotslides
result = directive_instance.run()
/Users/harvey/effective-django/lib/python2.7/site-packages/docutils/parsers/rst/states.py:2103: UserWarning: The slides directive has been deprecated; replace with ifslides
result = directive_instance.run()
reading sources... [ 61%] tutorial/additional-views
Exception occurred:
File "/Users/harvey/effective-django/lib/python2.7/site-packages/sh.py", line 348, in _handle_exit_code
self.process.stderr
ErrorReturnCode_1:

RAN: '/usr/local/bin/git checkout edit_contact_view'

STDOUT:

STDERR:
error: pathspec 'edit_contact_view' did not match any file(s) known to git.
The full traceback has been saved in /var/folders/g5/_l__wycd12jgd65s24w_1kk80000gn/T/sphinx-err-5kIkin.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
Either send bugs to the mailing list at http://groups.google.com/group/sphinx-users/,
or report them in the tracker at http://bitbucket.org/birkenfeld/sphinx/issues/. Thanks!
make: *** [html] Error 1

PDF version generation problem

I've followed the guides but i get an error for the file blockdiag (removed the line in views.rst to fix) but the pdf generated have only 41 page repsect to epub version downloadable from the site that have 140+ pages.

I don't see the code for ContactOwnerMixin

Your Contact permission example looks like exactly what I need in order to do instance level permission checking for a model. From the text, it sounds like the information I need is in ContactOwnerMixin - but I don't see the code for that class. Is that available somewhere?

Deployment docs

  • VPS (Linode, Digital Ocean?)
  • Heroku
  • EC2
  • Ansible for extra credit

Authz/n instructions don't work with Django migrations

As reported by Maciej Friedel:

I found solution on problem in Your tutorial.
in section Handling Authentication & Authorization (http://effectivedjango.com/tutorial/authzn.html)

in last contacts/models.py correction there is:

owner = models.ForeignKey(User)

but this is not correct and displaying error

because there is migration problem

% python manage.py makemigrations
You are trying to add a non-nullable field 'owner' to contact without a default;
we can't do that (the database needs something to populate existing rows).
Please select a fix:
1) Provide a one-off default now (will be set on all existing rows)
2) Quit, and let me add a default in models.py
Select an option:

the problem resolved this input:

owner = models.ForeignKey(User, null=True, blank=True, default = None)

after successful migration there can be owner = models.ForeignKey(User) but migration needed this default settings

Move hosting off on my Linode

effectivedjango.com is currently hosted on my personal linode. I'm trying to get out of the hosting business. This could easily be served from github pages or RTD.

Upgrade to Django 1.5

I want to include effective django as an additional reference in the new Appendix C of Two Scoops of Django. Unfortunately, our rule is that resources listed in that Appendix need to be 'modern', or referring to Django 1.5.

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.