Giter VIP home page Giter VIP logo

django-book's People

Contributors

abdelouahabb avatar askedrelic avatar eraldo avatar esacteksab avatar mariuz avatar michelleglauser 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-book's Issues

No module name import

Hello,
I started the Django Book and I continue to get:

' ~\Python35-32\python.exe: No module named import'

errors.

I used an alias= in git bash to set 'python' to run python.exe. I'm getting the 'No module named' error types when I run:

$django-admin.py startproject mysite'
'$ python -m manage.py runserver'

Here is an example of another error:

TR mysite$ python manage.py runserver
C:\Users\TR\AppData\Local\Programs\Python\Python35-32\python.exe: can't open file 'manage.py': [Errno 2] No such file or directory

Thanks for the help,

TR

[Question] mention @login_required decorator in chapter08?

https://github.com/esacteksab/django-book/blob/master/en/chapter08.rst

def my_view2(request):
    if not request.user.is_authenticated():
        return HttpResponseRedirect('/accounts/login/')
    # ...
    return render_to_response('template2.html')

Seems more elegant to do

@login_required(login_url='/accounts/login')
def my_view2(request):
    return render_to_response('template2.html')

https://docs.djangoproject.com/en/1.4/topics/auth/

BTW, the login_url for the decorator is new in 1.3

[Question] render instead of render_to_response in Chapter 4?

https://github.com/esacteksab/django-book/blob/master/en/chapter04.rst

Chapter 4 mentions render_to_response, but doesn't mention RequestContext in the render_to_response

New in 1.3 (isn't this book only up to 1.2?) is render, a shortcut (and IMO is awesome!)

https://docs.djangoproject.com/en/1.4/topics/http/shortcuts/

Not knowing the targeted audience, intended purpose, etc. etc. I don't know if you want to expose short cuts or if there is a reason/want/desire to do it the "old" way?

render() instead of render_to_response()

It seems that it is time to switch the template from render_to_response() to render() i was going to pull the update, but the problem is that it needs more talk about, since earlier in the chapter render() is used in command line, so the reader will be confused?

A Question about scope

There is the "Django" way, and then there is the "better" way perhaps (better is subjective I realize).

Could/Would there be a book to discuss commonly-used/recommended plug-ins?

Perhaps something like:

django-crispy-forms
django-floppy-forms
django-thumbs
django-user-account (or django registration)

Stuff that just makes Django developer's lives easier? Just thinking out loud.

Chapter 7: Forms

Running Forms examples as instructed results in csrf errors.

Needed to include {% csrf_token %} in template and

return render_to_response('contact_form.html', {'form': form},
        context_instance=RequestContext(request))

to views.py for this to work.

Chapter 5: Models - Installing the Model

When installing the Books app, the tutorial says to install it as so

INSTALLED_APPS = (
    # 'django.contrib.auth',
    # 'django.contrib.contenttypes',
    # 'django.contrib.sessions',
    # 'django.contrib.sites',
    'mysite.books',
)

this can't find books and so I believe it should be

INSTALLED_APPS = (
    # 'django.contrib.auth',
    # 'django.contrib.contenttypes',
    # 'django.contrib.sessions',
    # 'django.contrib.sites',
    'books',
)

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.