Re: building a xenserver web client

2014-08-01 Thread Cal Leeming [Simplicity Media Ltd]
Hi Marc,

Although somewhat off-topic for this list, I would say there's several
people out there that aren't at all happy with OpenStack (myself included).

However the requirements for creating an interface for virtualization
management can very quickly become overwhelming, as there are so many areas
this could expand into.

OpenStack has contributions from a lot of people, and backing from some big
names, so you'd be hard pushed to create an interface that covers all use
cases.

Bare in mind that some aspects of such a platform, such as the REST API, if
done properly, are difficult to achieve with stock Django.

The best way to get like minded contributors is to start work on something
yourself, and attract people along the way. Create a prototype or an alpha,
learn from the mistakes, and use the experience to not only become a better
programmer, but to determine what the goals of your project would be. If
you're not busy this weekend, have yourself your very own hackathon :)

Also decide early on what your personal goal is... if you want to ship a
product, then focus on getting it done by any and every means necessary,
potentially compromising quality for speed. If you want to improve your own
skills, then focus on learning and take as long as you need to get the job
done right.

As a startup kid, that's my two cents.

Cal


On Fri, Aug 1, 2014 at 7:16 AM,  wrote:

> Openstack is huge. I'll prefer a lightweight solution, maybe just HTML/CSS
> (if there is already a good Soap client for JS). But this should be
> compatible to most of the API features provided by xen.
>
> Am Donnerstag, 31. Juli 2014 17:39:53 UTC+2 schrieb cmawe...@gmail.com:
>
>> You mentioned "full featured". Check out https://github.com/openstack/
>> horizon if you haven't.
>>
>> On Thursday, July 31, 2014 9:55:43 AM UTC-4, ma...@tubeards.com wrote:
>>>
>>> Hi,
>>>
>>> is anyone interested in co-building a full featured web client for
>>> xenserver instances?
>>> Since version 6.2 the update procedures are really a pain which is one
>>> of my reasons to think about an (maintained) opensource client.
>>>
>>> Ideas are welcome.
>>> Cheers
>>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8214660c-6a6a-4b78-b21c-afa51a959090%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagEzxk2pienngCknrhZvzb7WmMmU3bY%3DsTVae5dCM0ohVw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Docopt - a better arguments parser

2014-07-22 Thread Cal Leeming [Simplicity Media Ltd]
Although not strictly related to Django, I feel this library is worthy
of a mention, if even that it works flawlessly with custom management
commands in Django.

Over the years I've personally always despised the way that
argparse/optparse work, it always felt unnatural.

Docopt has been around for several years and is possibly one of the
most underrated libraries I've come across.

Anyone looking for better arguments parsing should check this out.

https://github.com/docopt/docopt

Cal

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagG3J0to6Ezv0a2E6Cwui3PjnWz93YttHg39vP6YyaQz%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Introducing myself and my first question

2014-07-20 Thread Cal Leeming [Simplicity Media Ltd]
On Saturday, July 19, 2014, Martin Torre Castro  wrote:

> Hello,
>
> my name is Martin and I'm a computer engineer from Spain. I'm going to
> start a new project with a colleague and I decided to use Django because we
> searched for free opensource tools and I'm in love with Python.
>

Hello and welcome :)


> We have made a couple of tutorials (the official one and "Tango with
> django"). I've also bought the book "Two scoops of Django" for the 1.6
> Django edition. We're starting the project soon as well as we finish the
> design, but I'm concerned about setting up the new environment. We're
> thinking of using:
>
>
>- postgresql
>- Python/Django [ of course ;-) ]
>- Eclipse/Pydev
>
> Consider using Sublime Text 2 instead.

>
>- Git
>- jQuery
>
> Remember that JS is a whole different beast.  Have a read of this (written
by a well respected engineer), it's well worth the effort, you won't get it
right the first time, but none of us ever do!

http://addyosmani.com/resources/essentialjsdesignpatterns/book/


>
>
> I've been reading the Greenfield/Roy book and some web sites and I want to
> set up the environment with good practices by using virtualenvwrapper,
> virtualenv, pip, the requirements.txt files and so on.
> I have made some mix for all this, but I would be grateful if someone
> could confirm us if we are on the right way, give us some advice or maybe
> tell us where on the internet we can find a good way of doing all this.
>
> My preview for the whole setting up is next:
>
>
>1. We should start the installations by installing "sudo apt-get
>install virtualenvwrapper" . If I understand correctly, this installs
>virtualenv as well as an embedded pip.
>2.
>
>
You can also use 'pip install virtualenvwrapper' to get a more up to date
version, and just use 'apt-get install python-setup tools' to get pip.

>
>1.
>2. The virtualenv must be created ("virtualenv env") in the parent
>directory of the Eclipse workspace, I suppose. This is one point of
>confusion to me. I don't know either if I have to activate this every time
>I come back for developing resuming the work from days before. I completely
>understand that later from Eclipse I will give the python path inside the
>virtualenv, but don't know if must activate the virtualenv every time
>
>
>1. Next step would be to install all the things we need (django,
>pillow, psycopg2) using a requirements.txt file. "pip install -r
>requirements.txt"
>2. We should create the new django project with a python
>django-admin.py startproject 
>3. Now I don't know if we should link the project to an already
>installed version of Eclipse or run the "git init" first. I understand
>that Eclipse and Git don't need to be installed inside the virtualenv. In
>fact, I've been reading and it seems that Eclipse can work OK just by being
>given the path inside the virtualenv where the python executable is
>located. I've also read that some people used to make different workspaces,
>but configuring the paths should be enough
>http://stackoverflow.com/questions/1145374/virtualenv-with-eclipse-galileo
>
> Can't advise much on Eclipse, sorry.

>
>
> From here I would just upload to github or bitbucket, maybe doing the
> whole thing from Eclipse would be easier. But the integration with Eclipse
> when we made tangowithdjango tutorial was the difficult point, because
> there is no option for importing a django project from Eclipse (Kepler
> version last time). We found easier to create the project from Eclipse, but
> we were not using a virtualenv for the tutorial.
>
> I haven't used virtualenv before, so it's our second main obstacle, but I
> expect it will be easy when we get used to it (^_^) .
>
> Please could someone help with some piece of advice, pros and cons of
> every option. Just don't want to do something now I will regret in future.
>

It really depends on your own workflow and what works best for you. If your
dev environment is on a windows or osx box but you're pushing to a Linux
prod env, them you may wish to reconsider remote python execution to a
local dev Linux box using something like active state python (otherwise
known as remote debugging).

For a while I used a samba/nfs mount to a Linux VMware install locally then
edited files over the mount and used a terminal inside VMware to execute
the code, this worked but it's a poor workflow (trying to run git over
samba gets real slow, and files can become damaged in transport)

Truth be told, I can't give a 100% recommendation because even after 8
years I'm still not happy with my own workflow. The best advice I can give
would be keep experimenting and find what works best for you. Do lots of
reading, keep an open mind etc.

Much of this will depend on the IDE you use, as some won't have support for
things like remote debugging, but this has been covered in 83748474
existing threads 

Re: idea: deploy static files on github pages CDN

2014-07-18 Thread Cal Leeming [Simplicity Media Ltd]
I'm curious, why would you put your static web app files on Github
Pages? This is not just inconvenient (due to the way it works, lack of
cache control etc), but is also quite a blatant abuse of their
service.

If you're looking for a CDN, why not just put Cloudflare in front of your sites?

Cal

On Thu, Jul 17, 2014 at 4:09 PM,   wrote:
> I had an idea today that I wanted to share, if anyone finds it helpful or
> has feedback.
>
> ./manage.py collectstatic
> cd $STATIC_ROOT
> rm -rf .git/  # optionally don't keep history
> git init .
> git add .
> git commit -m"static files"
> git push -f g...@github.com:username/yourrepo master:gh-pages
>
> then set STATIC_URL = '//username.github.io/yourrepo/'
>
> It works just fine, even on private repositories.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d1abc065-3658-4528-a3da-b835bfc8a440%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagFyic1-eLj_pHLtM4vcL9VgGP%3DG38qLT_BytBdPFJqW5Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Simple History - Field Change

2014-07-05 Thread Cal Leeming [Simplicity Media Ltd]
No problem at all, glad you got it sorted!

Cal


On Sat, Jul 5, 2014 at 6:32 AM, Aaron Reabow <rea...@gmail.com> wrote:

> You are totally right.
>
> There is a historical table that required deletion.
>
> This is why you shouldn't debug late on friday afternoon.  I had actually
> looked for that table but somehow missed it.
>
> I will pick up the broader problems with simple history separately.
>
> thanks for taking the time to look through this Cal.
>
> On Friday, 4 July 2014 18:05:43 UTC+2, Cal Leeming [Simplicity Media Ltd]
> wrote:
>
>> It sounds like you haven't applied the table changes to the cloned table
>> which it creates to track changes.
>>
>> I'd advice using something like South to manage your schema changes, and
>> this should work out of the box with django-simple-history.
>>
>> For now, you can delete the cloned table and re-sync, you will naturally
>> lose the historical data but if you deleted the original then this probably
>> won't matter.
>>
>> It's also worth mentioning that the design approach
>> of django-simple-history is completely wrong, and personally I wouldn't
>> recommend using it. Feel free to start a separate thread if you'd like to
>> discuss that further though as it's slightly off topic for this thread.
>>
>> Let us know how you get on.
>>
>> Cal
>>
>>
>> On Fri, Jul 4, 2014 at 4:47 PM, Aaron Reabow <rea...@gmail.com> wrote:
>>
>>> Environment:
>>>
>>>
>>> Request Method: POST
>>> Request URL: upon request :)
>>>
>>> Django Version: 1.6.2
>>> Python Version: 2.7.5
>>> Installed Applications:
>>> ('django.contrib.admin',
>>>  'django.contrib.admindocs',
>>>  'django.contrib.auth',
>>>  'django.contrib.sites',
>>>  'django.contrib.contenttypes',
>>>  'django.contrib.sessions',
>>>  'django.contrib.messages',
>>>  'django.contrib.staticfiles',
>>>  'myproject.ngc',
>>>  'registration',
>>>  'crispy_forms',
>>>  'floppyforms',
>>>  'simple_history')
>>> Installed Middleware:
>>> ('django.contrib.sessions.middleware.SessionMiddleware',
>>>  'django.middleware.common.CommonMiddleware',
>>>  'django.middleware.csrf.CsrfViewMiddleware',
>>>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>>>  'django.contrib.messages.middleware.MessageMiddleware',
>>>  'django.middleware.clickjacking.XFrameOptionsMiddleware')
>>>
>>>
>>> Traceback:
>>> File 
>>> "/home/metadata/webapps/greenhouse/lib/python2.7/django/core/handlers/base.py"
>>> in get_response
>>>   114. response = wrapped_callback(request,
>>> *callback_args, **callback_kwargs)
>>> File "/home/metadata/webapps/greenhouse/myproject/myproject/ngc/views.py"
>>> in leadManagementView
>>>   540. model_instance.save()
>>> File 
>>> "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/base.py"
>>> in save
>>>   545.force_update=force_update,
>>> update_fields=update_fields)
>>> File 
>>> "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/base.py"
>>> in save_base
>>>   582.update_fields=update_fields,
>>> raw=raw, using=using)
>>> File 
>>> "/home/metadata/webapps/greenhouse/lib/python2.7/django/dispatch/dispatcher.py"
>>> in send
>>>   185. response = receiver(signal=self, sender=sender,
>>> **named)
>>> File 
>>> "/home/metadata/.local/lib/python2.7/site-packages/simple_history/models.py"
>>> in post_save
>>>   209. self.create_historical_record(instance, created and
>>> '+' or '~')
>>> File 
>>> "/home/metadata/.local/lib/python2.7/site-packages/simple_history/models.py"
>>> in create_historical_record
>>>   222.history_user=history_user, **attrs)
>>> File 
>>> "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/manager.py"
>>> in create
>>>   157. return self.get_queryset().create(**kwargs)
>>> File 
>>> "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/query.py"
>>> in create
>>>   319. obj.save(force_insert=True, using=self.db)
>>> File 
>>> "/home/metadata/webapps/g

Re: Simple History - Field Change

2014-07-04 Thread Cal Leeming [Simplicity Media Ltd]
> "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/backends/util.py"
> in execute
>   69. return super(CursorDebugWrapper, self).execute(sql,
> params)
> File
> "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/backends/util.py"
> in execute
>   53.         return self.cursor.execute(sql, params)
> File "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/utils.py"
> in __exit__
>   99. six.reraise(dj_exc_type, dj_exc_value, traceback)
> File
> "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/backends/util.py"
> in execute
>   53. return self.cursor.execute(sql, params)
>
> Exception Type: DataError at /leads
> Exception Value: smallint out of range
>
>
> On Friday, 4 July 2014 17:43:50 UTC+2, Cal Leeming [Simplicity Media Ltd]
> wrote:
>
>> Can you please paste the full clear text stacktrace?
>>
>> Cal
>>
>>
>> On Fri, Jul 4, 2014 at 3:49 PM, Aaron Reabow <rea...@gmail.com> wrote:
>>
>>> Hi all,
>>>
>>> I am getting this error on a modelform
>>>
>>> smallint out of range
>>>
>>>
>>>
>>> But the form is actually submitting just fine and being stored in the DB.  
>>> I used to have a positive small int, but have changed it  (dropped the 
>>> offending table, resync'ed, restarted the server...)
>>>
>>> I have history = HistoricalRecords() as one of the fields  (ie am tracking 
>>> changes with django-simple-history), and I wonder if this is effecting my 
>>> ability to make changes to the model.
>>>
>>>
>>> My other thought is that it is a caching problem somewhere.
>>>
>>>
>>> has anyone come across this problem and have any idea how to fix?
>>>
>>>
>>> many thanks,
>>>
>>>
>>> Aaron
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>>
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit https://groups.google.com/d/
>>> msgid/django-users/6af23e8d-9f15-477d-843f-dc9c33b7edf9%
>>> 40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/6af23e8d-9f15-477d-843f-dc9c33b7edf9%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/60c024db-2672-4b5b-ad0b-aeecd2d83aaf%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/60c024db-2672-4b5b-ad0b-aeecd2d83aaf%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagELdz5RAjpvXpvAss%3D9fGMWWLqkupnK9mWpvEJYC_h3Qw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Simple History - Field Change

2014-07-04 Thread Cal Leeming [Simplicity Media Ltd]
Can you please paste the full clear text stacktrace?

Cal


On Fri, Jul 4, 2014 at 3:49 PM, Aaron Reabow  wrote:

> Hi all,
>
> I am getting this error on a modelform
>
> smallint out of range
>
>
>
> But the form is actually submitting just fine and being stored in the DB.  I 
> used to have a positive small int, but have changed it  (dropped the 
> offending table, resync'ed, restarted the server...)
>
> I have history = HistoricalRecords() as one of the fields  (ie am tracking 
> changes with django-simple-history), and I wonder if this is effecting my 
> ability to make changes to the model.
>
>
> My other thought is that it is a caching problem somewhere.
>
>
> has anyone come across this problem and have any idea how to fix?
>
>
> many thanks,
>
>
> Aaron
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6af23e8d-9f15-477d-843f-dc9c33b7edf9%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagHn-Bwrg_nHyqO6fd63W4S5L34-Zhe4yz%3Dox9nKtfCsWQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Question about static file serving strategy with S3 and Cloudfront

2014-07-03 Thread Cal Leeming [Simplicity Media Ltd]
Also worth mentioning that django-pipeline does cache busting by adding a
random string into the filename, rather than query string, so you may be
able to extend on that for your own needs.

Cal


On Thu, Jul 3, 2014 at 2:29 PM, Scott Anderson <scottanderso...@gmail.com>
wrote:

> This is what we do, although we don't use query strings as some network
> appliances don't respect them with respect to caching.
>
> We use a virtual directory instead:
>
> //example.com/static//images/blancmange.png
>
> Where  is obtained like this:
>
> $ git log --oneline | wc -l | awk '{ print $1; }'
>
> And nginx removes the virtual directory like this:
>
> location ~ /static/([0-9]+)/ {
> rewrite ^/static/([0-9]+)/(.+)$ /static/$2 last;
> }
>
> Static files are cached for a year:
>
> location /static {
> alias {{ web_static_dir }};
> expires 1y;
> add_header Cache-Control
> "no-transform,public,max-age=31557600,s-maxage=31557600";
> gzip on;
> }
>
> So a static file will be cached "forever" unless we do a release, at which
> point the virtual directory changes to the new version and clients start
> requesting (to them) a completely new static file.
>
> Also note we don't copy to S3 as there's no way to do the virtual
> directory without having a real directory for every release. CloudFront
> will read files from a web site as well, and we don't need the extra
> deployment complexity.
>
> Regards,
> -scott
>
>
> On Wednesday, July 2, 2014 3:20:34 PM UTC-4, Cal Leeming [Simplicity Media
> Ltd] wrote:
>
>> You also have to consider client side caching, despite if you use the
>> correct headers or not.
>>
>> One option is to use a cache buster using a value which changes on each
>> release, but I'd advise against using random() cache buster as your caching
>> efficiency will be impacted.
>>
>> //example.com/static/images.jpg?release=1000
>> //example.com/static/images.jpg?release=1001
>>
>> Cal
>>
>>
>> On Wed, Jul 2, 2014 at 7:08 PM, Chen Xu <xuch...@gmail.com> wrote:
>>
>>> Hi Everyone,
>>>
>>> I am currently using the following strategy to serve my static files,
>>> basically I run collectstatic to copy all my files to my static files
>>> directory, and then move it to s3, and cloudfront will pick it up from
>>> there. However, I wonder if I set the cache period to be 1 day in my
>>> cloudfront, and I upload new updated files to s3, are the files still going
>>> to be the old ones until next time the cache expires?
>>>
>>>
>>> Thanks
>>>
>>> --
>>> ⚡ Chen Xu ⚡
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>>
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit https://groups.google.com/d/
>>> msgid/django-users/CACac-qYBa0Pg0eYQfoVGNTk2jHXC2Y100-
>>> xkHAo0AA7%2Bk3cw_w%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CACac-qYBa0Pg0eYQfoVGNTk2jHXC2Y100-xkHAo0AA7%2Bk3cw_w%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/1adfeb0a-8735-4d21-9d8d-4c8a97e8e7c2%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/1adfeb0a-8735-4d21-9d8d-4c8a97e8e7c2%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagE9f4--C5E3jOWeHimYaF6TRpnqqnoQpbz6QM-gKO3qOw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Question about static file serving strategy with S3 and Cloudfront

2014-07-02 Thread Cal Leeming [Simplicity Media Ltd]
You also have to consider client side caching, despite if you use the
correct headers or not.

One option is to use a cache buster using a value which changes on each
release, but I'd advise against using random() cache buster as your caching
efficiency will be impacted.

//example.com/static/images.jpg?release=1000
//example.com/static/images.jpg?release=1001

Cal


On Wed, Jul 2, 2014 at 7:08 PM, Chen Xu  wrote:

> Hi Everyone,
>
> I am currently using the following strategy to serve my static files,
> basically I run collectstatic to copy all my files to my static files
> directory, and then move it to s3, and cloudfront will pick it up from
> there. However, I wonder if I set the cache period to be 1 day in my
> cloudfront, and I upload new updated files to s3, are the files still going
> to be the old ones until next time the cache expires?
>
>
> Thanks
>
> --
> ⚡ Chen Xu ⚡
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CACac-qYBa0Pg0eYQfoVGNTk2jHXC2Y100-xkHAo0AA7%2Bk3cw_w%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagFLDZigvNmwdM_GvHnpamuj4Ro0gvVoNyfUbA_kemXa8g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Chat application

2014-06-19 Thread Cal Leeming [Simplicity Media Ltd]
+1.

You may even be able to do this using uWSGI plugins and Redis which would
be even faster.

Django is certainly not the right tool for the job for this use case though.

Cal


On Thu, Jun 19, 2014 at 2:24 AM, carlos  wrote:

> Hi, maybe not all with django, maybe you need learn gevent
> http://www.gevent.org/
> socket.io
> http://socket.io/
>  and here is example for a chat with redis and django + gevent + socketio
> etc.
> https://github.com/rlr/django-gevent-socketio-redis-chat-example
>
> Cheers
>
>
> On Wed, Jun 18, 2014 at 4:46 PM, Pedro  wrote:
>
>> Hello,
>>
>> i'm working in a mobile app that depends of a Django server (to manage
>> user data and stuff).
>> This mobile app is about a social network with users interacting. It
>> should have a chat system, where two or more users can send and receive
>> messages and photos.
>>
>> I'm thinking in the best way to implement the communication and the model
>> on the server. My first idea is to use a simple model with rooms and
>> messages (each message belong to a room). To send messages from a client to
>> the server, i think i could use http requests, like GETs and POSTs, where i
>> would implement syncronization methods and stuff.
>>
>> Is this the best approach to solve this problem on Django?
>>
>>
>> --
>> Pedro Alves
>>
>> *Mestrando em Ciência da Computação*
>> *Universidade Estadual de Campinas*
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CACW_pa0Dfom4Eydop5qedMMP5fbuBx-yZAUgDrhDApfewDFWbQ%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAM-7rO0052uKjqh%3D5UEt-%2BGo1-muj3k-Yu7%2BFKjVFLCOTLi2AA%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagEfYnwj4ZEWL36rpPYBxjV47wkbkDD0YWvyQYzf_GKJ%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to learn Django?

2014-06-15 Thread Cal Leeming [Simplicity Media Ltd]
One of the most important things you can do when learning anything,
including Django, is to learn to use Google as much as possible.

The majority of questions have already been answered by a wide audience,
and most answers can be found with a simple search.

Sometimes you have to be creative with your searching, for example, you
could have searched for;

* Getting started with Django
* Learning Django
* Learn Django the hard way
* Django examples
* Django books

Although different people learn in different ways, being self sufficient
and going that extra mile to find the answers yourself will go a long way
to making you stand out from the crowd.

There are occasions where asking questions is the right thing to do, and
you should make an effort to explain yourself thoroughly, whilst showing
that you've made an effort to try and find the answer yourself.

Don't limit yourself to just the Django framework, take time to learn about
Python and other common stack components that go with the territory e.g.
MySQL, Linux, Apache, Nginx etc.

Everyone has to start somewhere, and Django is a great place to start.. but
being self sufficient will get you a lot further than most :)

That's my honest advice, straight from the heart, hope it helps you.

Cal



On Sun, Jun 15, 2014 at 10:01 AM, Aadit Kapoor 
wrote:

> How to learn Django?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/931cacd7-1e95-4733-8cf3-cfb2e5100b74%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagHyat5-pp0vJCsdotr019g%2B4mbfzQPWcOUOQi1pP8FuYA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Change settings.DEBUG in response to a request's source

2014-06-11 Thread Cal Leeming [Simplicity Media Ltd]
Although I can't comment on your individual use case, it's better to enable
remote error collection using something like Sentry or BugSnag. Both also
support integration with other languages, such as JS, which is very handy
when tracking down front end problems. There are lesser alternatives such
as New Relic error collection (which ties in with their APM) and plain ol'
email, but these are both considered obsolete these days.

To answer your original question, I'd strongly advice against selectively
enabling debug, but if you insist then you'd probably want to do it inside
middleware. Naturally any errors that occur before the middleware is loaded
won't get caught and will display the standard 500, and this could include
quite a few different problems (e.g. Db connection failure). If any
libraries/modules cache the settings.DEBUG property prior to the middleware
being called, then this may cause some weird edge cases. Another
alternative is to do is based on IP, but again this is extremely bad
practice for production.

Hope this helps.

Cal


On Wednesday, June 11, 2014, Silas Snider  wrote:

> I'm writing an app where it'd be super helpful for logged-in users from my
> company to see error pages and the like as though the app was running with
> DEBUG=True, while still preventing ordinary users from seeing that output.
> I see that the docs strongly warn me against changing settings at runtime,
> so I was wondering how I could achieve the same effect?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com
> 
> .
> To post to this group, send email to django-users@googlegroups.com
> .
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/7c979ac0-e8b9-4ea6-9e49-2205eeaccd90%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagGKUcba3HnXbkbDJn%3DKs_Ff3EiXPgmHFerid1G76zqH3Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django and Javascript

2014-06-11 Thread Cal Leeming [Simplicity Media Ltd]
This is quite an open ended question, and touches on the subject of asset
pipelines.

This also touches on the whole debate around how JS applications should be
developed, libraries such as Ansible and Backbone may impact your
style/preference.

The closest library I've seen so far is django-pipeline, but it doesn't
have support for requirejs, there was also another discussion relating to
this topic [1].

For example, the rules of decoupling still apply, if the JS is not linked
to the site HTML in anyway (e.g. REST API) then you would ideally keep this
in a separate repo and use whatever asset pipeline suited you best. However
if your JS is closely coupled to your site HTML, then this would probably
stay inside your Django static.

It really depends on how complex your JS application is, for simple
requirements django-pipeline will do just fine. The best advice I can give
would be to research all the different options, and decide which is best
for your specific use case and tastes.

Hope this helps

Cal

[1] https://groups.google.com/forum/#!topic/requirejs/gDczhOVuYdc


On Wed, Jun 11, 2014 at 4:59 PM, César García Tapia <ta...@openshine.com>
wrote:

> Not really. I'm not looking for an answer to a specific question. I'm just
> looking for a "good practices manual" on writing and deploying javascript
> in a django environment.
>
>
>
> El miércoles, 11 de junio de 2014 17:41:45 UTC+2, Cal Leeming [Simplicity
> Media Ltd] escribió:
>>
>> Have a look at how Stripe do it [1].
>>
>> https://js.stripe.com/v2/&quot</a>;>
>> Stripe.setPublishableKey('YOUR_PUBLISHABLE_KEY');
>>
>> I think this is what you're asking for (if I've understood your question
>> correctly).
>>
>> Cal
>>
>> [1] https://stripe.com/docs/stripe.js
>>
>>
>>
>> On Wed, Jun 11, 2014 at 4:22 PM, César García Tapia <ta...@openshine.com>
>> wrote:
>>
>>> Hi.
>>>
>>> Probably this is an old subject, and it's been argued lots of times, but
>>> I guess I need some help to find the right resources.
>>>
>>> When building a real-world django application, you need javascript. Lots
>>> of it. Making JS talk to django is more or less easy: $.ajax(),
>>> django-rest-framework, and you're done. The problem comes when you need
>>> Django talking to JS. You need this variable initialized with some View
>>> context value, or init the i18n of that plugin with the {{ LANGUAGE_CODE
>>> }}, or whatever. There are a thousand cases that are on everybody's mind.
>>>
>>> The obvious way is to add a 

Re: Django and Javascript

2014-06-11 Thread Cal Leeming [Simplicity Media Ltd]
Have a look at how Stripe do it [1].

https://js.stripe.com/v2/";>
Stripe.setPublishableKey('YOUR_PUBLISHABLE_KEY');

I think this is what you're asking for (if I've understood your question
correctly).

Cal

[1] https://stripe.com/docs/stripe.js



On Wed, Jun 11, 2014 at 4:22 PM, César García Tapia 
wrote:

> Hi.
>
> Probably this is an old subject, and it's been argued lots of times, but I
> guess I need some help to find the right resources.
>
> When building a real-world django application, you need javascript. Lots
> of it. Making JS talk to django is more or less easy: $.ajax(),
> django-rest-framework, and you're done. The problem comes when you need
> Django talking to JS. You need this variable initialized with some View
> context value, or init the i18n of that plugin with the {{ LANGUAGE_CODE
> }}, or whatever. There are a thousand cases that are on everybody's mind.
>
> The obvious way is to add a 

Re: Using Sass and Sass Libraries with Django-Pipeline

2014-05-23 Thread Cal Leeming [Simplicity Media Ltd]
On Fri, May 23, 2014 at 5:25 AM, Wellington Cordeiro
<willy123...@gmail.com>wrote:

> Cal,
>
> I don't have it installed in my static folder, I have the gem installed
> and I was under the impression that Sass could find the installed
> libraries, which I guess I was mistaken.
>
> What would be your recommended tool? Django-Pipeline or Compressor? Or
> maybe another?
>

I'll be honest, I'm yet to find an asset pipeline that suited every use
case.

I've used django-pipeline in the majority of cases, but have also used a
custom pipeline tools (such as gulp.js and one off Python scripts) for more
complex requirements, such as compiling AS3 files as part of the pipeline.

If you find any better alternative to pipeline, let me know :)


> I was trying Compressor at first and had the same issue and thought it
> might have been related to the way it handled Sass. I have the newest
> version of Node installed on my vagrant environment but I'm considering
> taking a look into nodeenv. I'm trying to use three libraries in particular
> Bourbon, Compass and Breakpoint with Django (and I've heard of Neat and
> chose to use Jeet[1] instead.)
>
> Thanks for the help,
>
> Wellington
>
>
> On Thursday, May 22, 2014 8:08:42 AM UTC-6, Cal Leeming [Simplicity Media
> Ltd] wrote:
>
>> Hi Willy,
>>
>> Do you have Bourbon installed in your static folder? If not, you'll need
>> to install the bourbon/compass/sass node packages (see below), or you can
>> download a precompiled dist from the source of each, for example see [1].
>>
>> If you go down the node packages route, be aware, not even the latest
>> bleeding edge version of Ubuntu will allow to use the most up to date
>> bourbon/compass/sass node packages. You will almost certainly want to use a
>> local node install, either through a tool such as nodeenv [2] which re-uses
>> your existing virtualenv, or manually patch your .bashrc to use a locally
>> installed node binary [3].
>>
>> It's also worth mentioning that although django-pipeline is quite
>> awesome, it can also be quite limited.
>>
>> One last thing, check out Bourbon Neat [4].
>>
>> Hope this helps
>>
>> Cal
>>
>> [1] https://github.com/thoughtbot/bourbon/tree/master/dist
>> [2] https://github.com/ekalinin/nodeenv
>> [3] https://github.com/creationix/nvm
>> [4] http://neat.bourbon.io/
>>
>>
>>
>> On Thu, May 22, 2014 at 7:29 AM, Willy <willy...@gmail.com> wrote:
>>
>>> I'm trying to use Sass and Sass Libraries with Django-Pipeline but my
>>> @import directives always error out saying they can't find the libraries I
>>> have installed.
>>>
>>> Here is my settings file https://gist.github.com/43b0e4d5c93b943d9760
>>>
>>> Then I have my scss file trying to do
>>>
>>> @import 'bourbon';
>>> @import 'compass';
>>> @import 'breakpoint';
>>>
>>> and it will fail showing this error. https://gist.github.com/
>>> 28e617581fa198a8690d
>>>
>>> Has anyone setup a Django project that's been able to properly import
>>> Sass libraries and if so how would you best do that?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>>
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit https://groups.google.com/d/
>>> msgid/django-users/a7fa8151-f216-4e2c-9b23-2f5628a63e8a%
>>> 40googlegroups.com<https://groups.google.com/d/msgid/django-users/a7fa8151-f216-4e2c-9b23-2f5628a63e8a%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/335c90d4-d8ca-4d26-b0b7-255ae73b1d22%40googlegroups.com<https://groups.google.com/d/msgid/django-users/335c90d4-d8ca-4d26-b0b7-255ae73b1d22%40

Re: Using Sass and Sass Libraries with Django-Pipeline

2014-05-22 Thread Cal Leeming [Simplicity Media Ltd]
Hi Willy,

Do you have Bourbon installed in your static folder? If not, you'll need to
install the bourbon/compass/sass node packages (see below), or you can
download a precompiled dist from the source of each, for example see [1].

If you go down the node packages route, be aware, not even the latest
bleeding edge version of Ubuntu will allow to use the most up to date
bourbon/compass/sass node packages. You will almost certainly want to use a
local node install, either through a tool such as nodeenv [2] which re-uses
your existing virtualenv, or manually patch your .bashrc to use a locally
installed node binary [3].

It's also worth mentioning that although django-pipeline is quite awesome,
it can also be quite limited.

One last thing, check out Bourbon Neat [4].

Hope this helps

Cal

[1] https://github.com/thoughtbot/bourbon/tree/master/dist
[2] https://github.com/ekalinin/nodeenv
[3] https://github.com/creationix/nvm
[4] http://neat.bourbon.io/



On Thu, May 22, 2014 at 7:29 AM, Willy  wrote:

> I'm trying to use Sass and Sass Libraries with Django-Pipeline but my
> @import directives always error out saying they can't find the libraries I
> have installed.
>
> Here is my settings file https://gist.github.com/43b0e4d5c93b943d9760
>
> Then I have my scss file trying to do
>
> @import 'bourbon';
> @import 'compass';
> @import 'breakpoint';
>
> and it will fail showing this error.
> https://gist.github.com/28e617581fa198a8690d
>
> Has anyone setup a Django project that's been able to properly import Sass
> libraries and if so how would you best do that?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a7fa8151-f216-4e2c-9b23-2f5628a63e8a%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagEEVrjW9VQ1%2B0QT5PYu7ksm9%3DUUuGkQ_bE7YkVdgjsYkg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django-php - yeah, it happened.

2014-02-28 Thread Cal Leeming [Simplicity Media Ltd]
The post was actually meant to be humorous, albeit dry :)

But if it makes you any happier, I'd have been just as sad if it was
django-java, django-rails, django-ruby or
django-insert-whatever-language-you-want-here. On a serious thought, my
opposition isn't against PHP, despite my disliking for it, it's the
principle in general.

Cal


On Fri, Feb 28, 2014 at 6:49 PM, Rafał Pitoń  wrote:

> Really? You bring up three years old toy project that didn't went anywhere
> and mock somebody's work because PHP's involved? Thats bad form OP.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/51c7ea33-216f-438a-9ec1-1a0acb7e831a%40googlegroups.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagHCU%2BnTu72PA0neTmXucHOhpE_tqU4cj1k%2B7Sx-mvFQ_A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


django-php - yeah, it happened.

2014-02-27 Thread Cal Leeming [Simplicity Media Ltd]
Clearly this should be considered for merge into the core;
https://github.com/mvasilkov/django-php

The really sad part: someone somewhere *will* use this in production, and
be totally srs about it.

Excuse me whilst I cry myself to sleep.

Cal

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagH-dFwiwSePpKoSGzUKR71CF92s8g%3DfVRpiiBS-2w1vdA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: django application hosted on godaddy don't display the site models in admin page

2014-02-13 Thread Cal Leeming [Simplicity Media Ltd]
Glad you got it sorted out, and thanks for letting us know!

Cal


On Thu, Feb 13, 2014 at 10:26 AM, Mironiuc Sergiu wrote:

> I found the problem.
> I had an "extra" (non-necessary) folder admin, that should be in the
> static folder and not dirrectly in the project folder.
> That was a confusing thing for application.
> Thanks to all people who tried to help me.
> Regards!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/dd3a2e61-d320-4601-aa47-6d66be8351c8%40googlegroups.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagErYOACsFigNpXVA9rCQhW8z9RT_Ax%2BvDXAU5ZM037tFQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Using Django User Authentication from an Android App (CSRF issue?)

2014-02-12 Thread Cal Leeming [Simplicity Media Ltd]
On Wed, Feb 12, 2014 at 4:02 PM, Ethan Lowry <ethanma...@gmail.com> wrote:

> Hi Cal, first off thanks for the detailed response.
>
> Regarding your second reply I'm not sure I understand the question? The
> csrf issue I described *is* the reason I was unable to use POST requests,
> which is what I originally wanted to do.
>

Doh sorry, I had a bit of a slow moment there!


>
> I will look in to all the options in the links posted and get back to you
> with how it goes, thanks very much.
>
> On Wednesday, 12 February 2014 15:25:09 UTC, Cal Leeming [Simplicity Media
> Ltd] wrote:
>>
>>
>>
>>
>> On Wed, Feb 12, 2014 at 3:17 PM, Cal Leeming [Simplicity Media Ltd] <
>> cal.l...@simplicitymedialtd.co.uk> wrote:
>>
>>> Hi Ethan, comments in-line;
>>>
>>>
>>>
>>> On Wed, Feb 12, 2014 at 1:41 PM, Ethan Lowry <ethan...@gmail.com> wrote:
>>>
>>>> Hi there,
>>>>
>>>> I have a bare-bones Django app set up and am planning on using the
>>>> built in Django user auth to manage log in and registration via the Android
>>>> app I'm developing.
>>>>
>>>> I've tried this a number of ways and can, for example, log in by
>>>> sending a GET request such as 
>>>> ([url]/login?username=[username]=[password])
>>>> and returning a JSON representation of the user if its valid.
>>>>
>>>
>>> Sending a users clear text password in a GET request is not a great
>>> approach, you end up with an access log full of passwords, and generally
>>> speaking it's an evil approach. You could use a one-time pad approach (i.e.
>>> create a unique string based on the users password, but typically the size
>>> of a password is small which increases the risk of brute forcing the string
>>> to determine the password. [1] Though you could salt it a bunch of times
>>> for good measure. [2].
>>>
>>> [1] http://en.wikipedia.org/wiki/Key_(cryptography)#Key_choice
>>> [2] http://en.wikipedia.org/wiki/Key_(cryptography)#Key_sizes
>>>
>>
>> Sorry I forgot to say, is there any reason why you cannot use a POST
>> request instead of GET? There are a few valid use cases for this, for
>> example supporting legacy systems or authentication handoff between
>> separate sites/systems (I believe Xero use, or used, a similar approach)
>>
>>
>>>
>>>>
>>>> Obviously this isn't an ideal or secure way of doing things and what I
>>>> originally tried was sending a POST request, but this gets denied with a
>>>> 403 and a message about not having a CSRF cookie attached.
>>>> I did some reading up and get roughly what this is but could not find
>>>> any mention of how to get around this issue if you have to send post
>>>> request from another application as in my case - is it possible to do
>>>> something like make a get request to Django and take a usable cookie from
>>>> the response and attach it to my POST request before sending?
>>>>
>>>
>>> There's a couple of ways of doing this. You could disable the CSRF
>>> protection for specific views [1], or use the CSRF AJAX approach [2].
>>>
>>> [1] https://docs.djangoproject.com/en/dev/ref/
>>> contrib/csrf/#csrf-protection-should-be-disabled-for-just-a-few-views
>>> [2] https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#ajax
>>>
>>>
>>>>
>>>> If anyone knows much about this issue, or has any general advice or
>>>> best practices regarding Django authentication on a mobile app, I'd much
>>>> appreciate it.
>>>>
>>>
>>> Hopefully this answers your question, but let me know if I've
>>> missed/overlooked anything.
>>>
>>>
>>>>
>>>> Thanks,
>>>> Ethan
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Django users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to django-users...@googlegroups.com.
>>>> To post to this group, send email to django...@googlegroups.com.
>>>>
>>>> Visit this group at http://groups.google.com/group/django-users.
>>>> To view this discussion on the web visit https://groups.google.com/d/
>>>> msgid/django-users/f823094f-ab12-4d99-9f89-66952002681b%
>>>> 40googlegroups.com.
>>>> 

Re: Using Django User Authentication from an Android App (CSRF issue?)

2014-02-12 Thread Cal Leeming [Simplicity Media Ltd]
On Wed, Feb 12, 2014 at 3:17 PM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

> Hi Ethan, comments in-line;
>
>
> On Wed, Feb 12, 2014 at 1:41 PM, Ethan Lowry <ethanma...@gmail.com> wrote:
>
>> Hi there,
>>
>> I have a bare-bones Django app set up and am planning on using the built
>> in Django user auth to manage log in and registration via the Android app
>> I'm developing.
>>
>> I've tried this a number of ways and can, for example, log in by sending
>> a GET request such as ([url]/login?username=[username]=[password])
>> and returning a JSON representation of the user if its valid.
>>
>
> Sending a users clear text password in a GET request is not a great
> approach, you end up with an access log full of passwords, and generally
> speaking it's an evil approach. You could use a one-time pad approach (i.e.
> create a unique string based on the users password, but typically the size
> of a password is small which increases the risk of brute forcing the string
> to determine the password. [1] Though you could salt it a bunch of times
> for good measure. [2].
>
> [1] http://en.wikipedia.org/wiki/Key_(cryptography)#Key_choice
> [2] http://en.wikipedia.org/wiki/Key_(cryptography)#Key_sizes
>

Sorry I forgot to say, is there any reason why you cannot use a POST
request instead of GET? There are a few valid use cases for this, for
example supporting legacy systems or authentication handoff between
separate sites/systems (I believe Xero use, or used, a similar approach)


>
>>
>> Obviously this isn't an ideal or secure way of doing things and what I
>> originally tried was sending a POST request, but this gets denied with a
>> 403 and a message about not having a CSRF cookie attached.
>> I did some reading up and get roughly what this is but could not find any
>> mention of how to get around this issue if you have to send post request
>> from another application as in my case - is it possible to do something
>> like make a get request to Django and take a usable cookie from the
>> response and attach it to my POST request before sending?
>>
>
> There's a couple of ways of doing this. You could disable the CSRF
> protection for specific views [1], or use the CSRF AJAX approach [2].
>
> [1]
> https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#csrf-protection-should-be-disabled-for-just-a-few-views
> [2] https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#ajax
>
>
>>
>> If anyone knows much about this issue, or has any general advice or best
>> practices regarding Django authentication on a mobile app, I'd much
>> appreciate it.
>>
>
> Hopefully this answers your question, but let me know if I've
> missed/overlooked anything.
>
>
>>
>> Thanks,
>> Ethan
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/f823094f-ab12-4d99-9f89-66952002681b%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagEUvYrDyyCQNxVcTdkGvNijSdzwLVXigG7%2BfH59fQNStA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Something like booktype

2014-02-12 Thread Cal Leeming [Simplicity Media Ltd]
Could you clarify your question?

If you're asking "are there are alternatives to django booktype?" - I've
had a quick look on Google and didn't find any immediate matches, but
others may know.

Cal




On Wed, Feb 12, 2014 at 1:15 PM, AlSayed Gamal  wrote:

> Dears,
>
> I want to do something like booktypein 
> django.
>
> Any similar django app ?
>
> Thanks
>
> --
> AlSayed Gamal
> www.egamal.com (Down)
> @AlSayedGamal 
> facebook.com/AlSayedGamal
> *LinkedIn* 
> +201003544877
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJO-ey3C0pX1Xg5h__A%2BvZfbzgYtWnuv3FMYt%2BE-SH7kS%2BoF1g%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagEUWVjsn6yEffXZ%3DQMSE36YBOhHyhRB1ApfRt4xPVs%3DWw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Using Django User Authentication from an Android App (CSRF issue?)

2014-02-12 Thread Cal Leeming [Simplicity Media Ltd]
Hi Ethan, comments in-line;


On Wed, Feb 12, 2014 at 1:41 PM, Ethan Lowry  wrote:

> Hi there,
>
> I have a bare-bones Django app set up and am planning on using the built
> in Django user auth to manage log in and registration via the Android app
> I'm developing.
>
> I've tried this a number of ways and can, for example, log in by sending a
> GET request such as ([url]/login?username=[username]=[password])
> and returning a JSON representation of the user if its valid.
>

Sending a users clear text password in a GET request is not a great
approach, you end up with an access log full of passwords, and generally
speaking it's an evil approach. You could use a one-time pad approach (i.e.
create a unique string based on the users password, but typically the size
of a password is small which increases the risk of brute forcing the string
to determine the password. [1] Though you could salt it a bunch of times
for good measure. [2].

[1] http://en.wikipedia.org/wiki/Key_(cryptography)#Key_choice
[2] http://en.wikipedia.org/wiki/Key_(cryptography)#Key_sizes


>
> Obviously this isn't an ideal or secure way of doing things and what I
> originally tried was sending a POST request, but this gets denied with a
> 403 and a message about not having a CSRF cookie attached.
> I did some reading up and get roughly what this is but could not find any
> mention of how to get around this issue if you have to send post request
> from another application as in my case - is it possible to do something
> like make a get request to Django and take a usable cookie from the
> response and attach it to my POST request before sending?
>

There's a couple of ways of doing this. You could disable the CSRF
protection for specific views [1], or use the CSRF AJAX approach [2].

[1]
https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#csrf-protection-should-be-disabled-for-just-a-few-views
[2] https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#ajax


>
> If anyone knows much about this issue, or has any general advice or best
> practices regarding Django authentication on a mobile app, I'd much
> appreciate it.
>

Hopefully this answers your question, but let me know if I've
missed/overlooked anything.


>
> Thanks,
> Ethan
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f823094f-ab12-4d99-9f89-66952002681b%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagE0LH80HdUMst76%3DM4Ni41fSmt%2BRkbnAv-qxnGFSeV4fA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: django application hosted on godaddy don't display the site models in admin page

2014-02-12 Thread Cal Leeming [Simplicity Media Ltd]
Can you give us a bit more info about what is happening? Do you have any
error logs or stacktrace?

Also the urls.py code is malformed, you might want to consider using
pastebin to paste the code instead.

Cal


On Wed, Feb 12, 2014 at 2:08 PM, Mironiuc Sergiu  wrote:

>
> I have a problem. I moved a django site from one hosting to godaddy. On
> the GoDaddy hosting it doesn't display in the admin page the site models.
>
> settings code:
>
> INSTALLED_APPS = 
> ('django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.messages','django.contrib.sitemaps','django.contrib.staticfiles',#
>  Uncomment the next line to enable the 
> admin:'mysite','django.contrib.admin',# Uncomment the next line to enable 
> admin documentation:# 'django.contrib.admindocs',
> 'storages',
>
> )
>
> urls.py code:
>
> > from django.conf.urls import patterns, include, url from> django.contrib 
> > import admin from django.conf import settings from> .sitemaps import 
> > StaticViewSitemap from .sitemaps import OfertaSitemap> 
> > admin.autodiscover()> > sitemaps = {> 'ro' : StaticViewSitemap,> 
> > 'oferte':OfertaSitemap> }> > urlpatterns = patterns('',> ...> 
> > url(r'^admin/', include(admin.site.urls)),> ... )
>
> Can anybody help me?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c5980fd0-877d-4488-b2d5-fe6e78135abc%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagHPMhO7MW7yQSGELUg21W%3DjyWUcHpW_2MKdrNKbgeP2jQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [JOB] $1,500 referral reward - Know anyone for Lead Python / Django Developer opening?

2014-02-12 Thread Cal Leeming [Simplicity Media Ltd]
Good point, perhaps it might even be worth having another entry in the
"usingthemailinglist" wiki page. I'll put it on my todo list :)

Cal


On Wed, Feb 12, 2014 at 9:32 AM, Avraham Serour <tovm...@gmail.com> wrote:

> it is under my impression that recruiters like these don't read replies to
> the list, since they're not interested in the list but just in post rights,
> they may subscribe and opt to not receive emails.
> so all these replies and suggestions on how to improve them are between
> ourselves and never get to the right ears
>
> I propose that emails like this also cc the original poster, this way
> there's a better chance he will hear the suggestions.
>
>
> On Wed, Feb 12, 2014 at 12:19 AM, Cal Leeming [Simplicity Media Ltd] <
> cal.leem...@simplicitymedialtd.co.uk> wrote:
>
>> Hi Marsh,
>>
>> Could you have a read of this thread;
>>
>> https://groups.google.com/forum/#!msg/django-users/q64B4chm1ho/cCp_Xvxu41oJ
>>
>> It has some tips/advice on what to put into a job description, it helps
>> keep the list free of recruiter spam and will ultimately result in better
>> responses for you too :)
>>
>> Thank you
>>
>> Cal
>>
>>
>> On Tue, Feb 11, 2014 at 8:54 PM, Marsh Sutherland 
>> <ma...@referralbon.us>wrote:
>>
>>> Hi Djangonauts,
>>>
>>> Do you know anyone for my client's newly open Lead Python / Django
>>> Developer opening?
>>>
>>> They are a well-funded, stable, and disruptive startup in the Chandler
>>> area.
>>>
>>> If you do, please have them email their resume to me at
>>> msutherl...@waldenrecruiting.com AND mention your name as the referral
>>> source.
>>>
>>> Cheers!
>>>
>>> Marsh Sutherland
>>>
>>> President
>>>
>>> Walden Recruiting
>>>
>>> We Grow Your Startup(tm)
>>>
>>> Come see how at waldenrecruiting.com
>>>
>>>
>>>
>>> (877) 8 WALDEN Ext 2 (Voice/Fax)
>>>
>>> (877) 892-5336 Ext 2
>>>
>>> msutherl...@waldenrecruiting.com
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/533070c8-ae0d-4aa4-af3f-71e19d28ada2%40googlegroups.com
>>> .
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAHKQagGx0asM0Z_WFs_AUN4trk%2B8y%2BTCtxCeVHxxz7%3Dh7dwMzA%40mail.gmail.com
>> .
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAFWa6tJ3Nx7a%3DPF8tPHBARtZ2ZpajuO8CXj3QxxJDLX-Cc0iyg%40mail.gmail.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagFY7DJNYZ80aETVjcwZ%3D9trgz8%2B29_KfnrEfGirFUB%3DEw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [JOB] $1,500 referral reward - Know anyone for Lead Python / Django Developer opening?

2014-02-12 Thread Cal Leeming [Simplicity Media Ltd]
As per usual, I think you're missing the point here Tom.

Cal


On Wed, Feb 12, 2014 at 9:55 AM, Tom Evans <tevans...@googlemail.com> wrote:

> On Tue, Feb 11, 2014 at 10:19 PM, Cal Leeming [Simplicity Media Ltd]
> <cal.leem...@simplicitymedialtd.co.uk> wrote:
> > Hi Marsh,
> >
> > Could you have a read of this thread;
> >
> https://groups.google.com/forum/#!msg/django-users/q64B4chm1ho/cCp_Xvxu41oJ
> >
> > It has some tips/advice on what to put into a job description, it helps
> keep
> > the list free of recruiter spam and will ultimately result in better
> > responses for you too :)
> >
> > Thank you
> >
> > Cal
> >
>
> Responding to every single recruiter email trying to teach recruiters
> netiquette is _almost_ as much spam..
>
> Plus, recruiter spam is only spam when you have a job..
>
> Cheers
>
> Tom
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAFHbX1%2B-xp7pNtoVma0AtJF%2BS%3DRt_gs1rjHR2RJXSZ_WiWDqQA%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagGSNWKwiyxNQg%3DdqB3E3XJqn1ARJPA8g%3DGaGbe%2Bm3kmxQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [JOB] $1,500 referral reward - Know anyone for Lead Python / Django Developer opening?

2014-02-11 Thread Cal Leeming [Simplicity Media Ltd]
Hi Marsh,

Could you have a read of this thread;
https://groups.google.com/forum/#!msg/django-users/q64B4chm1ho/cCp_Xvxu41oJ

It has some tips/advice on what to put into a job description, it helps
keep the list free of recruiter spam and will ultimately result in better
responses for you too :)

Thank you

Cal


On Tue, Feb 11, 2014 at 8:54 PM, Marsh Sutherland wrote:

> Hi Djangonauts,
>
> Do you know anyone for my client's newly open Lead Python / Django
> Developer opening?
>
> They are a well-funded, stable, and disruptive startup in the Chandler
> area.
>
> If you do, please have them email their resume to me at
> msutherl...@waldenrecruiting.com AND mention your name as the referral
> source.
>
> Cheers!
>
> Marsh Sutherland
>
> President
>
> Walden Recruiting
>
> We Grow Your Startup(tm)
>
> Come see how at waldenrecruiting.com
>
>
>
> (877) 8 WALDEN Ext 2 (Voice/Fax)
>
> (877) 892-5336 Ext 2
>
> msutherl...@waldenrecruiting.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/533070c8-ae0d-4aa4-af3f-71e19d28ada2%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagGx0asM0Z_WFs_AUN4trk%2B8y%2BTCtxCeVHxxz7%3Dh7dwMzA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Python / Django Web Applications Developer - Michigan $90-$100/hr

2014-02-10 Thread Cal Leeming [Simplicity Media Ltd]
On Mon, Feb 10, 2014 at 9:01 PM, Fred Stluka <f...@bristle.com> wrote:

>  Leigh,
>
> If it helps, here's a list of questions you might want to answer in
> your initial post of each position you are trying to fill:
> - Brief description of the company, what it does, what the
>work environment is like, etc?
> - Brief description of the responsibilities of the position you
>are trying to fill?
> - Technologies used and skills needed?
> - Consultant or FTE?
> - Full time or part time?
> - How long is the initial contract?
> - How long is the project likely to run?
> - Approx salary or hourly rate offered?
> - Location, and is telecommute an option?
>
> Cal, if Leigh posts only once for each position, and always
> includes all of the above info, are you happy with that?  If not,
> what additional info would you suggest?
>

Absolutely, job postings are an important part of any community, and I
think it's awesome the mods allow job postings on the board.

All the questions you listed are a great start, even if it's just an info
dump of "we use X, X, X, X, X", at least you have an idea of the scope.

To take it a step further, the specs from Soundcloud would make a good
template;
http://soundcloud.com/jobs/2013-06-18-engineer-systems-san-francisco-united-states

The spec should just be informative instead of cagey, avoiding cringe
phrases like "working on cloud  team".

In hindsight I should have given the OP some better guidance in my last
email, thanks for picking this up Fred!


> I'm a programmer, not a recruiter, but I know a lot of people,
> so I get asked often by friends to help them fill positions.  I
> always insist on specific answers to all of the above before I
> agree to do a mailing to any of my lists of hundreds of local
> developers.  This has kept my subscribers happy.
>
> HTH,
> --Fred
> --
> Fred Stluka -- mailto:f...@bristle.com <f...@bristle.com> --
> http://bristle.com/~fred/
> Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
> Open Source: Without walls and fences, we need no Windows or Gates.
> --
>
> On 2/10/14 3:41 PM, Cal Leeming [Simplicity Media Ltd] wrote:
>
> Leigh,
>
>  As mentioned before, posting jobs is allowed (and welcomed!), but
> repetitive posts of the same job with little to no specification, isn't
> really suitable.
>
> Can you please avoid this in future, otherwise the list will be abused by
> recruiters everywhere.
>
>  Thank you
>
> Cal
>
>
>
> On Mon, Feb 10, 2014 at 6:13 PM, Leigh Haugen <leighhau...@gmail.com>wrote:
>
>>  This contract opportunity is in Michigan (obviously not local), but I
>> was wondering if you might be open to posting it in the Chicago Djangonauts
>> Group. It is a great opportunity on a Cloud Development team for somebody
>> who is willing to take a temporary job here in Michigan.
>>
>>
>>
>> *Python / Django Web Applications Developer, Michigan 6+mth contract,
>> $90-$100/hr.*
>>
>> *No phone calls. Please email resumes to:  le...@kdmmcorp.com
>> <le...@kdmmcorp.com>*
>>
>>
>>
>> REQUIREMENTS
>>
>> Must have strong recent experience developing web applications using
>> *Python/Django*
>>
>>
>>
>> ADDITIONAL SKILLS:
>>
>> web development skills (Java, JavaScript, HTML and CSS)
>>
>> great interest in user experience and usability
>>
>> scaleable web development experience
>>
>>
>>
>> *Leigh Haugen*
>>
>> Managing Partner
>>
>> KDMM Corp
>>   --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/003c01cf268b%24c5b273f0%2451175bd0%24%40gmail.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussio

Re: Python / Django Web Applications Developer - Michigan $90-$100/hr

2014-02-10 Thread Cal Leeming [Simplicity Media Ltd]
Leigh,

As mentioned before, posting jobs is allowed (and welcomed!), but
repetitive posts of the same job with little to no specification, isn't
really suitable.

Can you please avoid this in future, otherwise the list will be abused by
recruiters everywhere.

Thank you

Cal



On Mon, Feb 10, 2014 at 6:13 PM, Leigh Haugen  wrote:

> This contract opportunity is in Michigan (obviously not local), but I was
> wondering if you might be open to posting it in the Chicago Djangonauts
> Group. It is a great opportunity on a Cloud Development team for somebody
> who is willing to take a temporary job here in Michigan.
>
>
>
> *Python / Django Web Applications Developer, Michigan 6+mth contract,
> $90-$100/hr.*
>
> *No phone calls. Please email resumes to:  le...@kdmmcorp.com
> *
>
>
>
> REQUIREMENTS
>
> Must have strong recent experience developing web applications using
> *Python/Django*
>
>
>
> ADDITIONAL SKILLS:
>
> web development skills (Java, JavaScript, HTML and CSS)
>
> great interest in user experience and usability
>
> scaleable web development experience
>
>
>
> *Leigh Haugen*
>
> Managing Partner
>
> KDMM Corp
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/003c01cf268b%24c5b273f0%2451175bd0%24%40gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagFT7%2BXXEtRctqqp-W4LO716HH8eyUGtpg_nDecGELr9oQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: RPython / Django Web Applications Developer - Michigan $90-$100/hr

2014-01-30 Thread Cal Leeming [Simplicity Media Ltd]
Hi Leigh,

Not sure if this was double posted in error, but if not, can you avoid
double posting in future please?

You can always bump the previous thread :)

Cal


On Thu, Jan 30, 2014 at 8:51 PM, Leigh Haugen  wrote:

> Great opportunity on a Cloud Development team for somebody who is willing
> to take a temporary job here in Michigan.
>
>
>
> *Python / Django Web Applications Developer, Michigan 6+mth contract,
> $90-$100/hr.*
>
> *No phone calls. Please email resumes to:  le...@kdmmcorp.com
> *
>
>
>
> REQUIREMENTS
>
> Must have strong recent experience developing web applications using
> *Python/Django*
>
>
>
> ADDITIONAL SKILLS:
>
> web development skills (Java, JavaScript, HTML and CSS)
>
> great interest in user experience and usability
>
> scaleable web development experience
>
>
>
> *Leigh Haugen*
>
> Managing Partner
>
> KDMM Corp
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/007501cf1dfd%2410b5e040%243221a0c0%24%40gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagFh_yk%3DkbAHhLwxS8pBb6VnNQTFfD7f_991bj_6CyTyrQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Do you think Django's future is threatened by JS frameworks in both client & server?

2014-01-28 Thread Cal Leeming [Simplicity Media Ltd]
+1 well said.

Cal


On Tue, Jan 28, 2014 at 4:59 PM, James Turley <
jamesturley1...@googlemail.com> wrote:

> I'm not sure I buy this stuff about JS taking over everything. The reason
> is that client and server are different domains, and we might reasonably
> expect - even in a pure JS-only shop - people to specialise anyway. Apart
> from the tiniest start-ups, there isn't really an evolutionary advantage to
> having the same language on both ends. Rather than people who know x
> language, you primarily want people with familiarity with the
> domain-specific problems.
>
> It's worth noting that the JS hype is not the only thing at the moment:
> among functional programming evangelists, there is a sense that "their time
> has come" after years on the CS-boffin fringe. The theory goes like this -
> nowadays, major web apps are deployed on enormous server clusters,
> sometimes with enormous numbers of virtual or real CPU cores, database
> sharding and so forth. The key problems facing server-side dev work - at
> least at the top end of the web - have to do with handling all this,
> parallelism, async, race conditions and so forth. A relatively 'pure' FP
> language like Haskell, with its divine commandments against mutable state
> and focus on pure functions, has a headstart on OOP languages like Python &
> Ruby in this domain.
>
> JS is *sort of *an FP language, and can be used to write pure code, but
> has hitherto been used almost exclusively as a simple interface to that
> great clump of mutable global state called the DOM; it certainly does not
> enforce good FP practices or anything like that. The Node model of
> event-driven IO is obviously directed at this group of problems, but it's
> very much a work in progress, despite all the hype. (This is also a problem
> I have with client-side MV* frameworks, BTW: I'm promised that picking up
> Ember is a breeze, but major parts of the API change so frequently that it
> gives me actual nightmares.)
>
> Meanwhile, we've got the Async IO library coming in Python 3.4; and, as
> others have pointed out, a headstart on big data crunching thanks to
> Python's excellent math/science ecosystem. I'm sure the Ruby people have
> tricks up their sleeve. And there's Go. And Scala. And Clojure. And ...
>
> The point is: there's an enormous explosion of new tools around, plus
> serious improvements in old favourites. Devs who know what's good for them
> will use the correct tool for the job at hand; the cognitive convenience of
> working in one language only is a part of that decision, but only a part.
>
>
> On Tue, Jan 28, 2014 at 4:27 PM, Cal Leeming [Simplicity Media Ltd] <
> cal.leem...@simplicitymedialtd.co.uk> wrote:
>
>> It makes for an interesting debate and food for thought.
>>
>> Python has a lot of libraries and user contributions which can speed up
>> development, but like every language, has it's good sides and bad sides.
>>
>> Django holds a strong position, libraries such as south, pipeline,
>> mongoengine, uWSGI and the Django ORM itself make it incredibly easy to get
>> clean code quickly out the door.
>>
>> Personally I think the biggest risk to Django's future is lack of public
>> contributions (separate debate), and evolution being held back for
>> backwards compatibility reasons (again, separate debate), rather than any
>> threat from new kids on the block. I would be quite surprised if NodeJS (as
>> an example) overtook Django in terms of functionality and popularity.
>>
>> Disclaimer: I'm +1 python and -0 JS, and thus slightly biased.
>>
>> Cal
>>
>>
>>
>>
>>
>> On Mon, Jan 27, 2014 at 10:44 PM, <damondevi...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I would like to know if this community is somewhat worried about the
>>> future relevance of Django (and other purely server-side MV* Python web
>>> app frameworks such as web2py for that matter) given the current momentum
>>> of JavaScript (JS) everywhere?
>>>
>>> There are many competing architecture patterns for a WHOLE web app today
>>> ranging:
>>> a)  from client-heavy SPA with a client-side MVC framework synching its
>>> models via a REST API with a server-side reduced to a database access layer
>>>
>>> b) to light client apps with a server-side MVC frameworks and very
>>> little or no Ajax
>>>
>>> c) and everything in the middle.
>>>
>>> I guess it is not too controversial to say that which is best (or even
>>> merely adequate) depends on the generally moving target of the app
>>> requirements (especially the non-

Re: Do you think Django's future is threatened by JS frameworks in both client & server?

2014-01-28 Thread Cal Leeming [Simplicity Media Ltd]
It makes for an interesting debate and food for thought.

Python has a lot of libraries and user contributions which can speed up
development, but like every language, has it's good sides and bad sides.

Django holds a strong position, libraries such as south, pipeline,
mongoengine, uWSGI and the Django ORM itself make it incredibly easy to get
clean code quickly out the door.

Personally I think the biggest risk to Django's future is lack of public
contributions (separate debate), and evolution being held back for
backwards compatibility reasons (again, separate debate), rather than any
threat from new kids on the block. I would be quite surprised if NodeJS (as
an example) overtook Django in terms of functionality and popularity.

Disclaimer: I'm +1 python and -0 JS, and thus slightly biased.

Cal





On Mon, Jan 27, 2014 at 10:44 PM,  wrote:

> Hi,
>
> I would like to know if this community is somewhat worried about the
> future relevance of Django (and other purely server-side MV* Python web
> app frameworks such as web2py for that matter) given the current momentum
> of JavaScript (JS) everywhere?
>
> There are many competing architecture patterns for a WHOLE web app today
> ranging:
> a)  from client-heavy SPA with a client-side MVC framework synching its
> models via a REST API with a server-side reduced to a database access layer
>
> b) to light client apps with a server-side MVC frameworks and very little
> or no Ajax
>
> c) and everything in the middle.
>
> I guess it is not too controversial to say that which is best (or even
> merely adequate) depends on the generally moving target of the app
> requirements (especially the non-functional ones) and thus a long
> lifecycle app can be expected to have to change pattern at some point.
>
>
> Given that:
> 1) full web apps following any pattern can today be developed exclusively
> with JavaScript (JS) frameworks on both sides who have incorporated most
> (if not all) great design ideas from Django (and Rails)
>
> 2) IDEs ranging from Visual Studio to browser-based ones are available to
> support such development
>
> 3) Python in the browser projects do not yet provide productive debugging
> support (and will they ever without support from a tech giant?)
>
> 4) Cloud giants (Amazon, Google, Heroku, Microsoft) all offering JS framework
> running servers
>
> are the productivity gains from the more legible, concise and abstract
> Python code as compared to JS code really compensate the productivity
> loss of having to port part of the app from one language to other every
> time it must be pushed from one side (say server) to the other (say
> client), or even to maintain a code base in two languages instead of one?
>
> Why then adopt Django (or web2py) for a new project today, instead of
> going pure JS?
>
> I am a big Python fan in terms of design and principles, but I am fearing
> that it has started to lose the popularity/adoption/community size battle
> against JS, which, from a pragmatic productivity standpoint is relevant
> and thus potentially snowballing after a tipping point is reached. Trends
> are deadly fast in web development, cf. how quickly J2EE+static HTML, then
> J2EE+Flash and .NET+Silverlight have fallen from grace.
>
> Any thought on this?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f01c1f78-aac4-467c-a777-a70ecd0de61e%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagGvjtxt9wL727rKYpV2_QJWuYP0%3DAhY7xE7uZ%3D7gjwC4g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Hi All, I am looking for a Python / Django Developer to join my digital agency client in central London! Immediate interview - Permanent position - The Digital Recruitment Firm

2014-01-23 Thread Cal Leeming [Simplicity Media Ltd]
Gareth,

You might get a better response if you put more details about the position
you are offering.

Considering the phrase "digital agency" is about as over-used as the word
cloud, this email is little more than useless spam in it's current format.

Tell people what you have to offer, and why they should get in touch with
you (posting a spec is even better).

Cal


On Thu, Jan 23, 2014 at 9:27 AM, Gareth Hill wrote:

> Email: i...@thedigitalrecruitment-firm.co.uk
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c793d20c-db70-483d-bb80-6be980b16079%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagHxo0wY4D6_PU%3DKzpOZXwzQb7-xj6n-SaOWDp%3Dxbk9hpg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ViewDoesNotExist at /admin/

2013-12-27 Thread Cal Leeming [Simplicity Media Ltd]
Hello,

Perhaps try installing a completely new/fresh dev environment in a
vmware/virtualbox instance, and attempt to get it working from there, that
will at least help you narrow this problem down locally instead of poking
around at production. Also try and make sure you install the same
OS/release as what you are trying to deploy in production. You should also
use virtualenv/virtualenvwrapper to help reduce the chance of
library/dependency conflict.

Also heads up - realistically the mailing lists are here to point you in
the right direction, but it's up to you to do as much of the work as
possible. If you come up against a problem, 99% of the time Google will
already have the answer. Some great examples of how to use Google
accurately can be found at
https://code.djangoproject.com/wiki/UsingTheMailingList .

If you're not sure how to use any of the things mentioned, then here are
some good starting points for learning;

http://gettingstartedwithdjango.com/ - Django learning
http://learnpythonthehardway.org/book/next.html - Python learning
http://virtualenvwrapper.readthedocs.org/en/latest/

Hope this helps, and remember to update this thread once you figure out the
answer so others can find it in the future.

Cal




On Fri, Dec 27, 2013 at 12:34 PM, Gabriele Stoia wrote:

> Thank you Tom for your answer.
> I'm sorry but I don't have much experience with Django...
>
> Do you have an idea how to fix this problem ?
>
> Thanks in advance
> Gabri
>
> Il giorno martedì 24 dicembre 2013 20:58:32 UTC+7, Thomas ha scritto:
>>
>>
>> On 2013-12-23, at 9:42 PM, Gabriele Stoia  wrote:
>>
>> I think I found the problem...maybe...
>>
>> I running my app in the same hosting of another app ... (sorry for my
>> english..is not my first language... I'm italian…)
>>
>>
>> If you are not using virtualenv and pip to manage each of these
>> installations you will likely find it useful to do so. It should eliminate
>> worries about conflicts between version sets.
>>
>> hth
>>
>>   - Tom
>>
>>
>>
>> I have
>>
>>
>>
>>
>>
>>
>>
>> *-- first app-- feincms-- other module-- ...--second app-- -- feincms--
>> -- other module*
>>
>> Maybe my second-app is using feincms of the first app which is different
>> version.
>> I think this because I got this error :
>>
>> No module named filterspecs
>> /home/*alessandrocambogia*/feincms/admin/filterspecs.py in , line 7
>>
>> where *alessandrocambogia *is the first-app.
>>
>> I need to have
>> /home/alessandrocambogia/*gabryandjenny*/feincms
>>
>> where *gabryandjenny * is the second-app
>>
>> but actually I don't know how to change the path... Is my first experience 
>> in Django.
>> Can you help in this  Please ???
>> Thank you in advance.
>>
>> Gabri
>>
>>
>>
>>
>> Il giorno martedì 24 dicembre 2013 07:45:02 UTC+7, Russell Keith-Magee ha
>> scritto:
>>>
>>>
>>> On Mon, Dec 23, 2013 at 10:53 AM, Gabriele Stoia wrote:
>>>
 Hi Russel,

 thank you for your e-mail !!!
 I thought that something was connected with MPTT or FeinCMS... I'll try
 to work out !
 What I really don't understand why so many problem when you in
 deployment ??? In local everything was super fine !!!

>>>
>>> If you're having "deployment only" problems, this points to a problem
>>> with the way your development process is organised. These sorts of problems
>>> only emerge because your development environment is fundamentally different
>>> to your production environment -- for example, different versions of
>>> software, different paths. If you make good use of virtualenv to isolate
>>> your project, and use requirements files to ensure version compatibility,
>>> you should be able to minimise this sort of problem.
>>>
>>> Yours,
>>> Russ Magee %-)
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users...@googlegroups.com.
>> To post to this group, send email to django...@googlegroups.com.
>>
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/django-users/e66a8967-5e82-43b2-9ba8-8736cb192025%
>> 40googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>> Tom Lockhart
>> tlockh...@gmail.com
>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9bd66d58-20d2-40fd-8445-e1e7910b9507%40googlegroups.com
> .
>

Re: Good news for Django devs - labbler.com code has been released to public

2013-12-26 Thread Cal Leeming [Simplicity Media Ltd]
I wish I knew what it was, but it's all in Russian.. :/

Cal


On Thu, Dec 26, 2013 at 10:24 PM, Alexander Grytsenko <
alexander.grytse...@dev-pro.net> wrote:

> As an example of successful commercial product built on top of Django
> framework: https://github.com/agrytsenko/labbler
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/ba33e493-2341-4f7b-be91-4194217ef056%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagGPmJMUjp4SjSXQT6dGFYbRe4vZKCP2F-kGTvag%3DOdpnw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: I'm looking for a Part-Time (4h/day) Django job - remote only

2013-11-21 Thread Cal Leeming [Simplicity Media Ltd]
I'll be very surprised if you get any offers from this post in its
current format, you might get a better response if you post more
information about yourself.

For example;

* Blog (if you have one)
* Linkedin profile
* Github profile
* Your real name

Hope this helps

Cal

On Thu, Nov 21, 2013 at 7:33 PM, Python_enthusiast
 wrote:
> I'm looking for a  Part-Time (4h/day) Django job. I've more than one and a
> half year of experience using Django.
>
> - very good knowledge of Python/Django
> - experience with MySql, PostgreSql
> - Linux, GIT
> - competent in technologies like JS, HTML, Ajax
> - knowledge of good programming practice
> - Python enthusiast
>
> Contact with me:
> pythonde...@gmail.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/ee21ad61-b36a-43af-9557-300eedbfe016%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagFdr6CpvezJN1TL%2BcfmnGLg02L%3DSz_M0xbr0YRULR-%3DSA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ABOUT DJANGO

2013-11-09 Thread Cal Leeming [Simplicity Media Ltd]
Hugar,

Perhaps you could review the following;

https://wiki.python.org/moin/BeginnersGuide/Download
https://docs.djangoproject.com/en/dev/topics/install/
http://www.youtube.com/watch?v=rIVwVOpwpsA

I found these by searching in Google for "how to install django" and
"how to install python".

Quite often you have find all the information you need just by being
smart with your Google searches, there are some great examples of this
here;
https://code.djangoproject.com/wiki/UsingTheMailingList#Trytofindtheanswersyourself

Please do remember that everyone on this list is a volunteer, quite
often the best way to get a good response is to include as much
information as possible. Specifically, explain what you have tried so
far and make an effort to show you've done your home work.

If you are not a native English speaker, you could try writing your
email in your native language but this will limit the number of people
able to understand/reply to your question (you could perhaps include a
short paragraph explaining that your English is not good).

Cal


On Sat, Nov 9, 2013 at 6:39 PM, HUGAR MANJUNATH Manjunath
 wrote:
> HELLO , I AM NOT GETTING HOW TO INSTAL THE DJANGO AND PYTHAN ON OUR MACHINE.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/133d769f-dd63-4e69-b14b-f4e25b3bc259%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagGAbdZQBUytQw7_0-4_Fpk1L5-muF3RObNjffFjg4om6g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Recommended dev environment for a Django project deployed to Linode

2013-09-25 Thread Cal Leeming [Simplicity Media Ltd]
+1 for virtualenvwrapper, don't know how I survived without this!!

Cal


On Wed, Sep 25, 2013 at 9:59 PM, Roberto López López
wrote:

>
> Check virtualenvwrapper
>
> http://virtualenvwrapper.readthedocs.org/en/latest/
>
>
>
>
> On 09/25/2013 08:06 PM, Jorge Arevalo wrote:
>
> Fine. I don't think my boss is going to pay for PyCharm license, so I'll
> probably go for Eclipse now (I don't really like it too much, but if works,
> it's ok for me)
>
>  About virtualenv, is there any method to provide something like a script
> to create a virtualenv, install the needed software and have a working
> environment in a few commands? Something like "vagrantfile for virtualenv"
> http://docs.vagrantup.com/v2/vagrantfile/index.html
>
>  Again, many thanks for your useful insights
>
> On Tuesday, September 17, 2013 4:29:14 PM UTC+2, Vernon D. Cole wrote:
>>
>>  Answering the other half of your question:  The choice of IDE is not
>> nearly as important as its ease of integration with your dvcs.  If you are
>> already familiar with a good one, don't change.
>>
>> On my present project, my boss and I are both using PyCharm, and my other
>> co-worker is using Eclipse, since he is more comfortable (and therefore,
>> more productive) with it. Both IDE's have good integration with git (my
>> least favourite dvcs, but the boss's choice) and our sharing is done using
>> a group private repository on github.  This is on Ubuntu Linux, it all
>> works well.   In the evening hours, I use PyCharm on Windows 7 to
>> contribute to an open source project hosted on bitbucket using mercurial.
>> Both projects end up being tested on the same Linode.
>>
>> Yes, use virtualenv.  I also made the mistake of thinking of it as a
>> virtual computer.  It is not.  It is only a method of separating Python
>> library directories so that you can experiment with different
>> configurations easily.  It does not slow anything down, and actually makes
>> installation of packages easier.  Use virtualenvwrapper to make switching
>> environments easy.  PyCharm also supports virtual environments as well as
>> django projects. It is commercial, and suffers from a few Java
>> idiosyncrasies, but the boss paid for the license ;-) so I don't mind.
>>
>>--
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
> --
>
> Roberto López López
> System Developer
> Parallab, Uni Computing+47 55584091
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Exception Value: global name 'dictfetchall2' is not defined

2013-09-08 Thread Cal Leeming [Simplicity Media Ltd]
Ah sorry yeah, I forgot you needed @staticmethod decorator on the class
method.

To be honest though, that method should be a standalone function, not a
method (as James said, you need to re-think your approach!)

Cal


On Sun, Sep 8, 2013 at 9:25 PM, Pepsodent Cola <pepsodentc...@gmail.com>wrote:

> Hi Cal,
>
> I replaced the code with this:
> row = AltwordManager.dictfetchall2(cursor)
>
> Then I got a different error message that I don't understand?
> ExceptionValue:
>
>
>
>
> unbound method dictfetchall2() must be called with AltwordManager instance as 
> first argument (got CursorDebugWrapper instance instead)
>
>
>
>
>
>
>
> On Sunday, September 8, 2013 9:54:36 PM UTC+2, Cal Leeming [Simplicity
> Media Ltd] wrote:
>
>> Try and replace
>> row = dictfetchall2(cursor)
>>
>> With this
>> row = AltwordManager.dictfetchall2(**cursor)
>>
>> Cal
>>
>>
>> On Sun, Sep 8, 2013 at 8:23 PM, Pepsodent Cola <pepsod...@gmail.com>wrote:
>>
>>> I don't understand how to fix this error message?  Here is the code that
>>> made things break.
>>>
>>> Exception Value: global name 'dictfetchall2' is not defined
>>>
>>>
>>>
>>> #_**__**
>>> 
>>>
>>> def dictfetchall(cursor):
>>> "Returns all rows from a cursor as a dict."
>>> desc = cursor.description
>>> return [
>>> dict(zip([col[0] for col in desc], row))
>>> for row in cursor.fetchall()
>>> ]
>>> #_**__**
>>> 
>>>
>>> class AltwordManager(models.Manager)**:
>>> *def dictfetchall2(cursor):*
>>> "Returns all rows from a cursor as a dict."
>>> desc = cursor.description
>>> return [
>>> dict(zip([col[0] for col in desc], row))
>>> for row in cursor.fetchall()
>>> ]
>>>
>>> def vote_order(self):
>>> "Returns a 1:M list ordered by votes."
>>> cursor =  connection.cursor()
>>> cursor.execute("""
>>> SELECT navi_polls_word.rosword
>>> FROM navi_polls_altword
>>> """)
>>> #row = cursor.fetchall()
>>> #row = dictfetchall(cursor)
>>> *row = dictfetchall2(cursor)*
>>> return row
>>>
>>> ...
>>> ...
>>> #_**__**
>>> 
>>>
>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@**googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>>
>>> Visit this group at 
>>> http://groups.google.com/**group/django-users<http://groups.google.com/group/django-users>
>>> .
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>> .
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Exception Value: global name 'dictfetchall2' is not defined

2013-09-08 Thread Cal Leeming [Simplicity Media Ltd]
Try and replace
row = dictfetchall2(cursor)

With this
row = AltwordManager.dictfetchall2(cursor)

Cal


On Sun, Sep 8, 2013 at 8:23 PM, Pepsodent Cola wrote:

> I don't understand how to fix this error message?  Here is the code that
> made things break.
>
> Exception Value: global name 'dictfetchall2' is not defined
>
>
>
>
> #___
>
> def dictfetchall(cursor):
> "Returns all rows from a cursor as a dict."
> desc = cursor.description
> return [
> dict(zip([col[0] for col in desc], row))
> for row in cursor.fetchall()
> ]
>
> #___
>
> class AltwordManager(models.Manager):
> *def dictfetchall2(cursor):*
> "Returns all rows from a cursor as a dict."
> desc = cursor.description
> return [
> dict(zip([col[0] for col in desc], row))
> for row in cursor.fetchall()
> ]
>
> def vote_order(self):
> "Returns a 1:M list ordered by votes."
> cursor =  connection.cursor()
> cursor.execute("""
> SELECT navi_polls_word.rosword
> FROM navi_polls_altword
> """)
> #row = cursor.fetchall()
> #row = dictfetchall(cursor)
> *row = dictfetchall2(cursor)*
> return row
>
> ...
> ...
>
> #___
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Tech start up looking for a Python/Django rockstar - £300/day - fast start

2013-08-20 Thread Cal Leeming [Simplicity Media Ltd]
Hello all,

One of our tech startup clients in London is currently looking for an
experienced Python/Django rockstar.

The position is full time, salary is £300/day, working remotely or on-site,
shares are also being considered for those who can bring exceptional
talent/experience.

Currently in beta, this product is changing the way people eat by making it
easier to plan, order and cook great food.

After just recently finishing a 1-month hackathon to get the product live,
they secured additional alpha funding and need to expand their team.

The product can be seen here;
www.therecipekit.co.uk

Being a hardcore tech team, you will benefit from;

* Good architectural code design
* Clean code
* Efficient communication
* Sane development patterns
* Rapid prototyping (first beta release was finished within 2 weeks, and
re-written twice)
* Other experienced start-up developers to bounce with

Some example requirements include;

* Migration to a new payments provider
* Changes to checkout workflow
* CMS improvements
* Order system control (cancel orders, refund payments etc)
* Discount code abuse prevention
* Notifications system
* Customer lifecycle tracking

The systems we use are;

* Django
* SASS
* South
* devserver
* uWSGI
* Pipeline
* EC2
* CloudFlare
* New Relic
* GIT
* HipChat
* Trello
* Mandrill
* Percona MySQL
* Stripe
* Bootstrap
* jQuery
* Redis
* Celery

Interested? Send us an email and tell us;

* Github profile
* Linkedin profile
* Availability and location
* Example of your best Python code (github/pastebin etc)
* Why we should hire you

Thanks

Cal

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Learning how to build a web site for my python games and a blog

2013-07-31 Thread Cal Leeming [Simplicity Media Ltd]
Try this;

http://learnpythonthehardway.org/book/next.html
http://gettingstartedwithdjango.com/

Cal

On Tue, Jul 30, 2013 at 3:07 PM, Randy Baxley wrote:

> I am trying to learn Django.  I have a good base in Python having worked
> several basic MOOCs and second level classes.  My major short term goal is
> to build a web site where I will have a blog on smoked brisket in Chicago
> and a place to rewrite my games built in the Rice University course
> Interactive Python Programming from Coursera.  Here is the final program
> from that class.  The reason for a rewrite is these are written on
> CodeSkulptor.
>
> http://www.codeskulptor.org/#user16_nkeTb6O5Je_12.py
>
> Here you will find The Django Book written by *Adrian Holovaty who wrote
> Django.*
> *
> *
> http://www.djangobook.com/en/2.0/frontmatter.html
>
> What I am wondering is if anyone else is working through it as well as I
> keep hitting road blocks and the answers I am getting here are not working
> for me in Xumbunto though that may not be the problem.  I have found that a
> group of folks working at the same time tend to hit on ideas in a fashion
> that is more to the point and on fb that it is easy to get back to the
> thread you want since there are not as many threads pertaining to other
> Django topics.
>
> I was also asking if there is another Django tutorial that might be at
> more of a beginner level?
>
> On Saturday, July 27, 2013 8:57:45 AM UTC-5, Randy Baxley wrote:
>>
>> Is anyone working through The Django Book that would like to form a fb
>> page just for that or knows of a good tutorial where questions will get
>> answers?
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: What are the steps to build a website?

2013-03-25 Thread Cal Leeming [Simplicity Media Ltd]
Oh and also, you should consider maybe keeping a journal of your
experiences and put a few hours aside to write up a blog post to help other
people in the future.. if you haven't got a blog, then even just a detailed
mailing list email would suffice :)

One of the reasons Django is such a successful framework is largely due to
the community behind it, both in users and developers contributions.

Cal

On Mon, Mar 25, 2013 at 2:28 PM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

> Hi Benjamin,
>
> Some others have already made some good suggestions, so I'll throw some
> general comments in.
>
> Tim made a good suggestion of 2scoops, you could also try;
> http://learnpythonthehardway.org/book/
> http://www.djangobook.com/en/2.0/index.html
>
> In my own personal opinion, I think you would benefit hugely by starting
> out with some of the URLs mentioned above and in this thread, as well as
> these;
>
> http://eddychan.com/post/15775730174/how-i-learnt-enough-python-django-to-be-dangerous-in-1
> http://tech.yipit.com/2012/02/28/learn-django/
>
> There is also 'Django by Example', although it sadly does not use Class
> Based Views;
> http://lightbird.net/dbe/
>
> There is also a lot of projects that use Django which have been open
> sourced on Github;
> https://github.com/search?q=django=commandbar
>
> Frankline/Shawn comments of "just dive in" is spot on, and Tomas comment
> of "you need to learn" is also correct. The key thing is having a balance
> of the two, programming will always and forever be a learning curve, and
> the day you stop learning is the day you should find a different job. I
> look back on code that I wrote 2-3 years ago and think to myself "this is
> atrociously bad", and I will probably think the same again in another 3
> years time! I have 7+ years of Python and 3+ years of Django experience,
> yet I often take huge amounts of time out to re-train myself on specific
> areas (where cash flow and spare time will allow).
>
> The point is you have to decide where to draw the line on your own
> knowledge, and that is entirely dependent on your end goal. For example, if
> you want to build a small website with technical requirements that are not
> out of the ordinary, then you probably don't need to learn all the depths
> of how different databases work, and instead focus on learning how to
> construct clean/style conforming code. However if you were building
> something that has never ever been done before, then you might prototype it
> in a single Python script and tidy it up later, so you can quickly adapt.
>
> Hope this helps a little bit!
>
> Cal
>
>
> On Mon, Mar 25, 2013 at 11:17 AM, Benjamin Marsili <
> benjamin.angelo.mars...@gmail.com> wrote:
>
>> Hey everyone,
>>
>> I am trying to design a website from scratch using django, it's my first
>> time using it and I read the basic tutorials. Now it's time to get things
>> done and I wonder where to begin. I don't want to make design mistakes.
>>
>> Let's take an internet website for example. There would be a planning and
>> user accounts (at least).
>>
>> 1) Should I create 2 apps, one for user accounts and one for the
>> planning? If yes, the rest of the code (templates, login page and other
>> basic pages) should go in the project and not in an app?
>>
>> 2) Should I start by creating templates for the look of the website? Or
>> should I populate and test the DB models first?
>>
>> 3) Where would the generic code go? For example if I want to share a
>> function that will return the HTML header, do I have to copy it in each app?
>>
>> If you have guidelines to get a project going around django please share
>> them here!
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: What are the steps to build a website?

2013-03-25 Thread Cal Leeming [Simplicity Media Ltd]
Hi Benjamin,

Some others have already made some good suggestions, so I'll throw some
general comments in.

Tim made a good suggestion of 2scoops, you could also try;
http://learnpythonthehardway.org/book/
http://www.djangobook.com/en/2.0/index.html

In my own personal opinion, I think you would benefit hugely by starting
out with some of the URLs mentioned above and in this thread, as well as
these;
http://eddychan.com/post/15775730174/how-i-learnt-enough-python-django-to-be-dangerous-in-1
http://tech.yipit.com/2012/02/28/learn-django/

There is also 'Django by Example', although it sadly does not use Class
Based Views;
http://lightbird.net/dbe/

There is also a lot of projects that use Django which have been open
sourced on Github;
https://github.com/search?q=django=commandbar

Frankline/Shawn comments of "just dive in" is spot on, and Tomas comment of
"you need to learn" is also correct. The key thing is having a balance of
the two, programming will always and forever be a learning curve, and the
day you stop learning is the day you should find a different job. I look
back on code that I wrote 2-3 years ago and think to myself "this is
atrociously bad", and I will probably think the same again in another 3
years time! I have 7+ years of Python and 3+ years of Django experience,
yet I often take huge amounts of time out to re-train myself on specific
areas (where cash flow and spare time will allow).

The point is you have to decide where to draw the line on your own
knowledge, and that is entirely dependent on your end goal. For example, if
you want to build a small website with technical requirements that are not
out of the ordinary, then you probably don't need to learn all the depths
of how different databases work, and instead focus on learning how to
construct clean/style conforming code. However if you were building
something that has never ever been done before, then you might prototype it
in a single Python script and tidy it up later, so you can quickly adapt.

Hope this helps a little bit!

Cal


On Mon, Mar 25, 2013 at 11:17 AM, Benjamin Marsili <
benjamin.angelo.mars...@gmail.com> wrote:

> Hey everyone,
>
> I am trying to design a website from scratch using django, it's my first
> time using it and I read the basic tutorials. Now it's time to get things
> done and I wonder where to begin. I don't want to make design mistakes.
>
> Let's take an internet website for example. There would be a planning and
> user accounts (at least).
>
> 1) Should I create 2 apps, one for user accounts and one for the planning?
> If yes, the rest of the code (templates, login page and other basic pages)
> should go in the project and not in an app?
>
> 2) Should I start by creating templates for the look of the website? Or
> should I populate and test the DB models first?
>
> 3) Where would the generic code go? For example if I want to share a
> function that will return the HTML header, do I have to copy it in each app?
>
> If you have guidelines to get a project going around django please share
> them here!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: An alternate cry for help

2013-03-24 Thread Cal Leeming [Simplicity Media Ltd]
Hi Christos,

I cannot comment directly on Pinax as I have never used it before, however
I can give some general comments.

Asking how to make a social network is the same as asking how to make a
game, how to build a car, how to write a book etc.. it *completely* depends
on what your end goal is, and how deep down the rabbit hole you want to go.

If your end goal is to better your development skills in Python, then you
could start out with something like this;
http://learnpythonthehardway.org/

If this is not your end goal, then you will have certain limitation. For
example, I could use (CMS FRAMEWORK HERE) to make a very basic blog with
zero programming skill, but extending the functionality would require
either a pre-existing plugin, or time being spent on learning the framework
and language.. I could possibly throw together a very quick hack, or spend
X amount of time learning every little bit about what I'm doing.

An excellent place to start looking would be on github, there are plenty of
projects you could use for inspiration/examples to get you started.

Hope this helps

Cal

On Sat, Mar 23, 2013 at 7:28 AM, Christos Jonathan Hayward <
christos.jonathan.hayw...@gmail.com> wrote:

> I wrote earlier asking if someone could correct my ignorance to go from
> Pinax building blocks to a working site. Since then, I searched Safari, and
> found five references to Pinax, at
> http://my.safaribooksonline.com/search?q=Pinax . One is a tangent in a
> Django book I wrote; three are Python books I didn't write; and one is an
> iPhone JavaScript book that includes 'pinax' in a Greek-English lexicon's
> URL.
>
> I realized after posting the original post below that although I'm an avid
> learner my ignorance of Pinax may be a bit of a challenge to straighten
> out. So besides the possibility of educating me to really know how to put
> Pinax sites together, could someone preassemble a complete social site that
> just needs database setup, a syncdb, and a gunicorn invocation? It would be
> nice to have the earlier Pinax Social Project reimplemented using the new
> tools, as opposed to the pinax-social-project which is a set of building
> blocks to complete a social project. It seems the general approach is to
> turn over better and better building blocks to the user, but the
> already-working sensible default has its merits, and I'd appreciate those
> merits after a day of struggling with old Pinax, new Pinax, borrowed Pinax,
> blue Pinax, not getting any responses with good learning resources, and
> searching Safari and recognizing that O'Reilly's whole Safari does not
> contain as much information about Pinax as the email you are reading, not
> enough by half, and that kind of makes my ignorance a less changeable
> condition. If I'm ignorant about Django but have the Django documentation
> and the Django book, I can reduce my ignorance. Here I don't see how I can
> reduce my ignorance, and my thoughts turn to an evaluation that working
> Pinax is excellent, not-configured Pinax that you don't know how to improve
> is worth very little, and Liferat is mediocre but works, in its own special
> way.
>
> *After a day or so of losing at trying to make pinax-social-network 1.0
> have the merits of Pinax social-project 0.5 or .7, I'd like to ask how to
> cut with the grain instead of against it.*
>
> *The earlier version came as a fully functional site: you could override
> and customize if you want, but it came "batteries included", as a room with
> well-chosen pegs on the walls, pictures hanging on the hooks, and furniture
> as needed. You could replace as much of the room's initial contents as you
> wanted, but it came as a furnished room.*
>
> *Pinax-social-network 1.0 is not a furnished room. It has pegs, and the
> pegs are about as well-placed as you could ask for, but if you want
> pictures on those pegs, it's on you to put pictures on the pegs. And there
> is space you can put furniture in the room; the room is left empty so you
> can put whatever furniture you want in. And the room comes with elegantly
> placed lorem ipsum graffiti on the walls, to motivate you to paint or
> wallpaper the walls to meet your taste. It comes "batteries removed."*
>
> *So... what are the resources, and how does one go about, making a social
> network here? Do I just take it as a bit of Django putty? I expect I'd do a
> lot of reinventing the wheel if I just use Django knowledge. Is there a
> tutorial that shows how to make a live site out of one of Pinax's projects?
> *
>
> *I spent a bit of time reading about Liferat Liferay before remembering
> how painful it was even when I knew it well. The problem here may just be
> that I am ignorant about Pinax, and ignorance is a changeable condition.*
>
> *So let's say I know something about Python, something about Django and
> something about older, fully assembled versions of Pinax, but not how to
> take a starter Pinax project and make a finished site out of it. I'm
> ignorant on that 

Re: Bulk delete - performance / object collection

2013-01-02 Thread Cal Leeming [Simplicity Media Ltd]
That's an interesting perspective actually..

"Don't be a slave of your mind (or ORM)"

Cal

On Wed, Jan 2, 2013 at 12:01 PM, Larry Martell wrote:

> On Wed, Jan 2, 2013 at 4:29 AM, George Lund  wrote:
> > I'm trying to bulk-delete several million rows from my database.
> >
> > The docs for Django 1.3 say "this will, whenever possible, be executed
> > purely in SQL". A pure-SQL delete is what I want in this case, so that's
> > fine.
> >
> > However, the code is never getting as far as running any SQL.
> >
> > Interrupting the script shows that the delete method on the QuerySet is
> > trying to use a "Collector" to construct model instances for each row I'm
> > trying to delete. This is going to take too long (and may in fact consume
> > all the memory available) -- I don't think it's practical to wait in this
> > case. (I've tried waiting over half an hour!)
> >
> > (I'm looking at django.db.models.query.QuerySet.delete and
> > django.db.models.deletion.Collector.collect / Collector.add.)
> >
> > What's the point in doing the delete "purely in SQL" if all of the
> objects
> > are getting constructed anyway? Why do they need to be "collected" before
> > the SQL DELETE is run? The model instance in this case has no child
> rows, to
> > which the delete might need to be cascaded.
> >
> > Meanwhile I can construct the SQL by hand easily enough, but I feel this
> > isn't doing things the right way.
>
> I've had this discussion with other developers. Many feel they need to
> slavishly adhere to the ORM and if you don't you're some type of evil
> entity. I could not disagree more. Django and the ORM are tools, and
> should be used only when they are the right tools for the job. I'd
> just go ahead and do the delete in SQL.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Bulk delete - performance / object collection

2013-01-02 Thread Cal Leeming [Simplicity Media Ltd]
Hi George,

This is one area I spent quite a lot of time in personally, see;
https://groups.google.com/forum/?fromgroups=#!msg/django-users/iRhWD0FtW8k/0KAMF3ub-ZYJ
https://groups.google.com/forum/#!topic/django-users/hgLrwMoFLII

Bulk operations using the ORM isn't always the right thing to do - and it
entirely depends on what you consider bulk and acceptable performance.

You might want to look at the source code for this, to see how they handle
bulk operations (they implemented the same bulk_update approach mentioned
in the above threads)
http://pypi.python.org/pypi/dse

Although bypassing the ORM might feel wrong at first, sometimes it is
completely acceptable - you just need to make sure you don't abuse/misuse
it unnecessarily.

Cal

On Wed, Jan 2, 2013 at 11:29 AM, George Lund  wrote:

> I'm trying to bulk-delete several million rows from my database.
>
> The docs for Django 
> 1.3say
>  "this will, whenever possible, be executed purely in SQL". A pure-SQL
> delete is what I want in this case, so that's fine.
>
> However, the code is never getting as far as running any SQL.
>
> Interrupting the script shows that the delete method on the QuerySet is
> trying to use a "Collector" to construct model instances for each row I'm
> trying to delete. This is going to take too long (and may in fact consume
> all the memory available) -- I don't think it's practical to wait in this
> case. (I've tried waiting over half an hour!)
>
> (I'm looking at django.db.models.query.QuerySet.delete and 
> django.db.models.deletion.Collector.collect
> / Collector.add.)
>
> What's the point in doing the delete "purely in SQL" if all of the objects
> are getting constructed anyway? Why do they need to be "collected" before
> the SQL DELETE is run? The model instance in this case has no child rows,
> to which the delete might need to be cascaded.
>
> Meanwhile I can construct the SQL by hand easily enough, but I feel this
> isn't doing things the right way.
>
> thanks for any help
>
> George
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/W4LqKzcnlaYJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django community, is it active?

2012-12-19 Thread Cal Leeming [Simplicity Media Ltd]
LOL omg, I just realised I was spelling beer wrong.

Cal

On Wed, Dec 19, 2012 at 1:32 PM, Tom Christie <christie@gmail.com>wrote:

> > Is this worth going? --- http://2013.djangocon.eu
>
> Yes, yes, yes, yes, and yes.  I've been to two DjangoCons, both have been
> incredible, and have reaffirmed how proud I am to work in this industry,
> and to be a part of this community.
>
> > Who are the top blogs people within the Django community who should I be
> following, blogs feed etc.
>
> http://www.planetdjango.org/ is an aggregated news feed for Django posts.
>
> Some folks who write regularly...
>
> Daniel Greenfeld (aka pydanny) - http://pydanny.com/
> Reinout van Rees - http://reinout.vanrees.org/weblog/
> Nick Coghlan - http://www.boredomandlaziness.org/
>
> If you haven't already I'd recommend getting yourself tapped into twitter
> and follow some of the core devs and other python/django folks.
>
> Also, a tip - I'd stay well away from the free bear.
> Might look cute at first, but man, those things can get vicious.
> The free beer however, does come recommended.
>
> Cheers,
>
>   Tom
>
> On Wednesday, 19 December 2012 13:02:12 UTC, Cal Leeming [Simplicity Media
> Ltd] wrote:
>
>> Sorry, slightly misworded!
>>
>> Don't /just/ drink the free bear, help out as well.
>>
>> Cal
>>
>> On Wed, Dec 19, 2012 at 3:02 AM, Chris Cogdon <ch...@cogdon.org> wrote:
>>
>>> But I _want_ to drink the free bear.
>>>
>>> On Tuesday, December 18, 2012 3:19:59 PM UTC-8, Cal Leeming [Simplicity
>>> Media Ltd] wrote:
>>>>
>>>>  Don't drink the free bear though, ...
>>>>
>>>
>>>
>>>>   --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To view this discussion on the web visit https://groups.google.com/d/**
>>> msg/django-users/-/Je-**VbEdMmoQJ<https://groups.google.com/d/msg/django-users/-/Je-VbEdMmoQJ>
>>> .
>>>
>>> To post to this group, send email to django...@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users...@**
>>> googlegroups.com.
>>>
>>> For more options, visit this group at http://groups.google.com/**
>>> group/django-users?hl=en<http://groups.google.com/group/django-users?hl=en>
>>> .
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/pVVzxQCEmdwJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django community, is it active?

2012-12-19 Thread Cal Leeming [Simplicity Media Ltd]
Sorry, slightly misworded!

Don't /just/ drink the free bear, help out as well.

Cal

On Wed, Dec 19, 2012 at 3:02 AM, Chris Cogdon <ch...@cogdon.org> wrote:

> But I _want_ to drink the free bear.
>
> On Tuesday, December 18, 2012 3:19:59 PM UTC-8, Cal Leeming [Simplicity
> Media Ltd] wrote:
>>
>>  Don't drink the free bear though, ...
>>
>
>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/Je-VbEdMmoQJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django community, is it active?

2012-12-18 Thread Cal Leeming [Simplicity Media Ltd]
Hi Sparky,

I've personally been using Django for approximately 3 years now - so I'll
offer you my own opinion.

In some ways, it is the most beautiful/perfect framework currently
available.. and in other ways, it leaves a sense of disappointment and
frustration.

* Community - possibly one of the best/most helpful I've seen so far. Don't
drink the free bear though, try and help out where you can!
* Core devs - although sometimes they can seem a bit uppity, they /usually/
know what their talking about and make good decisions
* django-admin - beautiful if you want a simple staff only admin interface
for your data.. terrible if you want to make custom modifications
* Models - the main reason I love Django so much. The models 'just work',
and the query API is lovely. Still room for improvement, but so much better
than sqlalchemy
* Views - class based views are great, but I personally feel that the
pre-made TemplateView/ListView is atrocious. I always use a generic View
and build my own structure.
* Middleware and DB routers - really handy, and again it just works
* Probably tons of other little things that I forgot

There is of course some overhead and a somewhat steep learning curve
(depending on your background) in getting a base project configured, but
don't let this put you off.

Working with a framework is like any relationship... you make sacrifices..
the love you get back depends on what you put in.. and it's not just about
the end goal, it's about how you got there.

Cal


On Tue, Dec 18, 2012 at 10:29 PM, sparky  wrote:

> thanks Nik,
>
>
> On Tuesday, December 18, 2012 9:36:42 PM UTC, sparky wrote:
>>
>> I'm hoping this is the right place to ask such questions, please forgive
>> me if not.
>>
>> I'm making a real time investment in learning another server side
>> language. I have 10 years ColdFusion, 5 years  PHP, JAVA. Having never
>> touched Python let alone the framework Django, for the past 4 weeks I have
>> been testing Django out. Darn, Raspberry Pi started me with my blog (
>> http://www.glynjackson.org/**blog/ ) I
>> have to say its nice, however my concerns are now to do with the community
>> and not so much with the framework itself.
>>
>> No one likes to back a loser and every time I search for Django community
>> I'm faced with a host of negative posts. for example:
>> http://news.ycombinator.com/**item?id=2777883
>>
>>
>> Unlike other languages I'm active in and still use, I'm also finding it
>> hard to find any user groups locally in the UK (I'm based in Manchester,
>> UK).
>>
>> So from the community itself how alive is Django? Should I really invest
>> the time to learn? Does it have a real future and please be honest.
>>
>> other questions
>>
>> 1) is this worth going? --- http://2013.djangocon.eu
>> 2) who are the top blogs people within the Django community who should I
>> be following, blogs feed etc.
>>
>> Sorry for the stupid questions, but and just want a new skillset that I
>> can use for many years to come. Django is really cool
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/_dUN6Su5roIJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Reason for not allowing spaces in usernames?

2012-11-18 Thread Cal Leeming [Simplicity Media Ltd]
(imo) Allowing spaces in username just isn't a very sane approach.

Rather than telling the user to choose a username, why not make them login
with their email address instead? Users are less likely to forget their
email address, and if anything, it would be less error prone than a
username would, especially one with spaces.

By all means, you can allow users to have spaces in their alias / nickname
field, but allowing them to login with it might not be the best approach.

Hope this helps!

Cal

On Sat, Nov 17, 2012 at 8:14 AM, Paul von Hoesslin <
paulvonhoess...@gmail.com> wrote:

> I'm puzzled with this too. Did anyone manage to find a solution to
> resolving spaces in usernames.
>
> Generally a user, these days logs in with their email - that's
> predominately how I've setup all my django projects. People don't remember
> usernames. It is legacy, facebook connects with emails, so does gmail and
> the rest of the world. Username really has fallen back to a NickName /
> Alternative / Alias kind of field. You'd use it if you knew that in your
> application people wouldn't want their real, full names to be displayed.
>
>
> On Friday, June 12, 2009 4:08:12 PM UTC+2, Wiiboy wrote:
>>
>>
>>
>> On Jun 12, 6:55 am, Marco Louro  wrote:
>> > As long as you trim start and trailing spaces, there shouldn't be any
>> > problem, but personally I wouldn't use spaces in usernames at all.
>>
>>  Why not?
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/UGdOmEepavIJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: index_together...shouldn't indexes be created AFTER populating the table?

2012-11-18 Thread Cal Leeming [Simplicity Media Ltd]
Hello Chris,

You are correct that creating indexes AFTER importing data is generally the
fastest approach, but there is currently no automated tool that will do
this all for you.

I actually did a blog post about this not so long ago, and it goes into
some detail;
http://blog.simplicitymedialtd.co.uk/?p=225

One way is to dump the table structures, create a clone of the table, use
SQLYog to compare the clone to the original and copy out only the INDEX
statements, then dump the data too.

But, if you're worried about insert performance then you'd want to think
about using a multi-threaded import approach, using tools such as mydumper
(slightly unstable) or splitting the dump into X number of files based on
line count. You'd also need to tinker with the innodb settings to ensure
the disks are being flushed to all the time, increasing the checkpoint age,
flush method etc.

I am by no means an expert on InnoDB (it's just been recently that I've
started to dive deep into it), and Google will almost certainly
offer infinitely better explanations on which parameters to tune etc.

Generally speaking, you only need to worry about this sort of thing once
you have passed a couple of million rows or approx 20GB datadir size.. The
amount of time this sort of thing consumes, not to mention the increased
risk of error or missing data, really is a pain..

The end conclusion I came to is that mydumper/mysqldump/mysqlimport all
suck, and there is a lot of room for improvement.. I'm hoping to build such
a tool one day :)

Cal

On Wed, Nov 14, 2012 at 8:14 PM, Chris Pagnutti wrote:

> Hi.  The new index_together feature is great, but I think it's best to
> create an index on a table AFTER the table is filled, and assuming there
> won't be many new inserts.  But in django, syncdb creates the index at the
> same time the table is created, and of course, the table is initially
> empty.  How does django deal with this?  Does it know to drop the index
> before inserting new records and re-create the index afterwards?
>
> If not, can I syncdb, drop the index manually in mysql, populate the
> table, then re-create the index manually (as long as I use the same index
> name that django chose)?  Will django be none-the-wiser if I do this?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/gBx54Nzn5X8J.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-30 Thread Cal Leeming [Simplicity Media Ltd]
Just to chime in on this..

In terms of commercial options, we have sometimes gone with ZXTM (now known
as StingRay Traffic Manager) , it has some truly amazing features and you
should definitely check it out. I believe that RiverBed have since started
issuing free commercial licences for up to a certain traffic rate, and it's
a downloadable package/virtual appliance.

We also often use the load balancers that come with Rackspace Cloud, they
have proven to be quite efficient. When using this route, we also tend to
throw everything in front of CloudFlare too (if you haven't seen this
already, check it out. It is free for non SSL usage too!)

In a nut shell;

* ZXTM - commercial (free licence to a certain amount), amazing traffic
script language, self hosted
* Rackspace Cloud - does what it says on the tin, no traffic scripting
* F5 - commercial, not had any personal experience with it (but one of our
providers uses it as a shared load balancer for their customers and it's
been stable)
* haproxy - works, but it can be a pita!
* CloudFlare - this isn't a load balancer, but does give you much better
control over DNS (it proxies your site, and effectively makes 'DNS changes'
instant)

I believe uWSGI has some really good load balancing features too, but I
haven't used them in too much depth yet (despite being an avid user of
uWSGI for 2-3 years!)

Hope this helps

Cal

On Tue, Oct 30, 2012 at 8:14 AM, Kurtis Mullins wrote:

> The easiest thing I've found to use is simply uWSGI with Nginx. It's easy
> to just create new Django servers on the fly. You simply include the IPs in
> a list and it will use various algorithms (optional) to distribute the
> requests appropriately.
>
> As a lot of applications are IO bound, you could also use a distributed
> database system to help with your scalability. I don't have much experience
> in that area, though.
>
> This still leaves a point of failure: Nginx (or whatever load balancer or
> reverse proxy you use). Maybe someone else here will know more about load
> balancing Nginx itself ... that might require specialized hardware. I know
> a lot of cloud services offer load balancers (e.g. rackspace) so you could
> possibly use that with multiple nginx servers and further multiple django
> servers.
>
>
> On Tue, Oct 30, 2012 at 3:42 AM, Isaac XXX  wrote:
>
>> Hi there,
>>
>> maybe you're right, but I'm not really worried about RAM footprint, or
>> resources consumption. I'm concerned now on architecture, setting a right
>> scalable system, and a right cluster of systems, without lacks of
>> communications between them.
>>
>> Underlaying technologies can be easily replaced (say apache-mod_wsgi for
>> gunicorn or uwsgi), and some performance improvements can be made, but this
>> is not what I'm looking for. I'm looking for the tools to generate a robust
>> system, balancing requests through several systems, and allowing increase
>> the size of this system (adding more servers) without trouble.
>>
>> Cheers,
>>
>> Isaac
>>
>>
>> On 10/29/2012 05:18 PM, Some Developer wrote:
>>
>>> On 29/10/2012 16:03, Isaac XXX wrote:
>>>
 Hi there,

 thank you for response Tom.

 Actually, I've a complete idea at how to build this system, but I lack
 the exact information about how to join systems, and what I was looking for
 was a source of cohesive information on all systems. At least, when I
 finish to build that system, I will write this tutorial.

 For someone who can help me, I will describe here what I thought it can
 be this structure:

 - 1 nginx, as a reverse proxy on frontend, serving static/media and
 redirecting content to apache clusters
 - n apache servers, with mod_wsgi, serving dynamic data
 - m postgresql servers, in a master-slave flavour

 Cheers,

 Isaac

>>>
>>> Why not just ditch Apache entirely and just use Nginx for serving all
>>> media (both static and dynamic)? You can then save quite a few resources as
>>> you only need to run one HTTP server rather than two.
>>>
>>> Using Nginx to serve Django content works well. Just serve your Django
>>> application via FastCGI or uWSGI and you'll significantly simplify your
>>> configuration and reduce RAM usage on your servers as well.
>>>
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to django-users+unsubscribe@**
>> googlegroups.com .
>> For more options, visit this group at http://groups.google.com/**
>> group/django-users?hl=en
>> .
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To 

Re: Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-29 Thread Cal Leeming [Simplicity Media Ltd]
Hi Isaac,

If there is one thing I have learnt about scaling apps, it's about trying
things out for yourself.

Sure there are some best practice guidelines (i.e. serving files from
nginx, or using apache's X-SendFile rather than streaming out via the
webapp), but if someone comes along and tells you to use X instead of Y,
then you don't get the advantages of learning "the hard way".

Another important note is that scaling rarely goes up on a 1:1 ratio, i.e.
the configuration and resources required to handle X number of
requests/sec, may be completely different if you need to handle Y number of
requests/sec.

And often what works for one person, won't work for another (scaling is
entirely dependant on your application, despite what any of these cloud
providers might tell you!)

In my own experience, I've found that;

* SSDs with Percona MySQL, resolves a LOT of performance problems - but
don't abuse it
* Lots and lots and lots of query tuning and InnoDB tuning
* New Relic to identify bottlenecks
* IO contention is a big thing
* Snowball prevention (i.e. you set max clients to X, your backend can't
handle it, your requests stack up, the load balancer forces time out, and
your database gets smashed - or you set max memory too high, server goes
into swap etc).
* uWSGI + nginx is amazing
* Identify where your bottlenecks are (in my own experience, IO/memory
tends to come up more often than CPU)

Sadly I haven't tried PSQL so I can't offer any advice on this - Percona
are dragging MySQL kicking and screaming into the 21st century and really
doing some amazing things, but it's by no means perfect!

The above has helped us grow past 8k-12k requests/minute, the largest
database we manage is around 1.1 billion rows weighing in at 160GB+, and we
maintain around 60+ servers.

I should reiterate, the above is purely based on my own experience and use
cases - I am by no means an expert on the subject and I'm still learning
approaches on a daily basis - so this is really meant as "food for thought"
rather than a "this is how you should do things".

Hope this helps a bit!

Cal

On Mon, Oct 29, 2012 at 2:42 PM, Isaac XXX  wrote:

> Hi folks,
>
> I'm developing a new application that should get high traffic. Right now,
> I've other projects with the follow architecture:
>
> Nginx on front: serving static content and redirecting to apache for
> dynamic data
> Apache+mod_wsgi: serving dynamic pages
> PostgreSQL: backend for data storage (RDBM)
> Memcache: for caching purposes :)
>
> All my deployments use a single server, with single frontend/backend (1
> nginx, 1 apache, 1 postgresql). The requirements for this new project are
> really large, and I think I will need to scale all system. Can anyone
> suggest me an all-in-one tutorial, discussing the main points on scale a
> system?
>
> I know there are different alternatives for DB (master-slave,
> clustering...), nginx can serve as a reverse proxy or not... and I need to
> merge all this information in a single scalable system, but I can't find an
> unified source of information.
>
> Can anyone help me on it?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@**
> googlegroups.com .
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en
> .
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Best practices for open sourcing a Django project?

2012-10-14 Thread Cal Leeming [Simplicity Media Ltd]
Sorry, yes.

Personally whenever I have taken code out of production, I've created a
small example project and then placed the code within it, and created a
scenario where the functionality can be used tested.

This is why open source code sometimes isn't very good quality, it can be a
huge time sink :/

Alternatively, depending on the size of the project, you could just do a
code dump and a blog article about it - but obviously this might not
attract as many people to use it.

Cal

On Sun, Oct 14, 2012 at 9:15 PM, Joshua Russo <josh.r.ru...@gmail.com>wrote:

> It sounds like you're saying that the open sourced project should be
> different from the production project. Am I reading that right?
>
>
> On Sunday, October 14, 2012 4:00:03 PM UTC-4, Cal Leeming [Simplicity
> Media Ltd] wrote:
>
>> You could just include the necessary info in the README, or make a
>> wrapper script that does it for them - although I tend to stick with
>> READMEs where possible as they consume less time.
>>
>> If the code is coming straight out of production, there's a few tips I'd
>> recommended;
>>
>> * Ensure that you test the code outside of the production environment
>> against a test project, and make sure it works as expected.
>> * Triple check that you haven't left any private info in the code
>> * Provide a (reasonable) amount of documentation
>>
>> Personally, I tend to opt for this license;
>> http://en.wikipedia.org/wiki/**WTFPL <http://en.wikipedia.org/wiki/WTFPL>
>>
>> There are many places you can put your code (GitHub, my most favourite),
>> and others such as BitBucket and Google Code - again it's down to personal
>> preference.
>>
>> Here is an example of a project I open sourced a while back... at the
>> time I thought it was done well, but I later realised it needed a serious
>> amount of re-writing and documentation - which I still haven't got around
>> to doing;
>> https://github.com/foxx/**django-cutemodel<https://github.com/foxx/django-cutemodel>
>>
>> Others may be able to offer a bit more advice, but the above is a head
>> start at least!
>>
>> Hope this helps!
>>
>> Cal
>>
>> On Sun, Oct 14, 2012 at 8:47 PM, Joshua Russo <josh.r...@gmail.com>wrote:
>>
>>> I have project that I have been working and I was contemplating open
>>> sourcing it but I ran into a little hang up. How to handle the database
>>> authentication. The settings file obviously needs to be included but I
>>> don't want to advertise the production database login. How is this
>>> generally handled?
>>>
>>> Also, are there procedures that need to be followed to "properly" open
>>> source a project, or is it really just choosing a licence and dubbing it so?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To view this discussion on the web visit https://groups.google.com/d/**
>>> msg/django-users/-/**LJU31pYrcXgJ<https://groups.google.com/d/msg/django-users/-/LJU31pYrcXgJ>
>>> .
>>> To post to this group, send email to django...@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users...@**
>>> googlegroups.com.
>>>
>>> For more options, visit this group at http://groups.google.com/**
>>> group/django-users?hl=en<http://groups.google.com/group/django-users?hl=en>
>>> .
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/6nucbxbFRF8J.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Best practices for open sourcing a Django project?

2012-10-14 Thread Cal Leeming [Simplicity Media Ltd]
You could just include the necessary info in the README, or make a wrapper
script that does it for them - although I tend to stick with READMEs where
possible as they consume less time.

If the code is coming straight out of production, there's a few tips I'd
recommended;

* Ensure that you test the code outside of the production environment
against a test project, and make sure it works as expected.
* Triple check that you haven't left any private info in the code
* Provide a (reasonable) amount of documentation

Personally, I tend to opt for this license;
http://en.wikipedia.org/wiki/WTFPL

There are many places you can put your code (GitHub, my most favourite),
and others such as BitBucket and Google Code - again it's down to personal
preference.

Here is an example of a project I open sourced a while back... at the time
I thought it was done well, but I later realised it needed a serious amount
of re-writing and documentation - which I still haven't got around to doing;
https://github.com/foxx/django-cutemodel

Others may be able to offer a bit more advice, but the above is a head
start at least!

Hope this helps!

Cal

On Sun, Oct 14, 2012 at 8:47 PM, Joshua Russo wrote:

> I have project that I have been working and I was contemplating open
> sourcing it but I ran into a little hang up. How to handle the database
> authentication. The settings file obviously needs to be included but I
> don't want to advertise the production database login. How is this
> generally handled?
>
> Also, are there procedures that need to be followed to "properly" open
> source a project, or is it really just choosing a licence and dubbing it so?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/LJU31pYrcXgJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django MPTT - breadcrumb in view function

2012-10-13 Thread Cal Leeming [Simplicity Media Ltd]
Hi,

Personally, I tend to keep the breadcrumb logic completely separate from
any custom code logic.

Instead, I have something like this:

context['breadcrumb'] = ['menu1', 'sub menu 2', 'sub sub menu 3']

And then in the templates, you'd have something like;

{% if x.0 == 'menu1' %}
do something custom here
{% endif %}

{% for x in breadcrumb %}
{{x}}
{% endfor %}

{% include "breadcrumb.html" %}

Although many would probably disagree with this approach, I have found that
keeping breadcrumbs completely separate makes things easier down the line..
Otherwise you end up having to create a breadcrumb system that works with
every use case.. and it often gets ugly.

The above is just my personal opinion based on our own specific use cases,
and I would strongly recommend looking around at alternative ways of doing
it, then finding one that suits what you need.

Hope this helps.

Cal

On Sat, Oct 13, 2012 at 9:53 PM, enemybass  wrote:

> How to create breadcrumb in my view function?
>
> class Category(MPTTModel):
> name = models.CharField(max_length=50, verbose_name=u'Name')
> parent = TreeForeignKey('self', null=True, blank=True,
> related_name='children')
> slug = models.SlugField()
>
> class Product(models.Model):
> name = models.CharField(max_length=50, verbose_name=u'Name')
> slug = models.SlugField()
> category = models.ManyToManyField(Category,
> verbose_name=u'Category')
>
> #views
> def post_content(request, product_id):
> product = get_object_or_404(Product, id = product_id)
> return render_to_response('product_info.html',
> {'product':product},context_instance=RequestContext(request))
>
> product_info.html
>
> {{ product.name }}
>
>
> I want in my single post info (`post_content`) breadcrumb with category.
> Something like this:  Category > Subcategory > Sub-Subcategory .,,,
>
> Someone told me to use *get_ancestors:*
> *
> *
> *Example:*
> *
> *
> {% for parent in category.get_ancestors %}
>   {{ parent.name }} 
> {% endfor %}
> {{ category.name }}
>
> How to implement this with my model?
>
> Thank you. I would be grateful.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/ivQ6G2h8UT0J.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: perfectionists... motto doesn't fit

2012-10-12 Thread Cal Leeming [Simplicity Media Ltd]
On Fri, Oct 12, 2012 at 1:55 PM, Russell Keith-Magee <
russ...@keith-magee.com> wrote:

> On Fri, Oct 12, 2012 at 7:47 PM, Cal Leeming [Simplicity Media Ltd]
> <cal.leem...@simplicitymedialtd.co.uk> wrote:
> >
> >
> > On Fri, Oct 12, 2012 at 3:33 AM, Russell Keith-Magee
> > <russ...@keith-magee.com> wrote:
> >>
> >> On Fri, Oct 12, 2012 at 9:00 AM, Cal Leeming [Simplicity Media Ltd]
> >> <cal.leem...@simplicitymedialtd.co.uk> wrote:
> >> > Lets say you if you were given 1 day to build a shed..
> >> >
> >> > PHP = build your own hammer/screwdriver from scratch, and then use
> those
> >> > to
> >> > build your shed - all within the same timeframe
> >> > PHP with Zend Framework = the equivalent of trying to build your shed
> >> > with
> >> > your childs "early learning toolset", using blu-tac for glue.
> >> > Django = build the shed with the right tools, equipment and materials
> as
> >> > your disposal.
> >>
> >> Ok - lets back away from this thread right now.
> >>
> >> There's absolutely no benefit to be gained in continuing a thread
> >> whose sole purpose is to debate the merits of a *tagline*.
> >
> >
> > Personally I interpreted it as an interesting topic on what really
> defines a
> > perfectionist.. although it doesn't seem to have been perceived this way,
> > which is sad.
>
> > The OP was happy with the "how you got there" thought - it was a simple
> > question with a simple answer...
> >
> > I don't know why this thread has been overreacted to :X
>
> The reason I jumped on this was pre-emptive. We've had two threads on
> Django-dev in a week, started by the same OP, which have quickly
> degraded into *very* ugly territory. As Jacob has commented on the
> other threads, we're taking it on faith that the OP has good
> intentions but has phrased himself badly, but he, and others, have
> been warned about keeping a civil tongue. Given that a discussion of
> "what defines a perfectionist" is in no way on-topic for django-users,
> and has all sorts of potential to end up in bad places, I have no
> problem asking people to step away from this particular topic.
>

Sorry, I wasn't aware of the background behind this, and makes total sense
now. My apologies.


>
> Yours,
> Russ Magee %-)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: perfectionists... motto doesn't fit

2012-10-12 Thread Cal Leeming [Simplicity Media Ltd]
On Fri, Oct 12, 2012 at 3:33 AM, Russell Keith-Magee <
russ...@keith-magee.com> wrote:

> On Fri, Oct 12, 2012 at 9:00 AM, Cal Leeming [Simplicity Media Ltd]
> <cal.leem...@simplicitymedialtd.co.uk> wrote:
> > Lets say you if you were given 1 day to build a shed..
> >
> > PHP = build your own hammer/screwdriver from scratch, and then use those
> to
> > build your shed - all within the same timeframe
> > PHP with Zend Framework = the equivalent of trying to build your shed
> with
> > your childs "early learning toolset", using blu-tac for glue.
> > Django = build the shed with the right tools, equipment and materials as
> > your disposal.
>
> Ok - lets back away from this thread right now.
>
> There's absolutely no benefit to be gained in continuing a thread
> whose sole purpose is to debate the merits of a *tagline*.
>

Personally I interpreted it as an interesting topic on what really defines
a perfectionist.. although it doesn't seem to have been perceived this way,
which is sad.

The OP was happy with the "how you got there" thought - it was a simple
question with a simple answer...

I don't know why this thread has been overreacted to :X


>
> There's also absolutely no benefit to be gained by calling other
> framework names, no matter how much you may personally dislike them.
> Ad hominem attacks and name calling will not be tolerated on Django
> mailing lists, and repeat offenders will be banned. You have all been
> warned.


In hindsight I maybe should have put Language X and Framework Y.

These comments weren't intended to be either 'ad hominem' (had to google
that!) or name calling, so my apologies if they were perceived this way.


> Yours,
> Russ Magee %-)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: perfectionists... motto doesn't fit

2012-10-11 Thread Cal Leeming [Simplicity Media Ltd]
Lets say you if you were given 1 day to build a shed..

PHP = build your own hammer/screwdriver from scratch, and then use those to
build your shed - all within the same timeframe
PHP with Zend Framework = the equivalent of trying to build your shed with
your childs "early learning toolset", using blu-tac for glue.
Django = build the shed with the right tools, equipment and materials as
your disposal.

Some people make the argument of "whatever tool is right for the job"..

Sure - you could make a handsome shed with your first born's plastic tool
set, but for perfectionists it's not just about the end result, it's about
how you got there.

On Thu, Oct 11, 2012 at 1:49 PM, Moonlight wrote:

> What is django definition for perfectionists? Just curious.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/-rUl_ZryK44J.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Drop down menu

2012-10-09 Thread Cal Leeming [Simplicity Media Ltd]
Looks like someone already asked this question (and got an answer);

https://groups.google.com/forum/?fromgroups=#!topic/django-users/ef-Yedt_0uo

Here is a good place to start learning about forms - plenty of examples etc;
https://docs.djangoproject.com/en/dev/ref/forms/api/

Hope this helps!

Cal

On Tue, Oct 9, 2012 at 7:43 PM, sri  wrote:

> Hi,
>
> I am new to Django/Web development and i am trying to create a drop down
> menu in my sample website and got stuck about the best way to develop it.
>
> My idea is to have a drop down of the city names on the homepage. City
> Names can be selected from the model character field having choices.
>
> The model looks like below :
>
>CITY_NAMES = (
> (u'L', u'London'),
> (u'NU', u'Newcastle Upon Tyne'),
> (u'M', u'Manchester'),
> )
>
> class samplemodel(models.Model):
> city_names = models.CharField(max_length =2, choices =
> CITY_NAMES,default = 'L')
>
> And my URL file looks like below.
>
> url(r'^(?P\c+)/', 'cityhomepage'),
> url(r'^$', 'cityhomepage')
>
> And my views looks like below
>
> def cityhomepage(request, city_name = 'London'):
>   /** do something **/
>
> From the drop down when user selects a specific city, then i want to call
> the view "cityhomepage" by passing the city_name selected by the user as
> argument.
>
> Could you please suggest, what i need to write in my templates or forms.py
> files to get the outcome.
>
> Thanks
> Sreekanth
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/E5n-baE-Zc0J.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django Internal Server Error

2012-10-08 Thread Cal Leeming [Simplicity Media Ltd]
Here is the test I used to determine if the import was working correctly.

Can you do the same as below and paste the result??

 foxx@web1/slice10173160 [~] > python
Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> print django.VERSION
(1, 4, 0, 'final', 0)
>>> from django.core.wsgi import get_wsgi_application
>>>

Cal


On Mon, Oct 8, 2012 at 11:40 AM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

> It's possible your django version installed is either not compatible with
> the project you are using - or the installation may be corrupted somehow.
>
> Personally, I've never encountered this problem before using WSGI
> (normally it *just works*).
>
> A quick search on Google shows this;
> http://jonblack.org/2012/07/07/django-deployment-apache-and-mod_wsgi/
>
> There is also documentation on the WSGI module;
> https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/
>
> Can you confirm which version of Python and Django you have installed?
>
> Side note - using upper case letters (i.e. Yourdogsdead instead of
> yourdogsdead) in usernames on *nix based servers is not really a great
> thing to do :/
>
> Cal
>
> On Mon, Oct 8, 2012 at 2:13 AM, Wnt2bsleepin <wnt2bslee...@gmail.com>wrote:
>
>> I looked in the log files for apache and it came up with the following.
>>
>>  File "/home/Yourdogsdead/uglstats/uglstats/wsgi.py", line 26, in ?
>>  from django.core.wsgi import get_wsgi_application
>>  ImportError: No module named django.core.wsgi
>>
>> I am not sure why it's not importing properly.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/9ao5LPpT3NkJ.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django Internal Server Error

2012-10-08 Thread Cal Leeming [Simplicity Media Ltd]
It's possible your django version installed is either not compatible with
the project you are using - or the installation may be corrupted somehow.

Personally, I've never encountered this problem before using WSGI (normally
it *just works*).

A quick search on Google shows this;
http://jonblack.org/2012/07/07/django-deployment-apache-and-mod_wsgi/

There is also documentation on the WSGI module;
https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/

Can you confirm which version of Python and Django you have installed?

Side note - using upper case letters (i.e. Yourdogsdead instead of
yourdogsdead) in usernames on *nix based servers is not really a great
thing to do :/

Cal

On Mon, Oct 8, 2012 at 2:13 AM, Wnt2bsleepin  wrote:

> I looked in the log files for apache and it came up with the following.
>
>  File "/home/Yourdogsdead/uglstats/uglstats/wsgi.py", line 26, in ?
>  from django.core.wsgi import get_wsgi_application
>  ImportError: No module named django.core.wsgi
>
> I am not sure why it's not importing properly.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/9ao5LPpT3NkJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Intensive View Tracking

2012-10-07 Thread Cal Leeming [Simplicity Media Ltd]
Hey JD,

You might want to check this out;

https://github.com/foxx/django-cutemodel

It's not completely ready yet though and is missing a lot of features (see
issues list) - but sounds pretty close to what you need.

Although what it doesn't have is the ability to link audit items together
(i.e. log an audit event against object X that was
invoked/triggered/involved with object Y) - this is still on the todos.

Cal

On Sun, Oct 7, 2012 at 4:00 PM, jondykeman  wrote:

> Hello,
>
> I'm looking for some conceptual input. I am starting to plan the
> development of an app utilizing highly confidential data that will need to
> meet certain governmental requirements.
>
> I had dealt with auditing of the data etc, but it ends up they will
> require a timestamped history of ever action taken by ever user. ie. User1
> logged in at x. User1 went to view page. User1 used the search and searched
> for "Y" etc ...
>
> I searched for any pre-existing work but all I found was counting page
> views etc.
>
> Obviously the easiest to think of and most hideously hack job approach
> would just to custom save the info into a tracking table as part of every
> view, but this isn't the path I would like to go down.
>
> I was thinking of tying into all of the signals, but will have to look
> more into if this will give full coverage.
>
> Do you think signals will be the way to go? Or maybe a MiddleWare of some
> sort?
>
> I am hoping someone has had experience with something related.
>
> Thanks for your help,
>
> JD
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/guYY52zdFlMJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Migrating a Django project to new platform

2012-10-03 Thread Cal Leeming [Simplicity Media Ltd]
The paste you gave us is python 2.4, very old!

My guess is that your old server is 2.4, and your new one is 2.6/2.7 - or
the other way around - that would explain the weirdness.

On your new/old server, paste us the result of just typing 'python' on its
own.

Cal

On Wed, Oct 3, 2012 at 4:31 PM, Elliot wrote:

> Hi guys, thank you sincerely for your feedback.
>
> As far as I know there is just the one instance of python installed:
>
> "
> >>> print sys.path
> ['', '/usr/lib/python2.4/site-packages/PIL-1.1.7-py2.4-linux-i686.egg',
> '/usr/lib/python2.4/site-packages/sorl_thumbnail-11.12-py2.4.egg',
> '/usr/lib/python24.zip', '/usr/lib/python2.4',
> '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk',
> '/usr/lib/python2.4/lib-dynload', '/usr/lib/python2.4/site-packages',
> '/usr/lib/python2.4/site-packages/Numeric',
> '/usr/lib/python2.4/site-packages/gtk-2.0']
>
> [root@svr-h001463 hayley]# whereis python
> python: /usr/bin/python /usr/bin/python2.4 /usr/lib/python2.4
> /usr/include/python2.4 /usr/share/man/man1/python.1.gz
>
> [root@svr-h001463 hayley]# cd /usr/lib
> [root@svr-h001463 lib]# ls -d */ | grep "py"
> pygtk/
> python2.4/
> "
>
> If I try 'python manage.py shell':
> "
> [root@svr-h001463 hayley]# python manage.py shell
> Traceback (most recent call last):
>   File "manage.py", line 11, in ?
> execute_manager(settings)
>   File
> "/usr/lib/python2.4/site-packages/django/core/management/__init__.py", line
> 301, in execute_manager
> utility.execute()
>   File
> "/usr/lib/python2.4/site-packages/django/core/management/__init__.py", line
> 248, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "/usr/lib/python2.4/site-packages/django/core/management/base.py",
> line 77, in run_from_argv
> self.execute(*args, **options.__dict__)
>   File "/usr/lib/python2.4/site-packages/django/core/management/base.py",
> line 86, in execute
> translation.activate('en-us')
>   File
> "/usr/lib/python2.4/site-packages/django/utils/translation/__init__.py",
> line 73, in activate
> return real_activate(language)
>   File
> "/usr/lib/python2.4/site-packages/django/utils/translation/__init__.py",
> line 43, in delayed_loader
> return g['real_%s' % caller](*args, **kwargs)
>   File
> "/usr/lib/python2.4/site-packages/django/utils/translation/trans_real.py",
> line 220, in activate
> _active[currentThread()] = translation(language)
>   File
> "/usr/lib/python2.4/site-packages/django/utils/translation/trans_real.py",
> line 209, in translation
> default_translation = _fetch(settings.LANGUAGE_CODE)
>   File
> "/usr/lib/python2.4/site-packages/django/utils/translation/trans_real.py",
> line 192, in _fetch
> app = getattr(__import__(appname[:p], {}, {}, [appname[p+1:]]),
> appname[p+1:])
>   File
> "/usr/lib/python2.4/site-packages/sorl_thumbnail-11.12-py2.4.egg/sorl/thumbnail/__init__.py",
> line 1, in ?
> from sorl.thumbnail.fields import ImageField
>   File
> "/usr/lib/python2.4/site-packages/sorl_thumbnail-11.12-py2.4.egg/sorl/thumbnail/fields.py",
> line 61
> with open(data.temporary_file_path(), 'rb') as fp:
> ^
> SyntaxError: invalid syntax
> "
>
> It's going to take me a while to understand all that. This is likely the
> first time I've had to dig around python.
>
> I'll follow up on your suggestions, but in the meantime, if any of the
> above throws any more light on the issue from your perspective, further
> comments would be appreciated :)
>
> Thank you!
>
> Elliot
>
>
> On Wednesday, October 3, 2012 2:56:46 PM UTC+1, ke1g wrote:
>
>> A bit of generic advice:
>>
>> Be sure that you know which python is running your stuff: mod_wsgi,
>> and IIRC mod_python (if the site really uses it) are bound to a
>> specific python interpreter.  It may or may not be the one where you
>> installed sorl-thumbnail.  One question is whether the:
>>
>> python manage.py shell
>>
>> will start.  If that works, runserver (the development server will
>> probably work (I'm guessing that you've been testing via Apache).  If
>> so, then use the shell to pretty print sys.path, to find out where
>> that configuration is finding stuff:
>>
>> from pprint import pprint
>> import sys
>> pprint(sys.path)
>>
>> You can also write a trivial WSGI "application" (it's just a function)
>> that creates a text/plain response giving the same information for
>> that environment.  You can also capture sys.version to confirm that
>> both pythons are, say, a 2.7.x or not.
>>
>> If both pythons are compatible versions (not, say, a 2.6 and a 2.7),
>> you may be able to fix things with the python-path argument to the
>> WSGIDaemonProcess directive (specific to the daemon process group) or
>> more globally by using a WSGIPythonHome or WSGIPythonPath directive.
>> But it is also possible to install stuff in the python that mod_wsgi
>> is using be default, and to arrange for any manage.py actions you need
>> to run with 

Re: Migrating a Django project to new platform

2012-10-03 Thread Cal Leeming [Simplicity Media Ltd]
That's strange, sorl-thumbnail didn't seem to resolve your problem.

First thing I'd do is identify the line of code that is causing this import
problem (do a search for 'sorl' in your code base). From there, identify
some of the function names being called on sorl in your application, and
add those to the Google search. That might help identify what the module is
and where you can find it.

Let us know what you find!

Cal


On Wed, Oct 3, 2012 at 12:51 PM, Elliot wrote:

> Hi all,
>
> I would like some help or advice migrating an old Django project to a
> different platform.
>
> Firstly, I am ok-ish with linux (mainly CentOS), and created basic
> websites, MySQL/PHP/HTML intranets, but know next to nothing about Django
> or CMS systems in general, so I appreciate that this is quite a challenge
> for me!
>
> So, I have access to a Ubuntu 11 box which is currently hosting a Django
> v0.97 site. I need to move this site to a CentOS5 (Python v2.4.3) box.
> There isn't really anything to upset on the CentOS box so I am clear to
> uninstall and shuffle stuff around. I have ran a full 'yum update' on
> CentOS.
>
> I have obviously started by transferring the ubuntu:/var/www/hayley folder
> to centos:/var/www/hayley and setting up Apache.
>
> Googling has had me ensure the following are installed:
> yum install gcc gcc-c++
> yum install zlib-devel
> yum install subversion
> yum install MySQL-python python-devel
> yum install mod_python
> yum install httpd-devel
> yum install memcached
> yum install mysql-server
> yum install python-devel mysql-devel
> yum install python-setuptools
> http://www.psycopg.org/psycopg/tarballs/PSYCOPG-2-4/psycopg2-2.4.5.tar.gz
> http://modwsgi.googlecode.com/files/mod_wsgi-3.3.tar.gz
> easy_install PIL
> easy_install sorl-thumbnail
>
> I have ran the installer for Django, found in /var/www/hayley/django-nfa.
>
> I have encountered a tonne of issues so far, which I have been resolving
> with the aid of Google, but I feel I am still a long way off getting this
> to work. In it's current state, if I attempt to access the site, I receive
> an 'internal server error' [500], and my httpd log shows:
> "ImproperlyConfigured: Error while importing URLconf 'hayley.urls': No
> module named sorl"
>
> At this point, I would like to ask:
> 1) Are there are any obvious packages I am missing?
> 2) Even though I believe I have installed sorl-thumbnail, the above error
> obviously indicates an issue. Can someone please suggest where to look in
> order to address it?
> 3) Given this type of migration, is there anything obvious which I need to
> account for?
>
> Thanks all!
>
> Elliot
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/SbBegpsGOTUJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Invalidating active sessions after a password change?

2012-10-03 Thread Cal Leeming [Simplicity Media Ltd]
Yeah, this debate is borderline silly now.

OP, in a nut shell;

1) It is completely acceptable to revoke all other sessions after a
password change
2) There are many ways to revoke sessions, pick one that is right for your
use case.
3) Whether session revoking is enforced or optional is a choice for you.

Hope this helps!

Cal

On Wed, Oct 3, 2012 at 9:40 AM, Tom Evans <tevans...@googlemail.com> wrote:

> On Tue, Oct 2, 2012 at 7:50 PM, Cal Leeming [Simplicity Media Ltd]
> <cal.leem...@simplicitymedialtd.co.uk> wrote:
> > On Tue, Oct 2, 2012 at 5:23 PM, Tom Evans <tevans...@googlemail.com>
> wrote:
> >> I did not say that it was not a desired feature, I said that
> >> *personally* I would not have that expectation; this may be due to me
> >> fully understanding how such systems work and, as I indicated, a lay
> >> person may think differently.
> >
> >
> > That sure is a loaded comment, let's keep the dick size wars out of this
> > yeah? :)
> >
>
> It's not a loaded comment at all, this isn't a "dick size war".
>
> >>
> >> Other large commercial systems, for
> >> instance google apps, do not behave in this manner, so I'm not sure
> >> where the expectation comes from - can anyone name a public facing
> >> system that invalidates all other sessions on password change?
> >
> >
> > Let's see.. Facebook?
> >
> > --snip--
> > "Log out of other devices? To make sure your account's secure, we can log
> > you out of any other computers and phones. You can log back in with your
> new
> > password."
> > --snip
> >
> > The only difference is that Facebook make it an optional feature that
> pops
> > up immediately after you change the password.
>
> So not what your proposed solution allows, but instead session tracking...
>
> >
> > The expectation comes from a simple logic. If I change my password, I
> want
> > to think that my account is secure from anyone else that previously had
> it.
> >
> >>
> >> As a corollary, remember that django's authentication contrib package,
> >> django.contrib.auth, is designed to be a *base* that all AAA schemes
> >> can be built around. There are many schemes where a user may have many
> >> passwords for a single account, should changing one of them invalidate
> >> all their other sessions?
> >
> >
> > That's a different question entirely, and comes down to a business logic
> > choice, not a technical "one-fits-all".
>
> This is point 1.
>
> >
> >>
> >>
> >> As I said in my original reply, these sorts of BI rules can trivially
> >> be added on top of d.c.auth. I gave one such mechanism, Cal another.
> >> Cal's solution is more about ensuring that only sessions that have the
> >> current valid password hash are allowed, whilst mine is more about
> >> tracking and invalidating specific sessions on a whim.
> >
> >
> > The solution I specified was the most simple approach possible, and
> could be
> > integrated without too much fuss.
>
> See point 1. Your solution is the most simplistic approach to solve
> this explicit use case, but implementing it in base would mean ruling
> out many AAA schemes. Thanks for making my argument for me.
>
>
> Tom
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Python-requests seems to 404 with Django/Tasty-pie?

2012-10-02 Thread Cal Leeming [Simplicity Media Ltd]
Ahh!

By sheer coincidence, it was actually me that integrated the latest
SOCKS/proxy support you see in urllib3 lol.

Basically, the current proxy handling is quite badly broken and required a
bunch of fixes.

I submitted a stable set of patches for integration here;
https://github.com/shazow/urllib3/pull/68

This was later merged and branched by the core repo maintainer on the
following branch;
https://github.com/shazow/urllib3/tree/socks-proxy

Sadly, the project we were working on that required proxy access was
finished, and I wasn't able to contribute any more time.

There are a few ways to hack this into working.. most of them involve
monkey-patching the hell out of urllib3 ;)

You could maybe try patching up 'path_url', with something really hacky
like str.replace("http://localhost:8080;, "") (don't shoot me!)

Let me know how you get on

Cal

On Tue, Oct 2, 2012 at 10:31 PM, Victor Hooi <victorh...@gmail.com> wrote:

> heya,
>
> Thanks for the tips - you're probably right, I might need to whip out
> wireshark or something and see what exactly is going on.
>
> However, one thing I did notice - I normally have the http_proxy
> environment variable set, as we use a HTTP proxy at work.
>
> However, if I unset the http_proxy variable, Python requests suddenly
> seems to start working again.
>
> I tried to set the no_proxy variable, and put in localhost and 127.0.0.1
> in there - however, Python requests doesn't seem to respect that?
>
> Cheers,
> Victor
>
>
> On Tuesday, 2 October 2012 22:48:26 UTC+10, Cal Leeming [Simplicity Media
> Ltd] wrote:
>
>> Hi Victor,
>>
>> I've had my fair share of exposure with python requests - so thought I'd
>> chime in.
>>
>> On first glance, this looks to be an issue with specifying the port
>> number into python-requests, doing so seems to send the entire "
>> http://localhost:8000/api/v1/**host/?name__regex==json<http://localhost:8000/api/v1/host/?name__regex==json>
>> **" as the request. However, further analysis shows that might not be
>> the case.
>>
>> Looking at the python requests code;
>> https://github.com/**kennethreitz/requests/blob/**
>> develop/requests/models.py<https://github.com/kennethreitz/requests/blob/develop/requests/models.py>
>>
>> >>> urlparse.urlparse("http://**localhost:8080/test/url?with=**params<http://localhost:8080/test/url?with=params>
>> ")
>> ParseResult(scheme='http', netloc='localhost:8080', path='/test/url',
>> params='', query='with=params', fragment='')
>>
>> It then sends this directly into urllib3 using connection_from_url();
>> https://github.com/shazow/**urllib3/blob/master/urllib3/**
>> connectionpool.py<https://github.com/shazow/urllib3/blob/master/urllib3/connectionpool.py>
>>
>> This then calls the following;
>> scheme, host, port = get_host(url)
>> if scheme == 'https':
>> return HTTPSConnectionPool(host, port=port, **kw)
>> else:
>> return HTTPConnectionPool(host, port=port, **kw)
>>
>> get_host -> parse_url()
>> https://github.com/shazow/**urllib3/blob/master/urllib3/**util.py<https://github.com/shazow/urllib3/blob/master/urllib3/util.py>
>>
>> Tracing through urllib3 finally gets to parse_url();
>>
>> >>> urllib3.util.parse_url("http:/**/localhost:8080/test/url?with=**
>> params <http://localhost:8080/test/url?with=params>")
>> Url(scheme='http', auth=None, host='localhost', port=8080,
>> path='/test/url', query='with=params', fragment=None)
>>
>> So, lets look at path_url() instead;
>> https://github.com/**kennethreitz/requests/blob/**
>> develop/requests/models.py<https://github.com/kennethreitz/requests/blob/develop/requests/models.py>
>>
>> >>> lol = requests.get("http://**localhost:8000/api/v1/host/?**
>> name__regex==json<http://localhost:8000/api/v1/host/?name__regex==json>
>> ")
>> >>> lol.request.path_url
>> '/api/v1/host/?name__regex=&**format=json'
>>
>> Performing a test connection shows;
>>
>>  foxx@test01.internal [~] > nc -p8000 -l
>> GET /api/v1/host/?name__regex=&**format=json HTTP/1.1
>> Host: localhost:8000
>> Accept-Encoding: identity, deflate, compress, gzip
>> Accept: */*
>> User-Agent: python-requests/0.11.1
>>
>> So, from what I can tell, python requests is functioning normally.
>>
>> Personally, I'd say get wireshark running, or use the nc trick shown
>> above, perform 1 request using curl and 1 using python requests, then
>> compare the request headers.
>>
&g

Re: Invalidating active sessions after a password change?

2012-10-02 Thread Cal Leeming [Simplicity Media Ltd]
On Tue, Oct 2, 2012 at 9:45 PM, Dennis Lee Bieber wrote:

> On Tue, 2 Oct 2012 17:23:01 +0100, Tom Evans 
> declaimed the following in gmane.comp.python.django.user:
>
> >
> > I did not say that it was not a desired feature, I said that
> > *personally* I would not have that expectation; this may be due to me
> > fully understanding how such systems work and, as I indicated, a lay
> > person may think differently. Other large commercial systems, for
> > instance google apps, do not behave in this manner, so I'm not sure
> > where the expectation comes from - can anyone name a public facing
> > system that invalidates all other sessions on password change?
>
>
>
> I'd be more likely to expect any such system to, instead, limit an
> account/user to /one/ active session... So the mere act of logging in a
> second time should, itself, trigger the shutdown/invalidation of the
> earlier session (possibly with a prompt first to give the person a
> chance to locate the other session [if it is on the same machine]).
> These systems probably also have inactivity time-outs on sessions too.
>

Sadly that breaks typical usage these days, especially since users will
often login from multiple devices (tablets, PCs, phones etc).

Some of our clients have chosen to enforce single user login for licensing
reasons, i.e. the customer pays more depending on the concurrent user count
etc.

I'd say the best example of a good integration of this is Facebook... they
have many problems, but login/session management definitely isn't one of
them (imho).


> --
> Wulfraed Dennis Lee Bieber AF6VN
> wlfr...@ix.netcom.comHTTP://wlfraed.home.netcom.com/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Invalidating active sessions after a password change?

2012-10-02 Thread Cal Leeming [Simplicity Media Ltd]
On Tue, Oct 2, 2012 at 5:23 PM, Tom Evans <tevans...@googlemail.com> wrote:

> On Tue, Oct 2, 2012 at 4:43 PM, Cal Leeming [Simplicity Media Ltd]
> <cal.leem...@simplicitymedialtd.co.uk> wrote:
> >
> >
> > On Tue, Oct 2, 2012 at 3:51 PM, Tom Evans <tevans...@googlemail.com>
> wrote:
> >>
> >> On Tue, Oct 2, 2012 at 3:22 PM, Dirley <dirley...@gmail.com> wrote:
> >> > I've recently discovered this issue with my django based application.
> >> >
> >> > When a users changes its password, its active sessions are not
> >> > destroyed.
> >> > I mean, if a user is logged in two different places (or in two
> different
> >> > browsers) and changes its password on one place, the other session
> will
> >> > still
> >> > be active.
> >
> >
> > Actually, I disagree with this.
> >
> > Say for example a user changes their password due to a security breach on
> > their account.. if the session is not invalidated, the other user could
> > carry on having access to their account for the maximum duration that the
> > session allows.
> >
> > The way we implemented this for one of our clients, was to cache the user
> > password hash in the session, and re-check it against the database every
> X
> > seconds. If it is different, the session is logged out.
> >
> > The user which then triggers the password change will automatically have
> the
> > cached session password hash updated, and thus the original session does
> not
> > get terminated.
> >
>
> I did not say that it was not a desired feature, I said that
> *personally* I would not have that expectation; this may be due to me
> fully understanding how such systems work and, as I indicated, a lay
> person may think differently.


That sure is a loaded comment, let's keep the dick size wars out of this
yeah? :)


> Other large commercial systems, for
> instance google apps, do not behave in this manner, so I'm not sure
> where the expectation comes from - can anyone name a public facing
> system that invalidates all other sessions on password change?


Let's see.. Facebook?

--snip--
"Log out of other devices? To make sure your account's secure, we can log
you out of any other computers and phones. You can log back in with your
new password."
--snip

The only difference is that Facebook make it an optional feature that pops
up immediately after you change the password.

The expectation comes from a simple logic. If I change my password, I want
to think that my account is secure from anyone else that previously had it.


> As a corollary, remember that django's authentication contrib package,
> django.contrib.auth, is designed to be a *base* that all AAA schemes
> can be built around. There are many schemes where a user may have many
> passwords for a single account, should changing one of them invalidate
> all their other sessions?
>

That's a different question entirely, and comes down to a business logic
choice, not a technical "one-fits-all".


>
> As I said in my original reply, these sorts of BI rules can trivially
> be added on top of d.c.auth. I gave one such mechanism, Cal another.
> Cal's solution is more about ensuring that only sessions that have the
> current valid password hash are allowed, whilst mine is more about
> tracking and invalidating specific sessions on a whim.


The solution I specified was the most simple approach possible, and could
be integrated without too much fuss.

If you wanted more control, then yes tracking and invalidating individual
sessions against your authentication model is the way forward.


>
> Cheers
>
> Tom
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Invalidating active sessions after a password change?

2012-10-02 Thread Cal Leeming [Simplicity Media Ltd]
Sorry, my previous reply looked like I was disagreeing with the OP, this is
not the case.

I was disagreeing with this comment;

Sessions aren't tied to specific users, and so cannot easily be
invalidated like that. Personally, I wouldn't have the expectation
that changing my password would invalidate all my other sessions, but
perhaps a lay user would.

Google Mail in-line reply seems to be a bit fudged the last few days... :X

Cal

On Tue, Oct 2, 2012 at 4:43 PM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

>
>
> On Tue, Oct 2, 2012 at 3:51 PM, Tom Evans <tevans...@googlemail.com>wrote:
>
>> On Tue, Oct 2, 2012 at 3:22 PM, Dirley <dirley...@gmail.com> wrote:
>> > I've recently discovered this issue with my django based application.
>> >
>> > When a users changes its password, its active sessions are not
>> destroyed.
>> > I mean, if a user is logged in two different places (or in two different
>> > browsers) and changes its password on one place, the other session will
>> still
>> > be active.
>>
>
> Actually, I disagree with this.
>
> Say for example a user changes their password due to a security breach on
> their account.. if the session is not invalidated, the other user could
> carry on having access to their account for the maximum duration that the
> session allows.
>
> The way we implemented this for one of our clients, was to cache the user
> password hash in the session, and re-check it against the database every X
> seconds. If it is different, the session is logged out.
>
> The user which then triggers the password change will automatically have
> the cached session password hash updated, and thus the original session
> does not get terminated.
>
>
>>  >
>> > I think this is an issue. If a user thinks his password has been stolen,
>> > he'll naturally change his password in the hope that this action will
>> revoke
>> > the robber's undue access to his account. It's kinda "expected" that
>> after a
>> > password change, everyone with your old password will not be allowed to
>> login.
>> >
>> > But as far as I can tell, this has been the default behaviour for a
>> long time
>> > and no one ever bothered. So, am I missing something? Maybe my specific
>> > setup (I changed my auth backend a little bit) is problematic?
>> >
>> > - D
>> >
>>
>> Sessions aren't tied to specific users, and so cannot easily be
>> invalidated like that. Personally, I wouldn't have the expectation
>> that changing my password would invalidate all my other sessions, but
>> perhaps a lay user would.
>>
>> It is simple to add some middleware to ensure that sessions are linked
>> to user objects, and then you can insert any business logic you need
>> to take the appropriate action, eg to logout other sessions on a
>> password change.
>>
>> Cheers
>>
>> Tom
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Invalidating active sessions after a password change?

2012-10-02 Thread Cal Leeming [Simplicity Media Ltd]
On Tue, Oct 2, 2012 at 3:51 PM, Tom Evans  wrote:

> On Tue, Oct 2, 2012 at 3:22 PM, Dirley  wrote:
> > I've recently discovered this issue with my django based application.
> >
> > When a users changes its password, its active sessions are not destroyed.
> > I mean, if a user is logged in two different places (or in two different
> > browsers) and changes its password on one place, the other session will
> still
> > be active.
>

Actually, I disagree with this.

Say for example a user changes their password due to a security breach on
their account.. if the session is not invalidated, the other user could
carry on having access to their account for the maximum duration that the
session allows.

The way we implemented this for one of our clients, was to cache the user
password hash in the session, and re-check it against the database every X
seconds. If it is different, the session is logged out.

The user which then triggers the password change will automatically have
the cached session password hash updated, and thus the original session
does not get terminated.


> >
> > I think this is an issue. If a user thinks his password has been stolen,
> > he'll naturally change his password in the hope that this action will
> revoke
> > the robber's undue access to his account. It's kinda "expected" that
> after a
> > password change, everyone with your old password will not be allowed to
> login.
> >
> > But as far as I can tell, this has been the default behaviour for a long
> time
> > and no one ever bothered. So, am I missing something? Maybe my specific
> > setup (I changed my auth backend a little bit) is problematic?
> >
> > - D
> >
>
> Sessions aren't tied to specific users, and so cannot easily be
> invalidated like that. Personally, I wouldn't have the expectation
> that changing my password would invalidate all my other sessions, but
> perhaps a lay user would.
>
> It is simple to add some middleware to ensure that sessions are linked
> to user objects, and then you can insert any business logic you need
> to take the appropriate action, eg to logout other sessions on a
> password change.
>
> Cheers
>
> Tom
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Python-requests seems to 404 with Django/Tasty-pie?

2012-10-02 Thread Cal Leeming [Simplicity Media Ltd]
Hi Victor,

I've had my fair share of exposure with python requests - so thought I'd
chime in.

On first glance, this looks to be an issue with specifying the port number
into python-requests, doing so seems to send the entire "
http://localhost:8000/api/v1/host/?name__regex==json; as the
request. However, further analysis shows that might not be the case.

Looking at the python requests code;
https://github.com/kennethreitz/requests/blob/develop/requests/models.py

>>> urlparse.urlparse("http://localhost:8080/test/url?with=params;)
ParseResult(scheme='http', netloc='localhost:8080', path='/test/url',
params='', query='with=params', fragment='')

It then sends this directly into urllib3 using connection_from_url();
https://github.com/shazow/urllib3/blob/master/urllib3/connectionpool.py

This then calls the following;
scheme, host, port = get_host(url)
if scheme == 'https':
return HTTPSConnectionPool(host, port=port, **kw)
else:
return HTTPConnectionPool(host, port=port, **kw)

get_host -> parse_url()
https://github.com/shazow/urllib3/blob/master/urllib3/util.py

Tracing through urllib3 finally gets to parse_url();

>>> urllib3.util.parse_url("http://localhost:8080/test/url?with=params;)
Url(scheme='http', auth=None, host='localhost', port=8080,
path='/test/url', query='with=params', fragment=None)

So, lets look at path_url() instead;
https://github.com/kennethreitz/requests/blob/develop/requests/models.py

>>> lol = requests.get("
http://localhost:8000/api/v1/host/?name__regex==json;)
>>> lol.request.path_url
'/api/v1/host/?name__regex==json'

Performing a test connection shows;

 foxx@test01.internal [~] > nc -p8000 -l
GET /api/v1/host/?name__regex==json HTTP/1.1
Host: localhost:8000
Accept-Encoding: identity, deflate, compress, gzip
Accept: */*
User-Agent: python-requests/0.11.1

So, from what I can tell, python requests is functioning normally.

Personally, I'd say get wireshark running, or use the nc trick shown above,
perform 1 request using curl and 1 using python requests, then compare the
request headers.

Can't throw much more time at this, but hope the above helps

Cal

On Tue, Oct 2, 2012 at 8:54 AM, Victor Hooi  wrote:

> Hi,
>
> I have a Django app that's serving up a RESTful API using tasty-pie.
>
> I'm using Django's development runserver to test.
>
> When I access it via a browser it works fine, and using Curl also works
> fine:
>
> curl 
> "http://localhost:8000/api/v1/host/?name__regex=format=json
>> "
>
>
> On the console with runserver, I see:
>
> [02/Oct/2012 17:24:20] "GET /api/v1/host/?name__regex=format=json
>> HTTP/1.1" 200 2845
>
>
> However, when I try to use the Python requests module (
> http://docs.python-requests.org/en/latest/), I get a 404:
>
> >>> r = requests.get('
>> http://localhost:8000/api/v1/host/?name__regex==json')
>> >>> r
>> 
>
>
> or:
>
> >>> r = requests.get('
>> http://localhost:8000/api/v1/host/?name__regex=format=json
>> ')
>> >>> r
>> 
>
>
> or:
>
> >>> payload = { 'format': 'json'}
>> >>> r = requests.get('http://localhost:8000/api/v1', params=payload)
>> >>> r
>> 
>> >>> r.url
>> u'http://localhost:8000/api/v1?format=json'
>
>
> Also, on the Django runserver console, I see:
>
> [02/Oct/2012 17:25:01] "GET
>> http://localhost:8000/api/v1/host/?name__regex==json HTTP/1.1"
>> 404 161072
>
>
> For some reason, when I use requests, runserver prints out the whole
> request URL, including localhost - but when I use the browser, or curl, it
> only prints out the part *after* the hostname:port
>
> I'm assuming this is something to do with the encoding, user-agent or
> request type it's sending? Why does runserver print out different URLs for
> requests versus browser/curl?
>
> Cheers,
> Victor
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/ycLjP71ciAEJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Tools - Slow in python django fw

2012-10-01 Thread Cal Leeming [Simplicity Media Ltd]
Yeah, you're going to need to give us much more information than that.

Here is a great link to show the kind of information you'd need to give;

https://code.djangoproject.com/wiki/UsingTheMailingList

Once you've sent more information, I'm sure someone will be able to help :)

Cal

On Mon, Oct 1, 2012 at 5:58 AM, siva <85s...@gmail.com> wrote:

> Hi ,
>
> We have converted our tools from php to django framework but tool
> performance is very slow compare to php .
>
> Please let us what are things we have to do ...
>
> Thanks,
> Siva
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/7s9SZXW-TYUJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Alternatives to CBVs (class based views)

2012-09-19 Thread Cal Leeming [Simplicity Media Ltd]
Thanks for clarifying, I see where my initial confusion was now.

The reason this leak hadn't affected our apps was because we didn't use
__init__ to set up the view, instead all the state logic was placed into
__call__. Never the less, having a class call return a HTTPResponse will
break class usage expectations (as mentioned in the wiki), so this still
wouldn't be the cleanest approach.

I think the majority of users seem to be put off by the complexity of using
ListView/TemplateView, and not the actual class usage itself. If the
documentation highlighted that there was a basic View() object available,
it would make the learning curve a bit easier.

Russell - Would you have any objection to me submitting a documentation
patch (https://docs.djangoproject.com/en/1.4/topics/class-based-views/)
which shows a basic example of how to use the View() class directly?

Cal

On Wed, Sep 19, 2012 at 12:45 AM, Russell Keith-Magee <
russ...@keith-magee.com> wrote:

> On Tue, Sep 18, 2012 at 7:24 PM, Cal Leeming [Simplicity Media Ltd]
> <cal.leem...@simplicitymedialtd.co.uk> wrote:
> > Russell,
> >
> > On a separate note, I am curious about these 'copy-on-call' leaks, and I
> > have not seen this behaviour documented anywhere else.
> >
> > "The abstraction of the copy-on-call can leak in surprising ways. Some
> users
> > will try to set up state using an __init__ method (common practice). If
> any
> > of the state they attach to self in __init__ is mutable (list, dict,
> object,
> > etc) and they mutate it in the view, this will fail (but not
> immediately, or
> > in obvious ways)."
> >
> > Could you elaborate further on this, possibly with a rough example?
> >
> > Not arguing that CBV approach should be changed, but this copy-on-call
> > behaviour is quite unexpected, no?
>
> The issue is the shallow copy.
>
> You create a view that sets up state in the __init__ method. Part of
> your view's state is held in a mutable object (e.g., a dict, list or
> object). The __call__ creates a shallow copy of the view object. A
> shallow copy of a mutable object copies the container, but the new
> container points to the old content.
>
> So, if your view logic modifies something held by the mutable object
> (which will be a fairly common occurrence), the modification will be
> shared by all instances of your view. Hilarity ensues :-)
>
> You could work around this by using a deep copy, but then you're into
> territory where accessing a view could be an incredibly expensive
> operation, which is something we want to avoid. It also means anything
> you attach to a view must be deep-copyable, which won't always be
> true.
>
> Yours,
> Russ Magee %-)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Alternatives to CBVs (class based views)

2012-09-18 Thread Cal Leeming [Simplicity Media Ltd]
Russell,

On a separate note, I am curious about these 'copy-on-call' leaks, and I
have not seen this behaviour documented anywhere else.

"The abstraction of the copy-on-call can leak in surprising ways. Some
users will try to set up state using an __init__ method (common practice).
If any of the state they attach to self in __init__ is mutable (list, dict,
object, etc) and they mutate it in the view, this will fail (but not
immediately, or in obvious ways)."

Could you elaborate further on this, possibly with a rough example?

Not arguing that CBV approach should be changed, but this
copy-on-call behaviour is quite unexpected, no?

Cal

On Fri, Sep 14, 2012 at 10:16 AM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

>
>
> On Fri, Sep 14, 2012 at 12:12 AM, Russell Keith-Magee <
> russ...@keith-magee.com> wrote:
>
>> On Thu, Sep 13, 2012 at 12:58 AM, Cal Leeming [Simplicity Media Ltd]
>> <cal.leem...@simplicitymedialtd.co.uk> wrote:
>> > Hi all,
>> >
>> > There is a lot of debate on whether there is a real future for the
>> Django
>> > CBVs (class based views).
>>
>> Sigh.
>
>
> Thank you for the detailed response on this - hopefully this thread will
> serve as a reference point for people in the future
>
>
>>
>> No - there isn't *any* debate about the future of CBVs. There *are* a
>> lot of people who apparently don't like them who keep making a lot of
>> noise. Every single time I've spoken with one of those people at
>> length, the problem has reduced to either:
>>
>>  1) I don't like classes/OO. There's no winning these people over.
>
>
> Well that's certainly not the reason I dislike them - OO makes views
> tidier, simple.
>
>
>>  2) CBV's aren't documented well. You won't get any argument from me
>> on (2). I'll take the hit for that -- the initial documentation for
>> CBVs was my doing, and it has lots of room for improvement.
>
>
> +1
>
>
>
>
>> I'm not aware of anyone in the core that has advocated removing
>> class-based views from Django.
>
>
>> > Personally, I find them tedious, and just wanted a
>> > way to keep my views clean.
>> >
>> > So, here is a really minimalistic way of having class based views,
>> without
>> > the fuss.
>> >
>> > http://djangosnippets.org/snippets/2814/
>> >
>> > This is a fork from:
>> >
>> > http://stackoverflow.com/questions/742/class-views-in-django
>> > http://djangosnippets.org/snippets/2041/
>> >
>> > My thanks to eallik for his initial post on stackoverflow for this.
>> >
>> > Personally I think Django's CBVs should offer a really minimalistic base
>> > like this, as well as the existing CBV stuff already in the core - so
>> as to
>> > not force people into needing to learn an entirely new way of doing
>> things,
>> > but at the same time allowing them to reap some of the benefits of using
>> > callable classes as views.
>> >
>> > Any thoughts?
>>
>> What you've described -- a single entry point class-based view base
>> class -- *does* exist. It's called django.views.generic.View. Override
>> the "dispatch" method, or write a "get/post/put/etc" method, and
>> you've got a class-based view.
>>
>
> I noticed this yesterday whilst trawling through the documentation again,
> so I will look at this again.
>
>
>>
>> I also think you should read the discussions that led to the current
>> form of Class-based views. The pattern you've proposed from Stack
>> Overflow was one of many suggestions that were made, and were rejected
>> because of inherent problems with the approach. The discussions are
>> summarised in the wiki:
>>
>> https://code.djangoproject.com/wiki/ClassBasedViews
>
>
> Thanks for sending this link through, looks very detailed, I will spend an
> hour or two reading through it all and put some thoughts back.
>
>
>>
>>
>> Yours,
>> Russ Magee %-)
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Alternatives to CBVs (class based views)

2012-09-14 Thread Cal Leeming [Simplicity Media Ltd]
On Fri, Sep 14, 2012 at 12:12 AM, Russell Keith-Magee <
russ...@keith-magee.com> wrote:

> On Thu, Sep 13, 2012 at 12:58 AM, Cal Leeming [Simplicity Media Ltd]
> <cal.leem...@simplicitymedialtd.co.uk> wrote:
> > Hi all,
> >
> > There is a lot of debate on whether there is a real future for the Django
> > CBVs (class based views).
>
> Sigh.


Thank you for the detailed response on this - hopefully this thread will
serve as a reference point for people in the future


>
> No - there isn't *any* debate about the future of CBVs. There *are* a
> lot of people who apparently don't like them who keep making a lot of
> noise. Every single time I've spoken with one of those people at
> length, the problem has reduced to either:
>
>  1) I don't like classes/OO. There's no winning these people over.


Well that's certainly not the reason I dislike them - OO makes views
tidier, simple.


>  2) CBV's aren't documented well. You won't get any argument from me
> on (2). I'll take the hit for that -- the initial documentation for
> CBVs was my doing, and it has lots of room for improvement.


+1




> I'm not aware of anyone in the core that has advocated removing
> class-based views from Django.


> > Personally, I find them tedious, and just wanted a
> > way to keep my views clean.
> >
> > So, here is a really minimalistic way of having class based views,
> without
> > the fuss.
> >
> > http://djangosnippets.org/snippets/2814/
> >
> > This is a fork from:
> >
> > http://stackoverflow.com/questions/742/class-views-in-django
> > http://djangosnippets.org/snippets/2041/
> >
> > My thanks to eallik for his initial post on stackoverflow for this.
> >
> > Personally I think Django's CBVs should offer a really minimalistic base
> > like this, as well as the existing CBV stuff already in the core - so as
> to
> > not force people into needing to learn an entirely new way of doing
> things,
> > but at the same time allowing them to reap some of the benefits of using
> > callable classes as views.
> >
> > Any thoughts?
>
> What you've described -- a single entry point class-based view base
> class -- *does* exist. It's called django.views.generic.View. Override
> the "dispatch" method, or write a "get/post/put/etc" method, and
> you've got a class-based view.
>

I noticed this yesterday whilst trawling through the documentation again,
so I will look at this again.


>
> I also think you should read the discussions that led to the current
> form of Class-based views. The pattern you've proposed from Stack
> Overflow was one of many suggestions that were made, and were rejected
> because of inherent problems with the approach. The discussions are
> summarised in the wiki:
>
> https://code.djangoproject.com/wiki/ClassBasedViews


Thanks for sending this link through, looks very detailed, I will spend an
hour or two reading through it all and put some thoughts back.


>
>
> Yours,
> Russ Magee %-)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: tree.io installation with django

2012-09-13 Thread Cal Leeming [Simplicity Media Ltd]
I think this looks like an incompatible Django version to be honest,
coupled with some other weird/wonderful problems.

The invalid syntax thing is also a bit odd, as it looks valid to me.

My advice would be to start again from scratch with the installation
tutorial, and see if you can get any further -

Cal

On Wed, Sep 12, 2012 at 7:52 PM, Fabian Weiss
<fabian.we...@googlemail.com>wrote:

> Hi Cal! :)
>
> THX for you reply, but I need more informations! I changed the line you
> said in settings.py, but what shall I do know? Again python manage.py
> update_ve and ./bin/patch??
> I tried again the last step:
>
> python manage.py installdb
>> Traceback (most recent call last):
>>   File "manage.py", line 74, in 
>> import settings
>>   File "/srv/http/de.immersight.project/treeio/settings.py", line 59, in
>> 
>> MEDIA_ROOT = path.join(STATIC_DOC_ROOT, 'media/')
>> NameError: name 'STATIC_DOC_ROOT' is not defined
>
>
> when I reload the apache I have still 500 internal error. Here is the
> errorlog:
>
> tail ../logs/errorlog
>> [Wed Sep 12 20:46:23 2012] [error] [client 109.193.24.24] SyntaxError:
>> invalid syntax
>> [Wed Sep 12 20:46:23 2012] [error] [client 109.193.24.24] mod_wsgi
>> (pid=17796): Target WSGI script
>> '/srv/http/de.immersight.project/treeio/wsgi' cannot be loaded as Python
>> module.
>> [Wed Sep 12 20:46:23 2012] [error] [client 109.193.24.24] mod_wsgi
>> (pid=17796): Exception occurred processing WSGI script
>> '/srv/http/de.immersight.project/treeio/wsgi'.
>> [Wed Sep 12 20:46:23 2012] [error] [client 109.193.24.24] Traceback (most
>> recent call last):
>> [Wed Sep 12 20:46:23 2012] [error] [client 109.193.24.24]   File
>> "/srv/http/de.immersight.project/treeio/wsgi", line 9, in 
>> [Wed Sep 12 20:46:23 2012] [error] [client 109.193.24.24] import
>> django.core.handlers.wsgi
>> [Wed Sep 12 20:46:23 2012] [error] [client 109.193.24.24]   File
>> "/usr/local/lib/python3.2/dist-packages/django/core/handlers/wsgi.py", line
>> 131
>> [Wed Sep 12 20:46:23 2012] [error] [client 109.193.24.24] path_info =
>> force_unicode(environ.get('PATH_INFO', u'/'))
>> [Wed Sep 12 20:46:23 2012] [error] [client 109.193.24.24]
>>   ^
>> [Wed Sep 12 20:46:23 2012] [error] [client 109.193.24.24] SyntaxError:
>> invalid syntax
>
>
> I really urgently have to set up this system :(
> Would be great if I can accomplish this!! Thanks alot for your help!
> Greetings Fabian
>
>
>
>
> Am Mittwoch, 12. September 2012 12:14:51 UTC+2 schrieb Cal Leeming
> [Simplicity Media Ltd]:
>>
>> Hmm - this should really just work out of the box, but looking at the
>> docs, it doesn't give you much information about running wsgi/fcgi etc.
>>
>> Try this;
>>
>> Change this line:...
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/6aEUH98wPG0J.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Request for comments - django-cutemodel (model logging and field change auditing)

2012-09-13 Thread Cal Leeming [Simplicity Media Ltd]
On Thu, Sep 13, 2012 at 9:42 AM, Derek <gamesb...@gmail.com> wrote:

> Cal
>
> Great post; I think you summed up my feelings about django-reversion as
> well, although articulated extremely clearly.
>
> If CuteModel (where does that name come from??)
>

Cute was the first word that came to my head, thought it sounded catchy

can address the issue of reverting a change to a record (or, even better,
> all changes made at one time to a record), then I think it will be a great
> alternative option for many folk.
>

Yeah after the last few posts, I realised there were a few structural
changes that needed to be made - one of those being that field changes need
to be grouped by a Revision() object, so you can revert the entire revision
or just bits from it.

I also figured that the API needs to expose data to the original save()
method call, such as the revision object, so they can integrate this into
their existing application (for example, if they have 3 models that get
saved in 1 form save, they might want to take all 3 IDs, then create an
extra revision layer that lets them revert them all in one go - rather than
try and normalize this, exposing the revision object would give the user
enough control)


>
> Cheers,
> Derek
>
>
> On Tuesday, 11 September 2012 21:11:06 UTC+2, Cal Leeming [Simplicity
> Media Ltd] wrote:
>
>> Thanks for letting me know about django-reversion, it has made for
>> interesting reading.
>>
>> From what I can see there are two big differences between them;
>>
>> * CuteModel is designed with performance/scalability in mind (as some of
>> our projects are tipping into the 700+mil row count and rising)
>> * CuteModel is designed to be as simple and easy as possible - where as
>> django-reversion left me feeling a bit confused.
>>
>> Looking at django-reversion, it certainly looks close to cutemodel, but
>> there are a few differences;
>>
>> * Changes are serialized into the database, this adds a significant extra
>> size and CPU overhead (Version.serialized_data)
>> * Object references are stored as a TextField, this is not good for
>> performance (Version.object_id)
>> * Creates a new serialized object every time a row is added - this is
>> really really not good for performance(*.VERSION_ADD)
>> * Requires an additional model for every model you have if you want to
>> store custom meta data (cutemodel only requires 1)
>> * Uses signal rather than overriding the subclass - although this is
>> probably a better approach - thoughts anyone??
>> * In some ways the API is quite nice, but in others it seems a bit clunky.
>> * Requires you to create initial revisions dump - again, not good if you
>> have a lot of rows
>>
>> That being said - there are definitely some good points from that app,
>> and a lot of features that would be great for CuteModel, such as;
>>
>> * Grouping together field changes into a 'revision'
>> * Better low level API support
>> * Ability to revert a change
>>
>> I'm certainly going to add those into the todos list - thanks for your
>> feedback!
>>
>> Cal
>>
>> On Tue, Sep 11, 2012 at 2:46 PM, jondykeman <jondy...@gmail.com> wrote:
>>
>>> Hello,
>>>
>>> I am in a very similar situation. I would in an environment that deals
>>> with sensitive data collection. Everything has to be two-factor
>>> authenticated, in the secure server zone etc. As part of this we need
>>> logging of every action ever taken, by whom, when, and what the changes
>>> were.
>>>
>>> At first I implemented my own custom solution which was less than ideal,
>>> but it worked. That was a model of creating a new record for each field any
>>> time there was a change to the value, but via a lot of manual checking
>>> code.
>>>
>>> I am not starting to migrate to a slicker solution. I am taking
>>> advantage of django-reversion.
>>>
>>> https://github.com/etianen/**django-reversion<https://github.com/etianen/django-reversion>
>>>
>>> This provides row level auditing out of the box, and then you just need
>>> to take advantage of the pre_commit_signal to track field changes as well.
>>>
>>> @receiver(reversion.pre_**revision_commit)
>>> def it_worked(sender, **kwargs):
>>> currentVersion = kwargs.pop('versions')[0].**field_dict
>>> pastVersion = reversion.get_for_object(**kwargs.pop('instances')[0])[0]*
>>> *.field_dict
>>>  changes = set(currentVersion.items()) - set(pastVersion.items())
>>> changedVars = []
>>> for var in changes:
>

Re: Alternatives to CBVs (class based views)

2012-09-13 Thread Cal Leeming [Simplicity Media Ltd]
Ah, thanks for letting me know - the original snippet by eallik had support
for this, but I must have stripped it out not realising.

On Thu, Sep 13, 2012 at 1:34 AM, Matt Schinckel  wrote:

> One really small nitpick: when returning a 405, it is a requirement that
> you return a header with the acceptable methods:
>>
>>
> > 10.4.6 405 Method Not Allowed
>
> > The method specified in the Request-Line is not allowed for the resource
> identified by the Request-URI. The response MUST include an Allow header
> containing a list of valid methods for the requested resource.
>
> (From http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html).
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/8vKvmPp9uTgJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Possible spam from mailing list? ("China Mobile")

2012-09-12 Thread Cal Leeming [Simplicity Media Ltd]
+1 just received one of these.

On Wed, Sep 12, 2012 at 10:18 PM, Nikolas Stevenson-Molnar <
nik.mol...@consbio.org> wrote:

>  Looking at Google's translation of the text, I would guess it's informing
> you that you need to be on that user's whitelist: "You send is not
> activated 139 mailbox user's mail seven days will be deleted by the system,
> please to notify Friends timely activation to receive e-mail."
>
> In other words, this user needs to specifically approve people to receive
> email from. Usually Google is good about filtering out auto-responses and
> the like, but it seems to be missing this one.
>
> _Nik
>
>
> On 9/12/2012 2:15 PM, Nikolas Stevenson-Molnar wrote:
>
> I just got the same email after replying to a message.
>
> _Nik
>
> On 9/10/2012 7:28 PM, Rivsen wrote:
>
> Maybe someone use 139 email, ask group manager check this and contact that
> one who use 139 email.
>
> 2012/9/11 Brad Pitcher 
>
>> Yes, I received a similar email about the post "Re: I can't install
>> django on my mac. I'm not sure wh..." which I recently responded to. Not
>> sure what to make of it.
>>
>>
>> On Mon, Sep 10, 2012 at 12:27 PM, Kurtis wrote:
>>
>>> I just received a very unusual e-mail that included a recent post's
>>> subject. The post in question was: "Re: form doesn't validate when trying
>>> to upload file". It was sent directly to my email address; by-passing the
>>> User Group.
>>>
>>>  Google roughly translated this email as coming from "China Mobile" and
>>> included the domain "139.com". Has anyone else seen this sort of thing?
>>> Unfortunately, I am unable to read the language and the Google Translation
>>> isn't very clear; but it's definitely displayed using a very clean and
>>> fancy template. I'm not sure if it's spam or something else.
>>>
>>>  Just figured I'd see if anyone else has gotten an email similar to
>>> this. Thanks.
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msg/django-users/-/cs6UrXOcBOkJ.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Alternatives to CBVs (class based views)

2012-09-12 Thread Cal Leeming [Simplicity Media Ltd]
On Wed, Sep 12, 2012 at 7:44 PM, Javier Guerra Giraldez
<jav...@guerrag.com>wrote:

> On Wed, Sep 12, 2012 at 11:58 AM, Cal Leeming [Simplicity Media Ltd]
> <cal.leem...@simplicitymedialtd.co.uk> wrote:
> > So, here is a really minimalistic way of having class based views,
> without
> > the fuss.
> >
> > http://djangosnippets.org/snippets/2814/
>
> looks nice.  i like that it respects the idea that views in Django are
> just callables that take a reques (plus optional extra params) and
> return a response.  to get inheritance, just make callable objects and
> spread functionality as desired.
>

Yeah I was really pleased when I found the original snippet, and this
approach can be extended on so easily too.


>
> the generic view functions are good for prototyping, but soon you have
> to replace with your own, which is not difficult.  the problem with
> generic CBV is that they try to factorize every feature so thinly that
> the inheritance becomes an unholy mess.  any simplification would
> either reduce functionality, or make some features harder to replace,
> so there doesn't seem to be a way out... apart from not using them.
>

Agreed, the CBVs in Django leave me with the same taste that
django-tastypie left in my mouth - making a very simple thing overly
complex.

This is why I'm wondering if the way forward is to offer two types of CBV,
one using the current CBVs in Django, and one using an approach like this.


> --
> Javier
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Syncdb is producing different databases on different machines.

2012-09-12 Thread Cal Leeming [Simplicity Media Ltd]
lol wtf.

Perhaps the code on the production server isn't fully up to date? Did you
check the database to ensure the table definitely doesn't already exist?
Did you try running "manage.py sql" on the production server to see if the
SQL is printed out for the missing table?

Cal

On Wed, Sep 12, 2012 at 6:14 PM, Brian McKeever <kee...@gmail.com> wrote:

> I am not using any database router.
>
> These are my database settings:
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.postgresql_psycopg2',
> 'NAME': 'my database name',
> 'USER': 'my admin name',
> 'HOST': 'localhost',
> 'PASSWORD' : 'my password'
>
> }
> }
>
> On Wednesday, September 12, 2012 11:02:10 AM UTC-6, Cal Leeming
> [Simplicity Media Ltd] wrote:
>
>> Are you using any sort of custom db router? (look for DATABASE_ROUTERS in
>> settings).
>>
>> On Wed, Sep 12, 2012 at 5:05 PM, Brian McKeever <kee...@gmail.com> wrote:
>>
>>> On my development machine, upon freshly creating my postgresql database,
>>> when I run syncdb, it creates two invitation tables -
>>> invitation_invitationkey and invitation_invitationuser.
>>> On my production server, upon freshly creating my postgresql database,
>>> when I run syncdb, it only creates invitation_invitationkey. Why isn't it
>>> creating the invitationuser table?
>>>
>>> Both machines have the same revision of code.
>>> Both machines are using virtualenvs with the same packages installed
>>> including the same version numbers.
>>> Both tables belong to the django-invitation package.
>>>
>>> I don't know how to go about debugging this. Any help would be
>>> appreciated. Thank you.
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To view this discussion on the web visit https://groups.google.com/d/**
>>> msg/django-users/-/**ixGlcrj7IhMJ<https://groups.google.com/d/msg/django-users/-/ixGlcrj7IhMJ>
>>> .
>>> To post to this group, send email to django...@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users...@**
>>> googlegroups.com.
>>>
>>> For more options, visit this group at http://groups.google.com/**
>>> group/django-users?hl=en<http://groups.google.com/group/django-users?hl=en>
>>> .
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/4PQIkM_FwO0J.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Syncdb is producing different databases on different machines.

2012-09-12 Thread Cal Leeming [Simplicity Media Ltd]
Are you using any sort of custom db router? (look for DATABASE_ROUTERS in
settings).

On Wed, Sep 12, 2012 at 5:05 PM, Brian McKeever  wrote:

> On my development machine, upon freshly creating my postgresql database,
> when I run syncdb, it creates two invitation tables -
> invitation_invitationkey and invitation_invitationuser.
> On my production server, upon freshly creating my postgresql database,
> when I run syncdb, it only creates invitation_invitationkey. Why isn't it
> creating the invitationuser table?
>
> Both machines have the same revision of code.
> Both machines are using virtualenvs with the same packages installed
> including the same version numbers.
> Both tables belong to the django-invitation package.
>
> I don't know how to go about debugging this. Any help would be
> appreciated. Thank you.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/ixGlcrj7IhMJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Alternatives to CBVs (class based views)

2012-09-12 Thread Cal Leeming [Simplicity Media Ltd]
Hi all,

There is a lot of debate on whether there is a real future for the Django
CBVs (class based views). Personally, I find them tedious, and just wanted
a way to keep my views clean.

So, here is a really minimalistic way of having class based views, without
the fuss.

http://djangosnippets.org/snippets/2814/

This is a fork from:

http://stackoverflow.com/questions/742/class-views-in-django
http://djangosnippets.org/snippets/2041/

My thanks to eallik for his initial post on stackoverflow for this.

Personally I think Django's CBVs should offer a really minimalistic base
like this, as well as the existing CBV stuff already in the core - so as to
not force people into needing to learn an entirely new way of doing things,
but at the same time allowing them to reap some of the benefits of using
callable classes as views.

Any thoughts?

Cal

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django-admin (was: tastypie - some feedback / comments)

2012-09-12 Thread Cal Leeming [Simplicity Media Ltd]
This is just my own opinion but, I can't ever see django-admin going much
further than it is now - for much the same reasons as mentioned on the
tastypie thread, nor have I come across any alternatives (yet) - although
it'd be interesting to hear others thoughts on this.

For me the thing I've found with Django is that the more I've learnt, the
less built in stuff I use.. We've used a whole bunch of different
authentication approaches in the past, and it's really down to use-case and
trial/error. As for the security aspect, spend some time getting your hands
dirty, try different approaches and eventually it'll come naturally :) (be
prepared to make some mistakes!)

Cal

On Wed, Sep 12, 2012 at 4:35 PM, Tomas Neme  wrote:

> Since this came up, are there any more-or-less packaged alternatives
> to django-admin? More than twice I've had to give up in something as
> simple as rendering two-level FK indirections, lest I wanted to
> override most of the ModelAdmin classes.
>
> The thing is that I don't trust myself to be throughout enough with
> security and the such when rolling my own.
>
> --
> "The whole of Japan is pure invention. There is no such country, there
> are no such people" --Oscar Wilde
>
> |_|0|_|
> |_|_|0|
> |0|0|0|
>
> (\__/)
> (='.'=)This is Bunny. Copy and paste bunny
> (")_(") to help him gain world domination.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Newbie Project Setup and Terminology Questions

2012-09-12 Thread Cal Leeming [Simplicity Media Ltd]
Be aware, the below structure works perfectly for us because of trial and
error from years of development, it suits the particular style/nature of
our projects, and it has been made standardized across the board. I
wouldn't recommend using the above, instead, I would recommend looking
around for different approaches (like you have in this thread) and see
which feels "right". I'd say you'll probably change your structure/approach
at least 3-4 times before you find one that feels absolutely right.

Personally, we use the following structure:

project/ - root project directory
project/libs - place to hold shared libs
project/apps - place where your 'apps' are held (these will go into
INSTALLED_APPS)
project/apps/app1 - some application
project/apps/app1/models.py - models for app1
project/apps/app2 - some application
project/apps/app2/models.py - models for app2
project/sites/bwebsite/
project/sites/bwebsite/views.py - views for bwebsite
project/sites/bwebsite/urls.py - urls for bwebsite
project/sites/awebsite/
project/sites/awebsite/views.py - views for awebsite
project/sites/bwebsite/urls.py - urls for bwebsite

The above then works in conjunction with MultihostMiddleware (
https://code.djangoproject.com/wiki/MultiHostMiddleware ).

As well as this, we heavily use db routers to allow us to communicate with
legacy databases in an ORM style, but would never require views, so it
makes sense for us to use this approach.

An example use case for the above would be something like;

Telecommunications website, requires public website, customer portal and
staff backend - however you want to keep the views/urls/apis separate, plus
some of them share functionality within the models. This allows you to keep
the concept of individual sites completely separate from the models.

Hope this helps a bit!

Cal


On Tue, Sep 11, 2012 at 10:56 PM, Matthew Woodward wrote:

> Hi all -- semi-new to Django but learning fast and enjoyed meeting a lot
> of folks at DjangoCon last week! I have some basic project setup and
> terminology questions I'm hoping to get some thoughts on.
>
> Basically I'm curious as to the convention about creating a project using
> virtualenv and then adding applications to the project in terms of where
> the files are placed. I'll just go through what I've been doing and I'd
> welcome any and all feedback as to where I'm breaking with conventional
> wisdom.
>
> Let's say I'm starting a new project foo and run this from a ~/projects
> directory:
> virutalenv foo
>
> So at that point I have ~/projects/foo I then cd into that directory,
> activate that virtualenv, and install Django
> cd ~/projects/foo
> source bin/activate
> bin/pip install django
>
> I then start the Django project from ~/projects/foo:
> bin/django-admin.py startproject foo
>
> At that point I have ~/projects/foo/foo for my project directory, and in
> there it puts another foo for the foo application (I'm assuming that's
> accurate terminology? or is that the "project" since that's where
> settings.py lives?).
>
> So it's clear what I have at this point:
> ~/projects/foo <-- root virtualenv directory containing bin, include, etc.
> ~/projects/foo/foo <-- root project directory containing manage.py and foo
> application (or is it called project?) directory
> ~/projects/foo/foo/foo <-- foo application (project?) directory containing
> settings.py, etc.
>
> If that's correct thus far (and please let me know if not!), my next
> question is where to create additional applications. I'm assuming that in
> this case if I want to create a bar app I cd into ~/projects/foo/foo and
> run:
> python manage.py startapp bar
>
> So that that point I have:
> ~/projects/foo/foo/foo <-- where settings.py lives
> ~/projects/foo/foo/bar <-- bar application files (models.py, etc.)
>
> Specifically on this last piece, should I be creating things there or is
> the convention to put applications in the same directory as settings.py, so
> you wind up with your application directories at the same level as
> settings.py? E.g.:
> ~/projects/foo/foo/foo <-- where settings.py lives
> ~/projects/foo/foo/foo/bar <-- bar application files
>
> It certainly works fine the way I'm doing it as long as I reference the
> location of the application files correctly, but in a lot of the books I've
> been reading application files would be referenced using this example as
> 'foo.bar' instead of just 'bar' which is what I wind up with the way I've
> been doing things.
>
> Any thoughts/pointers/admonitions/etc. are greatly appreciated.
>
> Thanks,
> Matt
>
> --
> Matthew Woodward
> m...@mattwoodward.com
> http://blog.mattwoodward.com
> identi.ca / Twitter: @mpwoodward
>
> Please do not send me proprietary file formats such as Word, PowerPoint,
> etc. as attachments.
> http://www.gnu.org/philosophy/no-word-attachments.html
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send 

Re: sending data with HttpResponseRedirect

2012-09-12 Thread Cal Leeming [Simplicity Media Ltd]
Actually, just seen that flash hasn't been maintained, and my own personal
usage of it was touch and go at best

These days, I also tend to use the approach of storing a message in the
session instead (as explained by Jirka).

Cal

On Wed, Sep 12, 2012 at 2:35 PM, Jirka Vejrazka wrote:

> If you have sessions enabled, you can use the built-in messages
> framework (look in contrib) to display a message on the "next" page.
> Alternatively, you can save (semi-) arbitrary data in the user session
> and retrieve it in the view that displays the "success" page.
>
>   HTH
>
> Jirka
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: sending data with HttpResponseRedirect

2012-09-12 Thread Cal Leeming [Simplicity Media Ltd]
Hey,

You might find this helpful;

https://github.com/danielfm/django-flash

Cal

On Wed, Sep 12, 2012 at 5:19 AM, Simon Cossar  wrote:

> Hi All, I'm just starting to play around with Django... working through
> the tutorial and the Django Book. I have just written a view that after
> successfully processing a form uses HttpResponseRedirect() to send the user
> to a 'success' page. Is their a standard way of accessing the form data
> from the previous page so that I can echo some of the submitted data back
> to them?
>
> Simon
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



tastypie - some feedback / comments

2012-09-12 Thread Cal Leeming [Simplicity Media Ltd]
Hi all,

For the last two years whenever an API has been required for a project, we
have just used our own API wrapper that consists of about 50 lines, then
added in the bits we needed as we go along.

So today, I decided to spread my wings a little and give TastyPie a try...
here is a bit of feedback for anyone considering TastyPie;

It works quite nicely out of the box, ties directly into the Django user
models, has fairly good URL path structures, and within 30 minutes you can
have it spitting out data from your models with as much control as you
wish.

However, like the django-admin system, this is where the fun ends. As soon
as you want to do anything bespoke or actions that involve not fetching
data (whether it be ORM or not), things start to get touchy. Attempting to
get tastypie to work without a queryset/qs is damn near impossible, the
uglyness of override_urls/prepend_urls() alone was enough to make me say
"eww", and the general feel was overly complex.

In theory tastypie is perfect, but in practise it seems to overcomplicate
things in an attempt to keep everything organized, and to quote a colleague
"it has a bit too much magic". Sure, it claims to give you plenty of
control to customize it for your specific use case, but the complexity of
this makes actual time and sanity saved debatable.

This isn't to say that tastypie should be avoided, as it will work
beautifully for simple requirements, but I personally feel that it should
be kept in the same box as django-admin. It's also worth mentioning that
(imo) anyone thinking about tastypie should still give it a try and see how
they feel about it. It'd be interesting to hear other thoughts on it.

There are obviously some others to compare this against, the most notable
being piston and Django REST framework. Although there's some bad press
about piston (and I haven't tried it myself), it would probably be next in
my list to try. Unlike tastypie, it treats resources as completely
arbitrary objects and lets you create the magic for yourself.. so although
it doesn't work out of the box quite as easily, it offers so much more
benefits in the long run.

Any thoughts?

Cal

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django newbie with issues

2012-09-12 Thread Cal Leeming [Simplicity Media Ltd]
May I ask the reason you cannot upgrade to 1.4???

Sticking to 1.1 is usually only done if you have an existing code base that
absolutely requires 1.1.

You really need to upgrade :/

Cal

On Wed, Sep 12, 2012 at 10:46 AM, Morrti <sirrom...@googlemail.com> wrote:

> Hi,
>
> Thanks for your comments on version numbers, but moving to 1.4 isn't a
> quick option for me/us so I'm stuck on 1.1 for a while.
>
> Trying to run the app and instead of getting the "welcome" page I get the
> following, see below.
>
> Not withstanding my version issue, anyone got any ideas on this.
>
> Thanx,
> Tim
>
> Traceback (most recent call last):
>
>   File 
> "/Users/timmorris/Sites/django/django-trunk/django/core/servers/basehttp.py", 
> line 279, in run
> self.result = application(self.environ, self.start_response)
>
>   File 
> "/Users/timmorris/Sites/django/django-trunk/django/core/servers/basehttp.py", 
> line 651, in __call__
> return self.application(environ, start_response)
>
>   File 
> "/Users/timmorris/Sites/django/django-trunk/django/core/handlers/wsgi.py", 
> line 230, in __call__
> self.load_middleware()
>
>   File 
> "/Users/timmorris/Sites/django/django-trunk/django/core/handlers/base.py", 
> line 42, in load_middleware
> raise exceptions.ImproperlyConfigured, 'Error importing middleware %s: 
> "%s"' % (mw_module, e)
>
> ImproperlyConfigured: Error importing middleware django.middleware.common: 
> "cannot import name force_text"
>
>
>
> On Tuesday, September 11, 2012 11:45:17 AM UTC+1, Cal Leeming [Simplicity
> Media Ltd] wrote:
>
>> Ouch, 1.1 is very old indeed.
>>
>> I have seen compatibility issues before when running django/py apps on a
>> mac, but can't say I've ever ran into this before.
>>
>> Could you upgrade to the latest (1.4.1) and see if you still experience
>> the same issue?
>>
>> Cal
>>
>> On Tue, Sep 11, 2012 at 11:03 AM, Morrti <sirr...@googlemail.com> wrote:
>>
>>> Hi,
>>>
>>> I'm a total newbie to Django and I'm trying to follow the build your
>>> first app tutorial from the site https://docs.djangoproject.**
>>> com/en/1.1/intro/tutorial01/<https://docs.djangoproject.com/en/1.1/intro/tutorial01/>but
>>>  have soon run into problems, please see below. This is as a result of
>>> running the  python manage.py runserver command.
>>>
>>> If anyone can help, I believe I'm running version 1.1 of django, not
>>> sure what else you may want to know.
>>>
>>> Thanx,
>>>
>>> python manage.py runserver
>>> Validating models...
>>>
>>> Unhandled exception in thread started by >> of <django.contrib.staticfiles.**management.commands.runserver.**Command
>>> object at 0x10114d0d0>>
>>> Traceback (most recent call last):
>>>   File "/Users/timmorris/Sites/**django/django-trunk/django/**
>>> core/management/commands/**runserver.py", line 91, in inner_run
>>> self.validate(display_num_**errors=True)
>>>   File 
>>> "/Users/timmorris/Sites/**django/django-trunk/django/**core/management/base.py",
>>> line 277, in validate
>>> num_errors = get_validation_errors(s, app)
>>>   File "/Users/timmorris/Sites/**django/django-trunk/django/**
>>> core/management/validation.py"**, line 32, in get_validation_errors
>>> for (app_name, error) in get_app_errors().items():
>>>   File 
>>> "/Users/timmorris/Sites/**django/django-trunk/django/db/**models/loading.py",
>>> line 163, in get_app_errors
>>> self._populate()
>>>   File 
>>> "/Users/timmorris/Sites/**django/django-trunk/django/db/**models/loading.py",
>>> line 69, in _populate
>>> self.load_app(app_name, True)
>>>   File 
>>> "/Users/timmorris/Sites/**django/django-trunk/django/db/**models/loading.py",
>>> line 93, in load_app
>>> models = import_module('.models', app_name)
>>>   File 
>>> "/Users/timmorris/Sites/**django/django-trunk/django/**utils/importlib.py",
>>> line 35, in import_module
>>> __import__(name)
>>>   File 
>>> "/Users/timmorris/Sites/**django/django-trunk/django/**contrib/auth/models.py",
>>> line 18, in 
>>> from django.contrib.contenttypes.**models import ContentType
>>>   File "/Users/timmorris/Sites/**django/django-trunk/django/**
>>> contrib/contenttypes/models.**

Re: tree.io installation with django

2012-09-12 Thread Cal Leeming [Simplicity Media Ltd]
Hmm - this should really just work out of the box, but looking at the docs,
it doesn't give you much information about running wsgi/fcgi etc.

Try this;

Change this line:

STATIC_DOC_ROOT = path.join(PROJECT_ROOT, 'static')


To this:
STATICFILES_DIRS = ( path.join(PROJECT_ROOT, 'static'), )

That should work i think.

Cal

On Wed, Sep 12, 2012 at 7:07 AM, Fabian Weiss
<fabian.we...@googlemail.com>wrote:

> THX alot for your help Cal! Does that STATIC stuff has something to do
> with the fact that I am using an Apache virtual host?
> But that link you gave me is very complicated! Sorry, but I dont
> understand :(
> This is my simple WSGI file:
> http://nopaste.immersight.de/?51d0bd825fc001a8#gATcImCw08jZTqXqiuA9Qbr0qvoCno+eISUhnZPIq6A=
> What do I have to insert there?
> I found that I have indeed a dircetory called "static"!!
> http://nopaste.immersight.de/?ae7fe7fa64cd2dbe#TPSfs+1BwLYpqWH0ih/ZBleZ/A8bre5Xwvwafys+gj4=
> Shall I add now STATICFILES_DIRS = ( "../static") ?
>
> Am Dienstag, 11. September 2012 12:41:16 UTC+2 schrieb Cal Leeming
> [Simplicity Media Ltd]:
>>
>> Looks like an incompatible version of Django perhaps (first glance).
>>
>> Alternatively, just patch it yourself based on the error given:
>>
>> @@@
>> django.core.exceptions.**ImproperlyConfigured: You're using the
>> staticfiles app without having set the STATIC_ROOT setting.
>> @@@
>>
>> See 
>> https://docs.**djangoproject.com/en/dev/**howto/static-files/<https://docs.djangoproject.com/en/dev/howto/static-files/>
>>
>> Cal
>>
>> On Tue, Sep 11, 2012 at 7:22 AM, Fabian Weiss 
>> <fabian...@googlemail.com>wrote:
>>
>>> I am using Debian and want to use treeio with my Apache. So I was
>>> working with this tutorial: http://fuckyeahcoding.**
>>> wordpress.com/2011/12/20/**install-tree-io-on-ubuntu-**with-apache/<http://fuckyeahcoding.wordpress.com/2011/12/20/install-tree-io-on-ubuntu-with-apache/>
>>> But the instructions "make" and "make install" didnt work.. Instead I
>>> used the 'python manage.py update_ve' and './bin/patch_' from the INSTALL
>>> Howto. So this is the result:
>>> http://nopaste.immersight.de/?**3c0f99829f839ff8#**
>>> EhsVGqDrxk6xDzDvYq6hiuxNpJw04X**hXK36b6BMc3Dc=<http://nopaste.immersight.de/?3c0f99829f839ff8#EhsVGqDrxk6xDzDvYq6hiuxNpJw04XhXK36b6BMc3Dc=>
>>>
>>> Next stept: root@iss1:/srv/http/de.**immersight.project/treeio#
>>> ./bin/patch
>>> patching file db/models/fields/related.py
>>>
>>> I created a MySQL database, user and password. But where to configure
>>> treeio for this? Where shall I enter this informations??
>>>
>>> So this is the result of the next step:
>>> http://nopaste.immersight.de/?**f36e7753a9fcca9b#7ICkjsTcxh/**
>>> Ck4JZ6d9jhfPStsY8eYWJ3N5Ko4YrY**7M=<http://nopaste.immersight.de/?f36e7753a9fcca9b#7ICkjsTcxh/Ck4JZ6d9jhfPStsY8eYWJ3N5Ko4YrY7M=>
>>>
>>> I am not sure and dont understand much of it, but for me it seems there
>>> already went something wrong..
>>> The tree.io community is not so active, but maybe somebody here can
>>> give me a hint!
>>>
>>> Thx alot!!
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To view this discussion on the web visit https://groups.google.com/d/**
>>> msg/django-users/-/**wm6J2Ces9BUJ<https://groups.google.com/d/msg/django-users/-/wm6J2Ces9BUJ>
>>> .
>>> To post to this group, send email to django...@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users...@**
>>> googlegroups.com.
>>>
>>> For more options, visit this group at http://groups.google.com/**
>>> group/django-users?hl=en<http://groups.google.com/group/django-users?hl=en>
>>> .
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/jS4L0ShvuYYJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Override save or other options?

2012-09-12 Thread Cal Leeming [Simplicity Media Ltd]
Curious, we had to do a similar thing for billing periods on our VoIP
system a while back.

We ended up using dateutil, here's a bit of a code dump.

This was all triggered from populate_billing_periods() which was called at
the point of processing billing info (which happens every 24 hours)

Would strongly recommend looking at dateutil tho

=
def get_billing_periods(self, date):
return list(
rrule.rrule(
rrule.MONTHLY,
dtstart=self.effective_start_date,
until=date
)
)

def populate_billing_periods(self, *args, **kwargs):
# Now calculate all of our billing dates
_billing_dates = self._get_billing_date_range()

# this ensures we have all the correct billing periods
for billing_date in _billing_dates:
# create the billing period for this billing date
billing_period, created = DomainBillingPeriod.objects.get_or_create(
billing_date = billing_date,
domain = self
)
=

Apologies for the messy dump, hope it helps a little tho.

Cal

On Tue, Sep 11, 2012 at 5:23 AM, Lachlan Musicman  wrote:

> Hi All,
>
> Simplistically, I have an event type model (for a "school class") with
> a date field.
>
> On saving of the first event, I want to add recurring objects.
> Specifics for this project are "up to a latest date" (ie, end of term)
> and "recur weekly only" (not daily, monthly, yearly, etc - for the
> school's weekly timetable)
>
> I have just tried overriding the save method on the object to auto
> create these objects.
>
> def save(self):
>super(Event, self).save()
>
>last_date = self.term.end_date
>series_date = self.date + datetime.timedelta(7)
>while series_date < last_date:
>   super(Session, self).save(date = series_date)
>
> I've realised that this will most probably not make new objects, but
> will only update the date on the current object. Quite separately, I'm
> also getting keyword argument error on "date".
>
> How would you go about creating a series of events from a single save
> press? Should I be using some sort of external system (celery or ???)
> or should I write an additional method for the model that does the
> auto-creation?
>
> At some point after working this out, I will have a need to delete the
> series as well...and I don't even want to think about editing the
> series. Let's start with creating a recurring event and I'll work on
> that later.
>
> Cheers
> L.
>
>
>
>
> --
> ...we look at the present day through a rear-view mirror. This is
> something Marshall McLuhan said back in the Sixties, when the world
> was in the grip of authentic-seeming future narratives. He said, “We
> look at the present through a rear-view mirror. We march backwards
> into the future.”
>
> http://www.warrenellis.com/?p=14314
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Marketplace for Django apps

2012-09-12 Thread Cal Leeming [Simplicity Media Ltd]
OP - you could always just set a marketplace up, try and get a few big
names to jump in with you, and see if people follow - if anything it'd make
for a cool little lunch time project for you! :)

On Tue, Sep 11, 2012 at 10:20 PM, Thomas Orozco  wrote:

> You could always use https://www.gittip.com/ to that end,
> Basically, it allows you to tip developers that are on github
>
> For instance, you could tip django devs at:
> https://www.gittip.com/on/github/django/
>
> You can see that: https://www.gittip.com/aaugustin/ or
> https://www.gittip.com/alex/, among other django devs, opted into gittip,
>
> Cheers,
>
> 2012/9/11 Kurtis Mullins 
>
>> How about a compromise; just an easier way to donate to Django and Django
>> Application developers? It would encourage sharing high quality projects
>> and hopefully make it worth our time (financially, not just because we love
>> and support libre software) to do so. For that matter, there's all sorts of
>> ways to make money around free software (laid out by RMS among others) such
>> as Paid Support, selling printed documentation, etc...
>>
>>
>> On Tue, Sep 11, 2012 at 1:36 PM, Jorge Vargas wrote:
>>
>>> I agree with Jonas here. having a place were you have get apps to solve
>>> hard problems no one has done right (ecommerce is a very good example) is a
>>> plus.
>>>
>>> As for it being "cancer" and bad I don't agree there is a market for
>>> everything. And that will bring more people in which in the end is what
>>> everyone wants.
>>> I do agree that it should be clear that said store will be managed by a
>>> third party and not Django itself.
>>>
>>>
>>> On Tue, Sep 11, 2012 at 7:11 AM,  wrote:
>>>


> I want to ask you again, what you think about such service? Would you
> buy or sell apps (or paid support) out there and why?
>
>
 If the apps are more then good enough and would spare companies time
 and there are no better or equal opensource alternatives,
 then yes I do believe some people might be willing to buy apps in such
 a market place. For example there is no real outstanding e-commerce
 application for django.


 --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To post to this group, send email to django-users@googlegroups.com.
 To unsubscribe from this group, send email to django-users+unsubscribe@
 **googlegroups.com .
 For more options, visit this group at http://groups.google.com/**
 group/django-users?hl=en
 .


>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Iphone applications via django

2012-09-11 Thread Cal Leeming [Simplicity Media Ltd]
It would be a cold day in hell before I ever used XML for an API ;)

There's a whole ton of API wrappers for Django (hell you could write your
own in under 50 lines of code), but here is a pretty good one:

http://django-tastypie.readthedocs.org/en/latest/index.html

Tastypie is a bit complex to look at, but it is sane and ensures you keep
to good security and design principles.

Hope this helps!

Cal

On Tue, Sep 11, 2012 at 7:56 PM, Ray Ch <ray1mi...@gmail.com> wrote:

> Can you tell me how do i do that?
> Do you have any kind of blog or tutorial which would help me out
> connecting the web API's with iphone.
>
> Do you suggest JSON or XML ?
>
>
> On Tuesday, September 11, 2012 4:09:35 PM UTC+5:30, Cal Leeming
> [Simplicity Media Ltd] wrote:
>
>> You can create a server side API for the app - but the actual interface
>> is done using the methods mentioned by Mario previously.
>>
>> Cal
>>
>> On Tue, Sep 11, 2012 at 11:09 AM, Mario Gudelj <mario@gmail.com>wrote:
>>
>>> Nope. You do objective c or html and js with something like phonegap
>>> On Sep 11, 2012 6:59 PM, "Sait Maraşlıoğlu" <sait...@gmail.com> wrote:
>>>
>>>> How do you create iphone applications via django.
>>>> Application logic will be django but what about user interface, do we
>>>> do that with django too?
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Django users" group.
>>>> To view this discussion on the web visit https://groups.google.com/d/**
>>>> msg/django-users/-/**xL4mqQobAEUJ<https://groups.google.com/d/msg/django-users/-/xL4mqQobAEUJ>
>>>> .
>>>> To post to this group, send email to django...@googlegroups.com.
>>>> To unsubscribe from this group, send email to django-users...@**
>>>> googlegroups.com.
>>>>
>>>> For more options, visit this group at http://groups.google.com/**
>>>> group/django-users?hl=en<http://groups.google.com/group/django-users?hl=en>
>>>> .
>>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To post to this group, send email to django...@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users...@**
>>> googlegroups.com.
>>>
>>> For more options, visit this group at http://groups.google.com/**
>>> group/django-users?hl=en<http://groups.google.com/group/django-users?hl=en>
>>> .
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/J44uT5ivqbIJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django newbie with issues

2012-09-11 Thread Cal Leeming [Simplicity Media Ltd]
+1 on virtualenv - I only just started using it about 3 months ago.. don't
know how the hell I survived without it for so long!

On Tue, Sep 11, 2012 at 2:59 PM, Thomas Lockhart wrote:

> On 9/11/12 6:29 AM, Morrti wrote:
>
>> Hi,
>>
>> We did try things with v1.5, but that also failed. Looking further it
>> seems that my branch on git was wrong.
>> Moving to the correct one for 1.1 has seemed to have corrected things,
>> well we got past that issue.
>> I'm going to continue with the tutorial now and see how that goes.
>>
> Please take the advice and use 1.4.1. And on the Mac I strongly recommend
> using virtualenv; it is hard to keep things straight otherwise.
>
> hth
>
> - Tom
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@**
> googlegroups.com .
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en
> .
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Request for comments - django-cutemodel (model logging and field change auditing)

2012-09-11 Thread Cal Leeming [Simplicity Media Ltd]
Thanks for letting me know about django-reversion, it has made for
interesting reading.

>From what I can see there are two big differences between them;

* CuteModel is designed with performance/scalability in mind (as some of
our projects are tipping into the 700+mil row count and rising)
* CuteModel is designed to be as simple and easy as possible - where as
django-reversion left me feeling a bit confused.

Looking at django-reversion, it certainly looks close to cutemodel, but
there are a few differences;

* Changes are serialized into the database, this adds a significant extra
size and CPU overhead (Version.serialized_data)
* Object references are stored as a TextField, this is not good for
performance (Version.object_id)
* Creates a new serialized object every time a row is added - this is
really really not good for performance(*.VERSION_ADD)
* Requires an additional model for every model you have if you want to
store custom meta data (cutemodel only requires 1)
* Uses signal rather than overriding the subclass - although this is
probably a better approach - thoughts anyone??
* In some ways the API is quite nice, but in others it seems a bit clunky.
* Requires you to create initial revisions dump - again, not good if you
have a lot of rows

That being said - there are definitely some good points from that app, and
a lot of features that would be great for CuteModel, such as;

* Grouping together field changes into a 'revision'
* Better low level API support
* Ability to revert a change

I'm certainly going to add those into the todos list - thanks for your
feedback!

Cal

On Tue, Sep 11, 2012 at 2:46 PM, jondykeman <jondyke...@gmail.com> wrote:

> Hello,
>
> I am in a very similar situation. I would in an environment that deals
> with sensitive data collection. Everything has to be two-factor
> authenticated, in the secure server zone etc. As part of this we need
> logging of every action ever taken, by whom, when, and what the changes
> were.
>
> At first I implemented my own custom solution which was less than ideal,
> but it worked. That was a model of creating a new record for each field any
> time there was a change to the value, but via a lot of manual checking
> code.
>
> I am not starting to migrate to a slicker solution. I am taking advantage
> of django-reversion.
>
> https://github.com/etianen/django-reversion
>
> This provides row level auditing out of the box, and then you just need to
> take advantage of the pre_commit_signal to track field changes as well.
>
> @receiver(reversion.pre_revision_commit)
> def it_worked(sender, **kwargs):
> currentVersion = kwargs.pop('versions')[0].field_dict
> pastVersion =
> reversion.get_for_object(kwargs.pop('instances')[0])[0].field_dict
> changes = set(currentVersion.items()) - set(pastVersion.items())
> changedVars = []
> for var in changes:
> changedVars.append(var[0])
> comment = "Changed: %s" % ", ".join(changedVars)
> revision = kwargs.pop('revision')
> revision.comment = comment
> revision.save()
> kwargs['revision'] = revision
>
> Rather than the string tracking which fields I am going to switch to a
> dict of changed or not for each variable.
>
> I will check out cutemodel for sure and let you know.
>
> Thanks,
>
> JD
>
>
> On Tuesday, September 11, 2012 3:46:54 AM UTC-6, Cal Leeming [Simplicity
> Media Ltd] wrote:
>>
>>
>>
>> On Mon, Sep 10, 2012 at 11:07 PM, Kurt Pruhs <kpr...@gmail.com> wrote:
>>
>>> Hey Cal,
>>>
>>> This looks like a great tool. I know I've implemented code like this in
>>> another project. I was planning on doing a field change audit module for an
>>> application I'm currently working on. I will definitely look at
>>> django-cutemodel and see if it works for what I need, and how I can
>>> contribute.
>>> My current project is a time clock system for human resources to manage
>>> hourly workers. We need field change auditing for security, we need the
>>> ability to produce reports from it, and ability to restore from audit
>>> history (in case of record tampering).
>>
>>
>> I think django-cutemodel would be a pretty good fit for this requirement,
>> although it doesn't yet have any sort of administration interface to
>> produce reports, and the documentation isn't exactly great.
>>
>> Restore from audit history functionality is something we need for
>> ourselves too, so I've raised an issue (will prob fix that sometime this
>> week);
>> https://github.com/foxx/**django-cutemodel/issues/1<https://github.com/foxx/django-cutemodel/issues/1>
>>
>> We also need to have the ability to bind the Django User objects together
>> with the

Re: Plot points from a kml file in django

2012-09-11 Thread Cal Leeming [Simplicity Media Ltd]
Need a bit more info than that for anyone to help you.

Please tell us exactly what information you have, what you are trying to
achieve, and where you are getting stuck.

Cal

On Tue, Sep 11, 2012 at 1:49 PM, Coulson Thabo Kgathi wrote:

> I googled, went through the geodjango tutorial, now my problem is ploting
> points or coordinates on a map on my geodjango project tht i created using
> this kml file
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/D4KmAQqQOiUJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Marketplace for Django apps

2012-09-11 Thread Cal Leeming [Simplicity Media Ltd]
-1

It's not the cost that I'm concerned with, it's the community motivation
that worries me.

If we have a paid app store, we will not only end up with every
tom/dick/harry submitting crappy apps (just like every other store), but it
also changes the motivation of the community to be commercially driven,
rather than kudos.

Personally, I feel something like this would become the cancer of our
community, and should be avoided - especially since the Django contributors
themselves give so much for free and ask so little in return.

At the same time, there is nothing stopping you from creating your own
store and selling the modules yourself - if you really wanted to.

Cal

On Mon, Sep 10, 2012 at 7:35 AM, Slava Kravchenko wrote:

> Hi,
>
> our web development agency uses Django basically for all stuff we are
> doing. We love it, we love Django community and open-source. We even have
> some open-sourced apps.
>
> We also have some apps, which can't be open-sourced now for some reason,
> but we're interested in selling them. We know that there are some other
> agencies that have such apps.
>
> What I want to discuss is a "Django Marketplace" thing, like WordPress
> Marketplace or Magento Connect. A place, where developers will be able to
> sell apps to other developers or complete projects to end-users.
>
> About a year ago, Jacob-Kaplan Moss wrote a post on this topic in his
> blog: http://jacobian.org/writing/paid-django-apps/ . It has some
> negative and some positive comments about selling Django apps.
>
> I want to ask you again, what you think about such service? Would you buy
> or sell apps (or paid support) out there and why?
>
> --
> Slava Kravchenko
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/LrxAHCv0sQcJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django newbie with issues

2012-09-11 Thread Cal Leeming [Simplicity Media Ltd]
Ouch, 1.1 is very old indeed.

I have seen compatibility issues before when running django/py apps on a
mac, but can't say I've ever ran into this before.

Could you upgrade to the latest (1.4.1) and see if you still experience the
same issue?

Cal

On Tue, Sep 11, 2012 at 11:03 AM, Morrti  wrote:

> Hi,
>
> I'm a total newbie to Django and I'm trying to follow the build your first
> app tutorial from the site
> https://docs.djangoproject.com/en/1.1/intro/tutorial01/ but have soon run
> into problems, please see below. This is as a result of running the  python
> manage.py runserver command.
>
> If anyone can help, I believe I'm running version 1.1 of django, not sure
> what else you may want to know.
>
> Thanx,
>
> python manage.py runserver
> Validating models...
>
> Unhandled exception in thread started by  of  at 0x10114d0d0>>
> Traceback (most recent call last):
>   File
> "/Users/timmorris/Sites/django/django-trunk/django/core/management/commands/runserver.py",
> line 91, in inner_run
> self.validate(display_num_errors=True)
>   File
> "/Users/timmorris/Sites/django/django-trunk/django/core/management/base.py",
> line 277, in validate
> num_errors = get_validation_errors(s, app)
>   File
> "/Users/timmorris/Sites/django/django-trunk/django/core/management/validation.py",
> line 32, in get_validation_errors
> for (app_name, error) in get_app_errors().items():
>   File
> "/Users/timmorris/Sites/django/django-trunk/django/db/models/loading.py",
> line 163, in get_app_errors
> self._populate()
>   File
> "/Users/timmorris/Sites/django/django-trunk/django/db/models/loading.py",
> line 69, in _populate
> self.load_app(app_name, True)
>   File
> "/Users/timmorris/Sites/django/django-trunk/django/db/models/loading.py",
> line 93, in load_app
> models = import_module('.models', app_name)
>   File
> "/Users/timmorris/Sites/django/django-trunk/django/utils/importlib.py",
> line 35, in import_module
> __import__(name)
>   File
> "/Users/timmorris/Sites/django/django-trunk/django/contrib/auth/models.py",
> line 18, in 
> from django.contrib.contenttypes.models import ContentType
>   File
> "/Users/timmorris/Sites/django/django-trunk/django/contrib/contenttypes/models.py",
> line 125, in 
> class ContentType(models.Model):
>   File
> "/Users/timmorris/Sites/django/django-trunk/django/db/models/base.py", line
> 64, in __new__
> new_class.add_to_class('_meta', Options(meta, **kwargs))
> TypeError: Error when calling the metaclass bases
> __init__() keywords must be strings
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/xxWivGGykWYJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



  1   2   3   4   5   6   7   >