django current project 2016

django project notes 2017

From October 10-17-16

trying to get queryset to give me data for template. right now it is returning object.\

should work with database layers from geoserver

from: querysets are lazy:

QuerySets are lazy¶

QuerySets are lazy – the act of creating a QuerySet doesn’t involve any database activity. You can stack filters together all day long, and Django won’t actually run the query until the QuerySet is evaluated. Take a look at this example:

q = Entry.objects.filter(headline__startswith="What")
q = q.filter(pub_date__lte=datetime.date.today())
q = q.exclude(body_text__icontains="food")
print(q)

manager names

Look into using: ipython with notebook-django

this looks similar to what I might want to do. Not sure I have tried it yet or not…..

link to question with answer

https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/django-users/NbnfsEt-yvQ/go9_IJsZPQAJ

more of the same

more about ipython with django

ipython notebook ssh remote

class based views

Still getting:

vsigns:

<bound method Template.render of <django.template.backends.django.Template object at 0x7fa686db4b70»

testint:

<bound method Template.render of <django.template.backends.django.Template object at 0x7fa686dbbdd8»

phone:

<bound method Template.render of <django.template.backends.django.Template object at 0x7fa686dbbd68»

from django import template
return render_to_response('cart/cart_summary.html', {'cart': cart}, context_instance = template.RequestContent(request))

Working

Basic project ~/python/info working now after I worked out some syntax errors.

Today 10-24-16 added bootstrap to project and made a base.html to put templates inside.

Also added debug toolbar but it is kind of hard coded in at the bottom of settings.py so that will need to be changed if I move it to public.

https://docs.djangoproject.com/en/1.10/ref/templates/

Nest templates - use a base.html with template inheritance

bootstrap docs

found some info about using bootstrap themes

got a bootstrap theme to download but dropdown not working. May need to load jquery.

YES loading jquery from ajax.google.apis something like:

<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
</head>

https://developers.google.com/speed/libraries/

short vid on getting dropdowns to work

Got basic setup for local apache 11-6-16 and seems to be serving up all the files

May have to restart apache to see some changes. There may be another way to reload wsgi process but I haven't figured it out yet.

This is at the end of:

/etc/apache2/apache2.conf
# rfile addition 11-6-16
 
Alias /static/ /home/rfile/python/info/info/staticroot/
WSGIScriptAlias /bp  /home/rfile/python/info/info/wsgi.py
WSGIProcessGroup bp
# WSGIPythonPath /home/rfile/python/info
WSGIDaemonProcess bp  python-path=/home/rfile/python/info:/usr/lib/python3/dist-packages
 
<Directory /home/rfile/python/info/info>
<Files wsgi.py>
Require all granted
</Files>
Options Indexes FollowSymLinks 
DirectoryIndex wsgi.py
</Directory>
 
# end rfile addition 11-6-16

Look at the end of this link about passing extra stuff