Should I always provide a return value when writing my test using mock library?

2012-04-10 Thread John Yeukhon Wong
I am Cc this to testing-in-python mailing list. Hope this makes sense.

Suppose I have a function called "render_reverse" which takes two 
arguments: function name, and args list, and it returns "reverse(f, *args)"

If I called render_reverse('happy_birthday', {'args': [username]}), I would 
get this:   /greeting/birthday/username/

I am going to patch the `reverse` function that's local to render_reverse, 
and inside the test, should I always provide a return value like this?

with patch('myproject.myapps.mylibrary.reverse') as mock_reverse:
 mock_f = MagicMock(name='f')
 mock_kwargs = MagicMock(name='kwargs')
 mock_reverse.return_value = ' /greeting/birthday/johnsmith/'
 response = mock_reverse(mock_f, mock_kwargs)

self.assert..


What is the best practice in general? How do I determine whether I want to 
provide a return value or not? In almost any cases, how do I know things go 
well? Sometimes I can't differentiate unittest from integration / system 
test (I want to see other codes ikn the same function execute and throw 
back the right result)

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/-/4QJSDMT5qLoJ.
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 tutorial

2012-04-10 Thread Ejah
Can you post the db part of your settings file?

On 10 apr, 06:05, Ed McLaughlin  wrote:
> _mysql.so is in there. When I try using sqlite I get this:
>
> Eds-MacBook-Air:mysite3 edmclaugh76$ python manage.py syncdb
> Traceback (most recent call last):
>   File "manage.py", line 10, in 
>     execute_from_command_line(sys.argv)
>   File "/Library/Python/2.7/site-packages/django/core/management/
> __init__.py", line 443, in execute_from_command_line
>     utility.execute()
>   File "/Library/Python/2.7/site-packages/django/core/management/
> __init__.py", line 382, in execute
>     self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "/Library/Python/2.7/site-packages/django/core/management/
> base.py", line 196, in run_from_argv
>     self.execute(*args, **options.__dict__)
>   File "/Library/Python/2.7/site-packages/django/core/management/
> base.py", line 232, in execute
>     output = self.handle(*args, **options)
>   File "/Library/Python/2.7/site-packages/django/core/management/
> base.py", line 371, in handle
>     return self.handle_noargs(**options)
>   File "/Library/Python/2.7/site-packages/django/core/management/
> commands/syncdb.py", line 57, in handle_noargs
>     cursor = connection.cursor()
>   File "/Library/Python/2.7/site-packages/django/db/backends/
> __init__.py", line 306, in cursor
>     cursor = self.make_debug_cursor(self._cursor())
>   File "/Library/Python/2.7/site-packages/django/db/backends/sqlite3/
> base.py", line 281, in _cursor
>     self._sqlite_create_connection()
>   File "/Library/Python/2.7/site-packages/django/db/backends/sqlite3/
> base.py", line 271, in _sqlite_create_connection
>     self.connection = Database.connect(**kwargs)
> sqlite3.OperationalError: unable to open database file
>
> Any ideas? I really appreciate the help!
>
> On Apr 9, 10:16 pm, Mario Gudelj  wrote:
>
>
>
> > Go to 
> > /Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.7-inte 
> > l.egg/
> > on your Mac and see if _mysql.so is int there. You may need to re-install
> > MySQL_python connector. Maybe this can 
> > helphttp://www.brambraakman.com/blog/comments/installing_mysql_python_mys...
>
> > Otherwise, you can always use SQlite for dev environment until you go to
> > production. I find it a lot easier to manage.
>
> > On 10 April 2012 10:54, Ed McLaughlin  wrote:
>
> > > Hello! I am working through the Django tutorial (
> > >https://docs.djangoproject.com/en/1.4/intro/tutorial01/) and I have
> > > hit a roadblock in the 'database setup' portion of part 1. When I
> > > enter the command 'python manage.py syncdb' I get the error below. I
> > > believe I properly installed MySQL Community Server and mysqldb
> > > Any help would be GREATLY appreciated.
>
> > > Eds-MacBook-Air:mysite edmclaugh76$ python manage.py syncdb
> > > Traceback (most recent call last):
> > >  File "manage.py", line 10, in 
> > >    execute_from_command_line(sys.argv)
> > >  File "/Library/Python/2.7/site-packages/django/core/management/
> > > __init__.py", line 443, in execute_from_command_line
> > >    utility.execute()
> > >  File "/Library/Python/2.7/site-packages/django/core/management/
> > > __init__.py", line 382, in execute
> > >    self.fetch_command(subcommand).run_from_argv(self.argv)
> > >  File "/Library/Python/2.7/site-packages/django/core/management/
> > > __init__.py", line 261, in fetch_command
> > >    klass = load_command_class(app_name, subcommand)
> > >  File "/Library/Python/2.7/site-packages/django/core/management/
> > > __init__.py", line 69, in load_command_class
> > >    module = import_module('%s.management.commands.%s' % (app_name,
> > > name))
> > >  File "/Library/Python/2.7/site-packages/django/utils/importlib.py",
> > > line 35, in import_module
> > >    __import__(name)
> > >  File "/Library/Python/2.7/site-packages/django/core/management/
> > > commands/syncdb.py", line 8, in 
> > >    from django.core.management.sql import custom_sql_for_model,
> > > emit_post_sync_signal
> > >  File "/Library/Python/2.7/site-packages/django/core/management/
> > > sql.py", line 6, in 
> > >    from django.db import models
> > >  File "/Library/Python/2.7/site-packages/django/db/__init__.py", line
> > > 40, in 
> > >    backend = load_backend(connection.settings_dict['ENGINE'])
> > >  File "/Library/Python/2.7/site-packages/django/db/__init__.py", line
> > > 34, in __getattr__
> > >    return getattr(connections[DEFAULT_DB_ALIAS], item)
> > >  File "/Library/Python/2.7/site-packages/django/db/utils.py", line
> > > 92, in __getitem__
> > >    backend = load_backend(db['ENGINE'])
> > >  File "/Library/Python/2.7/site-packages/django/db/utils.py", line
> > > 24, in load_backend
> > >    return import_module('.base', backend_name)
> > >  File "/Library/Python/2.7/site-packages/django/utils/importlib.py",
> > > line 35, in import_module
> > >    __import__(name)
> > >  File "/Library/Python/2.7/site-packages/django/db/backends/mysql/
> > > base.py", line 16, in 
> > >    raise 

Re: Password_reset error

2012-04-10 Thread Ejah
I assume App is the name of your application within your project, it
might not be on the python path. Can you import it from a python/
django shell?

On 9 apr, 19:29, kapil Garg  wrote:
> Hi All,
>
> I'm trying to implement  *Forgot Password* in my django application and
> have  done the very basic as mentioned in the documentation with all the
> default values but on clicking the Link, I get the error  "*ViewDoesNotExist
> at /accounts/password_reset/*"
>
> Tried save in module .views. Error was: 'module' object has
> no attribute 'save'
>
> what am I missing here ? Below is the code -
>
> *urls.py:*
>
> (r'^accounts/password_reset/$','App.views.my_password_reset'),
>
> *views.py:*
>
> def my_password_reset(request):
>
>     return password_reset(request)
>
> --
> Regards,
> Kapil

-- 
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: Password_reset error

2012-04-10 Thread Ejah
BTW, there is django-registration that takes care of all of this
already. You can save yourself some time there.
Hth

On 9 apr, 19:29, kapil Garg  wrote:
> Hi All,
>
> I'm trying to implement  *Forgot Password* in my django application and
> have  done the very basic as mentioned in the documentation with all the
> default values but on clicking the Link, I get the error  "*ViewDoesNotExist
> at /accounts/password_reset/*"
>
> Tried save in module .views. Error was: 'module' object has
> no attribute 'save'
>
> what am I missing here ? Below is the code -
>
> *urls.py:*
>
> (r'^accounts/password_reset/$','App.views.my_password_reset'),
>
> *views.py:*
>
> def my_password_reset(request):
>
>     return password_reset(request)
>
> --
> Regards,
> Kapil

-- 
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: HttpResponse_is_string is removed Django 1.4

2012-04-10 Thread Tom Evans
On Fri, Apr 6, 2012 at 3:56 PM, Ian Clelland  wrote:
>
>
> On Thu, Apr 5, 2012 at 6:07 PM, Rajat Jain  wrote:
>>
>> Hi,
>>
>> I have noticed that the class variable HttpReponse._is_string (in
>> django/http/__init__.py) is removed in Django 1.4. I was setting this
>> variable in a couple of places in my code, so that piece of code is breaking
>> in Django 1.4. Do you know if this field is required at all? If not, is it
>> just safe to remove this field altogether from my code?
>
>
> Were you setting it to True or False?
>
> If your code sets it to True, then this should be safe to remove -- in
> Django 1.4, HttpResponse always renders its output as a string, converts its
> contents to a string, regardless of what type of data it has been given.
>
> If you were setting it to False, for some reason, then you'll have to come
> up with a different way of accomplish whatever you're trying to do.
>
> (The original ticket was https://code.djangoproject.com/ticket/16494, and
> you can see the changes that were made for 1.4
> here: https://code.djangoproject.com/changeset/16829)
>
>

FYI for the archives, if like me you were using this value to
determine if response.content was an iterator based response, then you
can simply invert your logic and use request._base_content_is_iter
rather than request._is_string.

The difference can be important if you are trying to cache an iterator
based response where the response must be iterated over and output in
chunks - the base cache middleware will naively try to slurp these
sorts of responses into a string.

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.



Re: Django 1.4: TypeError: get_db_prep_value() got an unexpected keyword argument 'connection'

2012-04-10 Thread Tom Evans
On Sun, Apr 8, 2012 at 4:25 PM, shacker  wrote:
> Russell's response is correct, but speaking of stale *.pyc files that
> may occasionally bite you, try putting this in your bash aliases:
>
> alias delpyc='find . -name "*.pyc" -print0 | xargs -0 rm -rf'
>
> Then you safely run "delpyc" from the top level of your project at any time

Minor nit; .pyc files are, well, 'files', and so should not need
recursive or forced rm. Hence:

alias delpyc='find . -type f -name "*.pyc" -print0 | xargs -0 rm'

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.



New release of Instant Django

2012-04-10 Thread Kevin
For the Windows users out there, or for those with friends who use Windows, 
this is for you.

Some of you may recall Instant Django, there should be a post from the 
original author on this group about it.

Basically Instant Django is a self contained Python+Django installation 
within a single directory.  It can run on any Windows platform without any 
further software installations.  It can even run alongside your existing 
Python installation, without interfering with it.  It is an entirely 
self-contained Python+Django installation to easily engage with future 
Django developers, or those who merely want to check out Django just to see 
if it's right for them.

Changes from the original Instant Django include:
Django 1.4
Setuptools-0.6u11
pip-1.1

The inclusion of setuptools and pip allow new users to Python to easy 
install new packages and explore PyPi to see what there is offer in the 
world of Python.

Unlike normal Python installations, the included batch file will setup a 
perfect "PATH" variable, to make the command shell in Windows feel exactly 
like a *NIX.  Python and django-admin are in the PATH. :)  This will allow 
users to easy use the package with no knowledge of setting up their Windows 
environment, and this also makes most, if not all online Python tutorials 
just work.  Normally a Windows user will need to either alter their path 
settings, or type in the entire path, for django-admin.py this can be a tad 
annoying.  This can also deter users from exploring Python or Django, as it 
can be a lot of work to configure your Windows environment.

Everything from the original Instant Django are all left in tact.  I added 
a readme file and a packages file which explains some basic operations to 
get new users up and running quickly.  The batch file is the same as in 
Instant Django.  Notepad++ is also included, just as the original Instant 
Django.

Check it out, and let me know what you think: 
http://www.pythondiary.com/blog/Apr.10,2012/instant-django-release-information.html

Best of all, the actual ZIP file is hosted on a CDN(Content Delivery 
Network), which means all users regardless of their region will be-able to 
download the file at very fast speeds(does depend on your local connection, 
don't expect fast on your 56k).

Kevin Veroneau

-- 
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/-/nK5SoDWrH2AJ.
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: ModelForm based on User allows any username without checking

2012-04-10 Thread Bastian
I assumed restrictions would apply at model level but it's not the case.

About the ModelForm, isn't it the point of using a ModelForm? (with the 
User model as shown in the example of course) that it inherits from the 
model and automatically creates the right fields, widgets, and restrictions?

regards,
Bastian

On Tuesday, April 10, 2012 8:51:18 AM UTC+2, Pavan Verma wrote:
>
> I went through django/contrib/auth/models.py to check the definition 
> of the User model. I don't see this file defining any restrictions on 
> what a username can be. So, I think the form is the place (and 
> possibly the only place) which defines and enforces restrictions on 
> what the username can be. 
>
> Interestingly, the help_text for User.username is the following: 
>
> help_text=_('Required. 30 characters or fewer. Letters, 
> numbers and ' 
> '@/./+/-/_ characters')) 
>
> But this restriction in neither defined nor enforced in the User model 
> class. 
>
>
> > isn't it supposed to be automatic, coming from the restrictions of the 
> model since it's a ModelForm? 
>
> I didn't understand this comment. Why would you think ModelForm has 
> anything to do with it? As in, why would ModelForm know anything about 
> User.username. 
>
>
> thanks, 
> -pavan 
>
>
> On Apr 10, 12:53 am, Bastian  wrote: 
> > Yes that's what I ended up doing but isn't it supposed to be automatic, 
> > coming from the restrictions of the model since it's a ModelForm? 
> > 
> > On Thursday, April 5, 2012 7:51:14 PM UTC+2, Pavan Verma wrote: 
> > 
> > > Hi Bastian, 
> > > you need to define the restrictions on the username field. It can be 
> > > done by including the code below inside usernameForm. This code is 
> > > from django/contrib/auth/forms.py -> UserCreationForm, you can refer 
> > > it to understand further. 
> > 
> > > username = forms.RegexField(label="Username", max_length=30, 
> > > regex=r'^[\w.@+-]+$', 
> > > help_text="Required. 30 characters or fewer. Letters, digits 
> > > and " 
> > >   "@/./+/-/_ only.", 
> > > error_messages={ 
> > > 'invalid': "This value may contain only letters, numbers 
> > > and " 
> > >  "@/./+/-/_ characters."}) 
> > 
> > > thanks, 
> > > -pavan 
> > 
> > > On Apr 4, 7:36 pm, Bastian  wrote: 
> > > > Hi, 
> > 
> > > > I have a form that asks the registering user to choose a username. 
> That 
> > > > form is a ModelForm based on the django.contrib.auth.models Users: 
> > 
> > > > class usernameForm(forms.ModelForm): 
> > > > class Meta: 
> > > > model = User 
> > > > fields = ('username', ) 
> > 
> > > > The strange thing is that when it appears on the page it comes with 
> the 
> > > > warning that says no more than 30 characters... but it actually does 
> not 
> > > > check anything. I tried to enter whatever username, with spaces and 
> () 
> > > and 
> > > > in the view when I ask if form.is_valid() it returns True all the 
> time! 
> > 
> > > > Obviously this must be a mistake on my side somewhere but on such a 
> > > simple 
> > > > setup I don't see where I am wrong, any idea welcome.

-- 
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/-/6JDVO0XZEjMJ.
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.



reportlab.platypus - rendering template with a right aligned image in the template header as background

2012-04-10 Thread luke lukes
hi everyone. i'm tryng to use Reportlab to output an invoice on a
simple Django app. it seems quite difficult to do simple things like
this. here's my code:

http://dpaste.de/mSXQm/

with this code, my header image is always rendered on page center. i
want to insert it on the right (like that: http://i.imgur.com/0Ahww.png)
or even better having image on the right and text on the left. i've
tried in many ways (setting the hAlign or oAlign propetry of img,
inserting image in a ParagraphAndImage flowable) but always i got
errors or the same alignment. what is the right way?

i've tried to look at Reportlab documentation but seems not so clear
to me and poor of code snippets.

tnx to everyone,

LuKe

-- 
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: Hosting Django website

2012-04-10 Thread Tom Evans
On Sun, Apr 8, 2012 at 2:59 PM, KasunLak  wrote:
> Hi all,
>
> I have created a website using django. I want to host it now. Can you
> suggest me a best way to host it? I have noticed it is possible to
> host in tomcat on top of jython, is this recommended or have any
> issues?
>

There are many ways to host a django site, hosting it in Tomcat and
running on Jython is probably one of the least frequently used method.

The most common way is to use wsgi or fastcgi, and a webserver that
can communicate with wsgi or fastcgi, like Apache httpd, nginx, etc.
The instructions in the docs are quite canonical.

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.



Best approach for multiple sites in a single deployment?

2012-04-10 Thread Bernardo
I would like to create a subdomain based authentication system, like the 
one on 37signals, freshbooks, codebase, etc. The objective is to do 
something like smaller but in far smaller scale (I suppose a maximum of 
100-1000 blogs). All other models (blog posts, comments, etc) already have 
a foreign key to Site. 

1. How can I allow different users to have the same username in different 
sites? How can I make so that when a user logs in, he logged in to a 
specific site (logging on blog A does not log you to blog B).

For allowing the same username in different sites I guess I'd have to write 
my own authentication backend and a new model for User, as I don't see how 
the default User model would fit. Is this a good approach? 

2. Is there anyway to make the sites framework fetch the current site based 
on the subdomain instead of the settings? Or am I seeing this the wrong way?

My plan was to use a single deployment for everything and use the sites 
framework, but as far as I've understood, the sites framework relies on the 
settings.SITE_ID parameter, which would be the same for a single 
deployment. What would be a good approach here? Creating a new settings 
file for each new blog?

Many thanks in advance!

-- 
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/-/zQimMoWFGNUJ.
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: Advice on installing Django in a fresh OSX Lion machine

2012-04-10 Thread Daniel Roseman
On Tuesday, 10 April 2012 00:00:32 UTC+1, Paulo wrote:
>
> So I follow your advice and did sudo easy_install pip and sudo pip install 
> virtualenvwrapper.
> Then I instaled homebrew and wget as mentioned in the site. And then I hit 
> the wall. 
> When I tried to python setup.py install --prefix=~/.local the return was a 
> error:
>
>>
>>>
Which bit of advice is this following? None of shacker's steps seem to 
involve running setup.py.
--
DR.

-- 
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/-/TXcIm9170jMJ.
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.



get called, after logout completed

2012-04-10 Thread Daniel Marohn
Hi!

logout method in contrib/auth/__init__ calls signal user_logged_out before 
creating the new session. 

I want to set a flag into the new session but do not see any way how to do 
this. Something like a post_user_logged_out signal.

Any ideas for a workarround (I do not want to patch django)?

Daniel

-- 
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/-/4IE0ES2a-OkJ.
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: Password_reset error

2012-04-10 Thread Святослав Б
Post full views.py file

2012/4/9 kapil Garg 

> Hi All,
>
>
> I'm trying to implement  *Forgot Password* in my django application and
> have  done the very basic as mentioned in the documentation with all the
> default values but on clicking the Link, I get the error  "*ViewDoesNotExist
> at /accounts/password_reset/*"
>
> Tried save in module .views. Error was: 'module' object has no 
> attribute 'save'
>
>
> what am I missing here ? Below is the code -
>
> *urls.py:*
>
> (r'^accounts/password_reset/$','App.views.my_password_reset'),
>
> *views.py:*
>
> def my_password_reset(request):
>
> return password_reset(request)
>
>
> --
> Regards,
> Kapil
>
>  --
> 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: cache decorators in urls.py error

2012-04-10 Thread Tom Evans
On Sat, Apr 7, 2012 at 3:53 PM, Phang Mulianto  wrote:
> Hi,
>
> i have my apps and try to use cache decorator in url.py but got error.
>
> Here are the urls.py
>
> from django.views.decorators.cache import cache_page
>
> urlpatterns = patterns('article.views',
>     #(r'^$','index', { 'template_name': 'blog/public_list.html'}, 'index'),
>     (r'^$',cache_page('index'), { 'template_name': 'blog/public_list.html'},
> 'index'),
> )
>
> the error is :
>
> cache_page must be passed a view function if called with two arguments
>
> what is wrong in the url.. note i also use the DDT (django debug toolbar) .
>
> THanks for pointing me out..

https://docs.djangoproject.com/en/1.3/topics/cache/#specifying-per-view-cache-in-the-urlconf

cache_page wraps a function, not a string.

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.



Django Fundamentals Bootcamp

2012-04-10 Thread Nicole Foster
Hello!

I'm excited to announce that on June 9th and 10th, Caktus Group
(www.caktusgroup.com) will be hosting our first Django bootcamp. It
will be a two day intensive bootcamp session where you'll learn the
basics of developing a web application using Django through
constructing a crossword drill application that has been created by
the Caktus staff. It will go over the architecture  of Django and also
third party applications that will allow you to enhance your finished
application. For more information regarding our bootcamp you can check
out the day's event here: 
http://www.caktusgroup.com/events/details/django-fundamentals-bootcamp

For the two day class, the early bird rate is $400.00-lunch, snacks
and lots of coffee will be provided. You can register for the event
here: http://djangobootcamp.eventbrite.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.



Re: Best approach for multiple sites in a single deployment?

2012-04-10 Thread Mario Gudelj
Hey man,

See if this helps
http://tidbids.posterous.com/saas-with-django-and-postgresql-schemas

Cheers,

-m

On 10 April 2012 21:53, Bernardo  wrote:

> I would like to create a subdomain based authentication system, like the
> one on 37signals, freshbooks, codebase, etc. The objective is to do
> something like smaller but in far smaller scale (I suppose a maximum of
> 100-1000 blogs). All other models (blog posts, comments, etc) already have
> a foreign key to Site.
>
> 1. How can I allow different users to have the same username in different
> sites? How can I make so that when a user logs in, he logged in to a
> specific site (logging on blog A does not log you to blog B).
>
> For allowing the same username in different sites I guess I'd have to
> write my own authentication backend and a new model for User, as I don't
> see how the default User model would fit. Is this a good approach?
>
> 2. Is there anyway to make the sites framework fetch the current site
> based on the subdomain instead of the settings? Or am I seeing this the
> wrong way?
>
> My plan was to use a single deployment for everything and use the sites
> framework, but as far as I've understood, the sites framework relies on the
> settings.SITE_ID parameter, which would be the same for a single
> deployment. What would be a good approach here? Creating a new settings
> file for each new blog?
>
> Many thanks in advance!
>
>  --
> 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/-/zQimMoWFGNUJ.
> 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: Advice on installing Django in a fresh OSX Lion machine

2012-04-10 Thread Paulo
You're right it doesn't. What I meant was, that I installed pip and 
virtualenvwrapper 
and THEN followed the tutorial as he advised.
But today I uninstalled virtualenv and virtualenvwrapper and following the 
tutorial [1] instructionsand everything seems to work now.
Thanks for helping.

[1] -  
http://hackercodex.com/2011/08/30/python-install-django-on-mac-osx-lion-10.7/

Terça-feira, 10 de Abril de 2012 12:59:50 UTC+1, Daniel Roseman escreveu:
>
> On Tuesday, 10 April 2012 00:00:32 UTC+1, Paulo wrote:
>>
>> So I follow your advice and did sudo easy_install pip and sudo pip 
>> install virtualenvwrapper.
>> Then I instaled homebrew and wget as mentioned in the site. And then I 
>> hit the wall. 
>> When I tried to python setup.py install --prefix=~/.local the return was 
>> a error:
>>
>>>

> Which bit of advice is this following? None of shacker's steps seem to 
> involve running setup.py.
> --
> DR.
>

-- 
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/-/8mygoolr6BAJ.
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 approach for multiple sites in a single deployment?

2012-04-10 Thread Juan Pablo Martínez
Apache VirtualHost do that.

Listen 39986
NameVirtualHost *:39986
ServerLimit 2



ServerName domain1.com
ServerAlias www.domain1.com
WSGIProcessGroup django_group1
WSGIDaemonProcess django_group1 processes=2 threads=12
python-path=/home/user/djangosite:/home/user/path/python2.7
display-name=%{GROUP}
WSGIScriptAlias / /home/user/path/domain1.wsgi




ServerName domain2.com
ServerAlias www.domain2.com
WSGIProcessGroup django_group2
WSGIDaemonProcess django_group2 processes=2 threads=12
python-path=/home/user/djangosite:/home/user/path/python2.7
display-name=%{GROUP}
WSGIScriptAlias / /home/user/path/domain2.wsgi




ServerName subdomain3.domain3.com
ServerAlias subdomain3.domain3.com
WSGIProcessGroup django_group3
WSGIDaemonProcess django_group3 processes=2 threads=12
python-path=/home/user/djangosite:/home/user/path/python2.7
display-name=%{GROUP}
WSGIScriptAlias / home/user/path/domain3.wsgi




On Tue, Apr 10, 2012 at 11:42 AM, Mario Gudelj wrote:

> Hey man,
>
> See if this helps
> http://tidbids.posterous.com/saas-with-django-and-postgresql-schemas
>
> Cheers,
>
> -m
>
>
> On 10 April 2012 21:53, Bernardo  wrote:
>
>> I would like to create a subdomain based authentication system, like the
>> one on 37signals, freshbooks, codebase, etc. The objective is to do
>> something like smaller but in far smaller scale (I suppose a maximum of
>> 100-1000 blogs). All other models (blog posts, comments, etc) already have
>> a foreign key to Site.
>>
>> 1. How can I allow different users to have the same username in different
>> sites? How can I make so that when a user logs in, he logged in to a
>> specific site (logging on blog A does not log you to blog B).
>>
>> For allowing the same username in different sites I guess I'd have to
>> write my own authentication backend and a new model for User, as I don't
>> see how the default User model would fit. Is this a good approach?
>>
>> 2. Is there anyway to make the sites framework fetch the current site
>> based on the subdomain instead of the settings? Or am I seeing this the
>> wrong way?
>>
>> My plan was to use a single deployment for everything and use the sites
>> framework, but as far as I've understood, the sites framework relies on the
>> settings.SITE_ID parameter, which would be the same for a single
>> deployment. What would be a good approach here? Creating a new settings
>> file for each new blog?
>>
>> Many thanks in advance!
>>
>>  --
>> 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/-/zQimMoWFGNUJ.
>> 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.
>



-- 
juanpex

-- 
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 - How to disable "Delete each record" option for all the models at once

2012-04-10 Thread creecode
Hello Girish,

Would 
ModelAdmin.has_delete_permissiondo
 the trick?

On Monday, April 9, 2012 10:27:40 PM UTC-7, girishms wrote:
>
>
> Is there a way to remove "Delete each record" option for all the models in 
> admin?
>

Toodle-lo..
creecode 

-- 
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/-/PDjUInlNzXYJ.
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.



Dynamic forms with custom javascript

2012-04-10 Thread Pratik Mandrekar
I need to create a flow where the screen element transitions between
several forms and video (Eg. Video - form - Video -form ...).  So I
don't render them as separate pages but rather as a single page with
different visible and hidden elements that vary depending on the page
state.

The problem is that the forms are of two main kinds. One of them is a
bunch of entries that can be validated client side (Like enter 1+1).
The other is a set of responses that get submitted to the server (I'm
thinking ajax calls). I want to generate these forms dynamically
before rendering them.

While rendering dynamic forms is a known solution, I am yet to figure
out how I could just render the dynamic forms with fixed answers (like
1+1=?, ans 2) with custom validation logic that runs as javascript in
the client.

Is there any good example or a best practice known for such a
functional requirement?

Some ground is covered by this thread
http://groups.google.com/group/django-users/browse_thread/thread/e00c92be1786d2cf/31b0a8292155b7cc
and this stack overflow question -
http://stackoverflow.com/questions/5423590/django-how-to-build-a-formset-for-a-quiz

-- 
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.



Maybe I'm thinking about this wrong

2012-04-10 Thread Dom Armstrong
Im not sure if I am going about this the wrong way.

Trying to learn class based views *sigh* currently seeming more complicated 
and less human readable with no less code currently but I expect most 
people feel that at first.

class HomePage(ListView, BaseFormView):
template_name = 'index.html'
queryset = Notes.objects.filter(user=1)
context_object_name = 'notes'
form_class = LoginForm
success_url = '/notes/'

def get_context_date(self, **kwargs):
context = super(HomePage, self).get_context_data(**kwargs)
context['loginform'] = LoginForm
for kwarg in kwargs:
context[kwarg] = kwargs[kwarg]
return context

def form_valid(self, form, **kwargs):
"""do some form stuff"""
if "errors with login":
kwargs['error'] = 'account not active'
kwargs['error_type2'] = 'check details'
return self.get_context_data(**kwargs)

what I want to do really is return the errors back to the start as extra 
context, if it was a function I would understand where to send the kwargs.. 
currently I get errors regarding missing the original context that would be 
passed to get_context_data since it is only getting my kwargs and not the 
original. 

Do I need to be adding 

if 'error': 
error=error
return render_to_response('template' {'error':error, 'form':form, 
'queryset':queryset})

as well as the original context I need, seems messy.

-- 
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/-/f1cCwSjvzFsJ.
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.



Migrating a database from Django 1.1/postgress to 1.3/MySQL

2012-04-10 Thread Roy Smith
I've got an old site running Django 1.1 with a postgress backend.  I'm moving 
it to Django 1.3, with MySQL.  I dumped all the old data with:

$ python manage.py dumpdata --indent 2 > materia-dump.2012-04-06.json

I created a brand new MySQL database and ran syncdb, then tried to import the 
data with

$ python manage.py loaddata materia-dump.2012-04-06.json

But I get complaints about duplicate keys:

> Problem installing fixture '/home/roy/materia-dump.2012-04-06.json': 
> Traceback (most recent call last):
>   File 
> "/usr/lib/pymodules/python2.6/django/core/management/commands/loaddata.py", 
> line 174, in handle
> obj.save(using=using)
>   File "/usr/lib/pymodules/python2.6/django/core/serializers/base.py", line 
> 165, in save
> models.Model.save_base(self.object, using=using, raw=True)
>   File "/usr/lib/pymodules/python2.6/django/db/models/base.py", line 526, in 
> save_base
> rows = manager.using(using).filter(pk=pk_val)._update(values)
>   File "/usr/lib/pymodules/python2.6/django/db/models/query.py", line 491, in 
> _update
> return query.get_compiler(self.db).execute_sql(None)
>   File "/usr/lib/pymodules/python2.6/django/db/models/sql/compiler.py", line 
> 869, in execute_sql
> cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
>   File "/usr/lib/pymodules/python2.6/django/db/models/sql/compiler.py", line 
> 735, in execute_sql
> cursor.execute(sql, params)
>   File "/usr/lib/pymodules/python2.6/django/db/backends/util.py", line 34, in 
> execute
> return self.cursor.execute(sql, params)
>   File "/usr/lib/pymodules/python2.6/django/db/backends/mysql/base.py", line 
> 86, in execute
> return self.cursor.execute(query, args)
>   File "/usr/lib/pymodules/python2.6/MySQLdb/cursors.py", line 166, in execute
> self.errorhandler(self, exc, value)
>   File "/usr/lib/pymodules/python2.6/MySQLdb/connections.py", line 35, in 
> defaulterrorhandler
> raise errorclass, errorvalue
> IntegrityError: (1062, "Duplicate entry 'photologue-gallery' for key 
> 'app_label'")


Looking at the json output, I don't see any duplicates.  I've got:

  {
"pk": 9,
"model": "contenttypes.contenttype",
"fields": {
  "model": "gallery",
  "name": "gallery",
  "app_label": "photologue"
}
  },

but that's the only entry for name = "gallery", app_label = "photologue".  Any 
idea what I'm doing wrong?


---
Roy Smith
r...@panix.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.



Re: Migrating a database from Django 1.1/postgress to 1.3/MySQL

2012-04-10 Thread Marcin Tustin
syncdb has probably already created your content types.

I strongly suggest that you use the option --exclude contenttypes (and any
other app that is likely to create its own data during sync/migration).

On Tue, Apr 10, 2012 at 17:59, Roy Smith  wrote:

> I've got an old site running Django 1.1 with a postgress backend.  I'm
> moving it to Django 1.3, with MySQL.  I dumped all the old data with:
>
> $ python manage.py dumpdata --indent 2 > materia-dump.2012-04-06.json
>
> I created a brand new MySQL database and ran syncdb, then tried to import
> the data with
>
> $ python manage.py loaddata materia-dump.2012-04-06.json
>
> But I get complaints about duplicate keys:
>
> > Problem installing fixture '/home/roy/materia-dump.2012-04-06.json':
> Traceback (most recent call last):
> >   File
> "/usr/lib/pymodules/python2.6/django/core/management/commands/loaddata.py",
> line 174, in handle
> > obj.save(using=using)
> >   File "/usr/lib/pymodules/python2.6/django/core/serializers/base.py",
> line 165, in save
> > models.Model.save_base(self.object, using=using, raw=True)
> >   File "/usr/lib/pymodules/python2.6/django/db/models/base.py", line
> 526, in save_base
> > rows = manager.using(using).filter(pk=pk_val)._update(values)
> >   File "/usr/lib/pymodules/python2.6/django/db/models/query.py", line
> 491, in _update
> > return query.get_compiler(self.db).execute_sql(None)
> >   File "/usr/lib/pymodules/python2.6/django/db/models/sql/compiler.py",
> line 869, in execute_sql
> > cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
> >   File "/usr/lib/pymodules/python2.6/django/db/models/sql/compiler.py",
> line 735, in execute_sql
> > cursor.execute(sql, params)
> >   File "/usr/lib/pymodules/python2.6/django/db/backends/util.py", line
> 34, in execute
> > return self.cursor.execute(sql, params)
> >   File "/usr/lib/pymodules/python2.6/django/db/backends/mysql/base.py",
> line 86, in execute
> > return self.cursor.execute(query, args)
> >   File "/usr/lib/pymodules/python2.6/MySQLdb/cursors.py", line 166, in
> execute
> > self.errorhandler(self, exc, value)
> >   File "/usr/lib/pymodules/python2.6/MySQLdb/connections.py", line 35,
> in defaulterrorhandler
> > raise errorclass, errorvalue
> > IntegrityError: (1062, "Duplicate entry 'photologue-gallery' for key
> 'app_label'")
>
>
> Looking at the json output, I don't see any duplicates.  I've got:
>
>  {
>"pk": 9,
>"model": "contenttypes.contenttype",
>"fields": {
>  "model": "gallery",
>  "name": "gallery",
>  "app_label": "photologue"
>}
>  },
>
> but that's the only entry for name = "gallery", app_label = "photologue".
>  Any idea what I'm doing wrong?
>
>
> ---
> Roy Smith
> r...@panix.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.
>
>


-- 
Marcin Tustin
Tel: 07773 787 105

-- 
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: Hosting Django website

2012-04-10 Thread KasunLak
Thank you very much to all of you, this stuff helps me. :)

On Apr 10, 4:25 pm, Tom Evans  wrote:
> On Sun, Apr 8, 2012 at 2:59 PM,KasunLak wrote:
> > Hi all,
>
> > I have created a website using django. I want to host it now. Can you
> > suggest me a best way to host it? I have noticed it is possible to
> > host in tomcat on top of jython, is this recommended or have any
> > issues?
>
> There are many ways to host a django site, hosting it in Tomcat and
> running on Jython is probably one of the least frequently used method.
>
> The most common way is to use wsgi or fastcgi, and a webserver that
> can communicate with wsgi or fastcgi, like Apache httpd, nginx, etc.
> The instructions in the docs are quite canonical.
>
> 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.



Django 1.4: No wrapping of exceptions in TEMPLATE_DEBUG mode

2012-04-10 Thread h3
>From the doc:

> In previous versions of Django, whenever the TEMPLATE_DEBUG setting was True, 
> any exception raised during template rendering (even exceptions unrelated to 
> template syntax) were wrapped in TemplateSyntaxError and re-raised. This was 
> done in order to provide detailed template source location information in the 
> debug 500 page.
>
> In Django 1.4, exceptions are no longer wrapped. Instead, the original 
> exception is annotated with the source information. This means that catching 
> exceptions from template rendering is now consistent regardless of the value 
> of TEMPLATE_DEBUG, and there's no need to catch and unwrap 
> TemplateSyntaxError in order to catch other errors.

Pretty cool .. I guess. But now how can I see raised exceptions ?

If I include a template or call a template tags which raise an
exception, nothing happen.

I appreciate the added robustness.. but without clear documentation on
how to show those exception, debugging is a bit painful.

-- 
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.



Django for Enterprise

2012-04-10 Thread Ivo Marcelo Leonardi Zaniolo
Hi there, a got those  questions annoying me...

Is django ready to a hudge enterprise project?
I'm not talking of a website, it's more like an Erp.

Does anybody already worked on a really hudge project?
A really hudge.

Here in Brazil we have few  python or django experts. Here in our local
market there's lots of c# and Java programmers.

It's easy to start a good quality job with juniors developers?
I know that python and django  are both easy to learn.

Please guys, I looking for responses based on great django experiences.

Tanks a lot guys
Ivo Marcelo Leonardi Zaniolo
Sent from mobile
imarcelolz.blogspot.com.br

-- 
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 for Enterprise

2012-04-10 Thread andrea mucci
hi ivo

the problem is not if Django is a good framework for huge project, but if you 
or your devs have experience to design and maintain some "big" projects.
with python and django have a lot of projects with huge traffic or huge 
database design, so i think is possible to create something very "strong"
> Does anybody already worked on a really hudge project? 
> 
> 
YES or NO, what do you mean for huge project
with a lot of traffic?
with different technologies?
for a big customer?

> t's easy to start a good quality job with juniors developers?
> 

NO

> I know that python and django  are both easy to learn.
> 
YES, but is not the reason for a good and fast code creation


cheers,

El 10/04/2012, a las 21:50, Ivo Marcelo Leonardi Zaniolo escribió:

> Hi there, a got those  questions annoying me...
> 
> Is django ready to a hudge enterprise project?
> I'm not talking of a website, it's more like an Erp.
> 
> Does anybody already worked on a really hudge project? 
> A really hudge.
> 
> Here in Brazil we have few  python or django experts. Here in our local 
> market there's lots of c# and Java programmers.
> 
> It's easy to start a good quality job with juniors developers? 
> I know that python and django  are both easy to learn.
> 
> Please guys, I looking for responses based on great django experiences.
> 
> Tanks a lot guys 
> Ivo Marcelo Leonardi Zaniolo
> Sent from mobile 
> imarcelolz.blogspot.com.br
> 
> 
> -- 
> 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: Django for Enterprise

2012-04-10 Thread Ivo Marcelo Leonardi Zaniolo
Tanks Andrea.

Maybe my biggest problem is to find good developers.

Att
Ivo Marcelo Leonardi Zaniolo
Sent from mobile
On Apr 10, 2012 5:11 PM, "andrea mucci"  wrote:

> hi ivo
>
> the problem is not if Django is a good framework for huge project, but if
> you or your devs have experience to design and maintain some "big" projects.
> with python and django have a lot of projects with huge traffic or huge
> database design, so i think is possible to create something very "strong"
>
> Does anybody already worked on a really hudge project?
>
> YES or NO, what do you mean for huge project
> with a lot of traffic?
> with different technologies?
> for a big customer?
>
> t's easy to start a good quality job with juniors developers?
>
> NO
>
> I know that python and django  are both easy to learn.
>
> YES, but is not the reason for a good and fast code creation
>
>
> cheers,
>
> El 10/04/2012, a las 21:50, Ivo Marcelo Leonardi Zaniolo escribió:
>
> Hi there, a got those  questions annoying me...
>
> Is django ready to a hudge enterprise project?
> I'm not talking of a website, it's more like an Erp.
>
> Does anybody already worked on a really hudge project?
> A really hudge.
>
> Here in Brazil we have few  python or django experts. Here in our local
> market there's lots of c# and Java programmers.
>
> It's easy to start a good quality job with juniors developers?
> I know that python and django  are both easy to learn.
>
> Please guys, I looking for responses based on great django experiences.
>
> Tanks a lot guys
> Ivo Marcelo Leonardi Zaniolo
> Sent from mobile
> imarcelolz.blogspot.com.br
>
> --
> 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.



How to deal with multiple foreign keys in child tables

2012-04-10 Thread Carlos Quiros
Hi,

I am new to DJango.

I have a database with three tables:

-CRP
   - SubComponents of a CRP
 - Objectives of a SubComponent of a CRP.

For this tables I created the following models:

-Model
Code
class period(models.Model):
period_code =
models.IntegerField(primary_key=True,verbose_name='Period code')
period_desc = models.CharField(max_length=45,verbose_name='Period
description')
period_current = models.IntegerField(verbose_name='Current period')
def __unicode__(self):
return self.period_desc
class Meta:
db_table = 'period'

class crp(models.Model):
crp_code =
models.CharField(max_length=3,primary_key=True,verbose_name='CRP
code')
crp_desc = models.CharField(max_length=45,verbose_name='CRP
description')
def __unicode__(self):
return self.crp_desc
class Meta:
db_table = 'crp'

class subcomponent(models.Model):
crp_code =
models.ForeignKey(crp,db_column='crp_code',related_name='subcomponent_crp_code',to_field='crp_code',primary_key=True,verbose_name='CRP
code')
subc_code =
models.CharField(max_length=3,primary_key=True,verbose_name='SubComponent
Code')
subc_desc = models.CharField(max_length=45,verbose_name='SubComponent
Description')
def __unicode__(self):
return self.subc_desc
class Meta:
db_table = 'subcomponent'


class objective(models.Model):
crp_code =
models.ForeignKey(subcomponent,db_column='crp_code',related_name='objective_crp_code',to_field='crp_code',primary_key=True,verbose_name='CRP
code')
subc_code =
models.ForeignKey(subcomponent,db_column='subc_code',related_name='objective_subc_code',to_field='subc_code',primary_key=True,verbose_name='SubComponent
Code')
obj_year =
models.ForeignKey(period,db_column='obj_year',related_name='objective_obj_year',to_field='period_code',primary_key=True,verbose_name='Objective
year')
obj_code =
models.CharField(max_length=7,primary_key=True,verbose_name='Objective
code')
obj_desc = models.CharField(max_length=45,verbose_name='Objective
description')
def __unicode__(self):
return self.obj_desc
class Meta:
db_table = 'objective'
-End model
code--

All works fine for the "subcomponent" model (reference to CRP); in the
administration of "subcomponent" the user can pull down a CRP and add
a subcomponent to it.

However, the model "objective" reference the model "subcomponent". In
the administration of "objective" I would like the user to pull down
and select a CRP, then filter the subcomponents of that CRP also in a
pull down list. How can I do this?

Many thanks,

Carlos.

-- 
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 for Enterprise

2012-04-10 Thread andrea mucci
hi ivo

maybe this is a problem for a tons of projects.
but you can solve putting your job request to:
http://www.python.org/community/jobs/

offer a good salary ( if you want a ferrari you need to pay for that )

or, ask to this comity if have some experienced dev that want to work for you ( 
maybe offer a telecommuting job )
a finally, ask if have some projects posted on github or bitbucket and if not 
if have some certified references for past jobs

cheers,
El 10/04/2012, a las 22:17, Ivo Marcelo Leonardi Zaniolo escribió:

> Tanks Andrea.
> 
> Maybe my biggest problem is to find good developers.
> 
> 
> Att
> Ivo Marcelo Leonardi Zaniolo
> Sent from mobile
> 
> On Apr 10, 2012 5:11 PM, "andrea mucci"  wrote:
> hi ivo
> 
> the problem is not if Django is a good framework for huge project, but if you 
> or your devs have experience to design and maintain some "big" projects.
> with python and django have a lot of projects with huge traffic or huge 
> database design, so i think is possible to create something very "strong"
>> Does anybody already worked on a really hudge project? 
>> 
>> 
> YES or NO, what do you mean for huge project
> with a lot of traffic?
> with different technologies?
> for a big customer?
> 
>> t's easy to start a good quality job with juniors developers?
>> 
> 
> NO
> 
>> I know that python and django  are both easy to learn.
>> 
> YES, but is not the reason for a good and fast code creation
> 
> 
> cheers,
> 
> El 10/04/2012, a las 21:50, Ivo Marcelo Leonardi Zaniolo escribió:
> 
>> Hi there, a got those  questions annoying me...
>> 
>> Is django ready to a hudge enterprise project?
>> I'm not talking of a website, it's more like an Erp.
>> 
>> Does anybody already worked on a really hudge project? 
>> A really hudge.
>> 
>> Here in Brazil we have few  python or django experts. Here in our local 
>> market there's lots of c# and Java programmers.
>> 
>> It's easy to start a good quality job with juniors developers? 
>> I know that python and django  are both easy to learn.
>> 
>> Please guys, I looking for responses based on great django experiences.
>> 
>> Tanks a lot guys 
>> Ivo Marcelo Leonardi Zaniolo
>> Sent from mobile 
>> imarcelolz.blogspot.com.br
>> 
>> 
>> -- 
>> 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: Django for Enterprise

2012-04-10 Thread Gabriel Gunderson
On Tue, Apr 10, 2012 at 1:50 PM, Ivo Marcelo Leonardi Zaniolo
 wrote:
> Does anybody already worked on a really hudge project?
> A really hudge.

Perhaps you've heard of Instagram. You know, the scrappy little Django
shop that just sold to Facebook for 1 *billion* dollars.

http://instagram-engineering.tumblr.com/post/13649370142/what-powers-instagram-hundreds-of-instances-dozens-of


Anyway, that's pretty huge.


Best,
Gabe

-- 
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.



[JOB] Urgent - PHP/Python Developer needed

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

Another urgent position has come up in our company, applicant needs to have
some experience with using Django but must also be comfortable with PHP
(our clients are a 50/50 split between PHP and Django).

--

Simplicity Media Ltd are an established UK company providing bespoke IT
solutions for a variety of clients across the globe.

We are currently looking for a flexible and diverse developer to maintain
and extend our existing PHP deployments.

Our solutions are high volume (peaking at around 5000 requests/minute),
with extremely large databases (400 million+ rows) and large content
servers (15TB+ of media files).

The successful candidate should have at least 2 years commercial
experience, be fluent OOP, and have a general understanding of what it
means to be a good programmer.

We're looking for a real person with real emotion, not a corporate robot -
and being a team player is absolutely critical. Our company attitude is
firm but fair, we encourage a healthy mixture of fun/work, and we even have
a 'NSFW' IRC channel!

Essential skills:
* PHP 5.x (OOP)
* MySQL
* Linux (Debian)
* Bash (shell/ssh etc)

Desired (non-essential) skills:
* MongoDB
* Redhat
* Percona
* Memcache
* Redis
* Python

Desired (non-essential) experience:
* CodeIgniter (PHP)
* TubeX (PHP)
* Django (Python)
* JIRA (Atlassian)
* Basecamp
* Zendesk
* Livechat

MINIMUM CRITERIA:
* MUST be able to work on either EST or GMT+0 timezone
* MUST be able to work 30+ hours a week.
* MUST be comfortable working on 18+ sites.
* MUST be fluent in written & spoken English

The position is full time, offering around $2000/month (roughly
£1200/month) for the right candidate - price/hours are negotiable.

This position MUST be filled by 15th April 2012.

When applying, please also include a cover note explaining why you feel you
would be suitable for this role.

-- 
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: [JOB] Urgent - PHP/Python Developer needed

2012-04-10 Thread Cal Leeming [Simplicity Media Ltd]
Sorry, small mistake on the posting, Django should have obviously been
under essential skills!

Cal

On Tue, Apr 10, 2012 at 9:31 PM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

> Hi all,
>
> Another urgent position has come up in our company, applicant needs to
> have some experience with using Django but must also be comfortable with
> PHP (our clients are a 50/50 split between PHP and Django).
>
> --
>
> Simplicity Media Ltd are an established UK company providing bespoke IT
> solutions for a variety of clients across the globe.
>
> We are currently looking for a flexible and diverse developer to maintain
> and extend our existing PHP deployments.
>
> Our solutions are high volume (peaking at around 5000 requests/minute),
> with extremely large databases (400 million+ rows) and large content
> servers (15TB+ of media files).
>
> The successful candidate should have at least 2 years commercial
> experience, be fluent OOP, and have a general understanding of what it
> means to be a good programmer.
>
> We're looking for a real person with real emotion, not a corporate robot -
> and being a team player is absolutely critical. Our company attitude is
> firm but fair, we encourage a healthy mixture of fun/work, and we even have
> a 'NSFW' IRC channel!
>
> Essential skills:
> * PHP 5.x (OOP)
> * MySQL
> * Linux (Debian)
> * Bash (shell/ssh etc)
>
> Desired (non-essential) skills:
> * MongoDB
> * Redhat
> * Percona
> * Memcache
> * Redis
> * Python
>
> Desired (non-essential) experience:
> * CodeIgniter (PHP)
> * TubeX (PHP)
> * Django (Python)
> * JIRA (Atlassian)
> * Basecamp
> * Zendesk
> * Livechat
>
> MINIMUM CRITERIA:
> * MUST be able to work on either EST or GMT+0 timezone
> * MUST be able to work 30+ hours a week.
> * MUST be comfortable working on 18+ sites.
> * MUST be fluent in written & spoken English
>
> The position is full time, offering around $2000/month (roughly
> £1200/month) for the right candidate - price/hours are negotiable.
>
> This position MUST be filled by 15th April 2012.
>
> When applying, please also include a cover note explaining why you feel
> you would be suitable for this role.
>
>
>

-- 
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: [JOB] Urgent - PHP/Python Developer needed

2012-04-10 Thread Marcin Tustin
You're urgently seeking a developer who will work fluently in two different
(server side) languages, and you're offering 14400 pounds? I wish you luck.

On Tue, Apr 10, 2012 at 21:31, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

> Hi all,
>
> Another urgent position has come up in our company, applicant needs to
> have some experience with using Django but must also be comfortable with
> PHP (our clients are a 50/50 split between PHP and Django).
>
> --
>
> Simplicity Media Ltd are an established UK company providing bespoke IT
> solutions for a variety of clients across the globe.
>
> We are currently looking for a flexible and diverse developer to maintain
> and extend our existing PHP deployments.
>
> Our solutions are high volume (peaking at around 5000 requests/minute),
> with extremely large databases (400 million+ rows) and large content
> servers (15TB+ of media files).
>
> The successful candidate should have at least 2 years commercial
> experience, be fluent OOP, and have a general understanding of what it
> means to be a good programmer.
>
> We're looking for a real person with real emotion, not a corporate robot -
> and being a team player is absolutely critical. Our company attitude is
> firm but fair, we encourage a healthy mixture of fun/work, and we even have
> a 'NSFW' IRC channel!
>
> Essential skills:
> * PHP 5.x (OOP)
> * MySQL
> * Linux (Debian)
> * Bash (shell/ssh etc)
>
> Desired (non-essential) skills:
> * MongoDB
> * Redhat
> * Percona
> * Memcache
> * Redis
> * Python
>
> Desired (non-essential) experience:
> * CodeIgniter (PHP)
> * TubeX (PHP)
> * Django (Python)
> * JIRA (Atlassian)
> * Basecamp
> * Zendesk
> * Livechat
>
> MINIMUM CRITERIA:
> * MUST be able to work on either EST or GMT+0 timezone
> * MUST be able to work 30+ hours a week.
> * MUST be comfortable working on 18+ sites.
> * MUST be fluent in written & spoken English
>
> The position is full time, offering around $2000/month (roughly
> £1200/month) for the right candidate - price/hours are negotiable.
>
> This position MUST be filled by 15th April 2012.
>
> When applying, please also include a cover note explaining why you feel
> you would be suitable for this role.
>
>
>  --
> 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.
>



-- 
Marcin Tustin
Tel: 07773 787 105

-- 
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: Urgent - PHP/Python Developer needed

2012-04-10 Thread waax
I'd like to +1 Marcin Tustin post. Good luck with your search for
right candidate.
Monthly salary you are giving for such a skill-set is roughly,
ridiculously small with best intentions.

Regards,
Nevio

On Apr 10, 10:34 pm, Marcin Tustin  wrote:
> You're urgently seeking a developer who will work fluently in two different
> (server side) languages, and you're offering 14400 pounds? I wish you luck.
>
> On Tue, Apr 10, 2012 at 21:31, Cal Leeming [Simplicity Media Ltd] <
>
>
>
>
>
>
>
>
>
> cal.leem...@simplicitymedialtd.co.uk> wrote:
> > Hi all,
>
> > Another urgent position has come up in our company, applicant needs to
> > have some experience with using Django but must also be comfortable with
> > PHP (our clients are a 50/50 split between PHP and Django).
>
> > --
>
> > Simplicity Media Ltd are an established UK company providing bespoke IT
> > solutions for a variety of clients across the globe.
>
> > We are currently looking for a flexible and diverse developer to maintain
> > and extend our existing PHP deployments.
>
> > Our solutions are high volume (peaking at around 5000 requests/minute),
> > with extremely large databases (400 million+ rows) and large content
> > servers (15TB+ of media files).
>
> > The successful candidate should have at least 2 years commercial
> > experience, be fluent OOP, and have a general understanding of what it
> > means to be a good programmer.
>
> > We're looking for a real person with real emotion, not a corporate robot -
> > and being a team player is absolutely critical. Our company attitude is
> > firm but fair, we encourage a healthy mixture of fun/work, and we even have
> > a 'NSFW' IRC channel!
>
> > Essential skills:
> > * PHP 5.x (OOP)
> > * MySQL
> > * Linux (Debian)
> > * Bash (shell/ssh etc)
>
> > Desired (non-essential) skills:
> > * MongoDB
> > * Redhat
> > * Percona
> > * Memcache
> > * Redis
> > * Python
>
> > Desired (non-essential) experience:
> > * CodeIgniter (PHP)
> > * TubeX (PHP)
> > * Django (Python)
> > * JIRA (Atlassian)
> > * Basecamp
> > * Zendesk
> > * Livechat
>
> > MINIMUM CRITERIA:
> > * MUST be able to work on either EST or GMT+0 timezone
> > * MUST be able to work 30+ hours a week.
> > * MUST be comfortable working on 18+ sites.
> > * MUST be fluent in written & spoken English
>
> > The position is full time, offering around $2000/month (roughly
> > £1200/month) for the right candidate - price/hours are negotiable.
>
> > This position MUST be filled by 15th April 2012.
>
> > When applying, please also include a cover note explaining why you feel
> > you would be suitable for this role.
>
> >  --
> > 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.
>
> --
> Marcin Tustin
> Tel: 07773 787 105

-- 
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: [JOB] Urgent - PHP/Python Developer needed

2012-04-10 Thread Christophe Pettus

On Apr 10, 2012, at 1:31 PM, Cal Leeming [Simplicity Media Ltd] wrote:

> * MUST be able to work 30+ hours a week.
> 
[...]

> The position is full time, offering around $2000/month (roughly £1200/month) 
> for the right candidate - price/hours are negotiable.

Just to be clear, assuming that the job is 30 hours per week, you are really 
offering $15.38 per hour?  That's roughly what a waiter in a mid-range San 
Francisco  restaurant makes, with tips.  If that really is your budget, you 
need to be looking at outsourcing companies, not a list like this one.

If that compensation was a typo, apologies!

--
-- Christophe Pettus
   x...@thebuild.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.



Re: [JOB] Urgent - PHP/Python Developer needed

2012-04-10 Thread Cal Leeming [Simplicity Media Ltd]
Thanks for the feedback.

Problem is - we do already have other full time developers on at
2000$/month (albeit for 130 hours, not 150), all of them with a varying
skill set across both languages - and our clients also have in-house
developers at roughly this same budget as well (both US and UK).

Sometimes we get great paying rates (like the £250-500/day one I posted
only a few weeks ago) for senior roles, but this role is considered junior
and therefore has a much lower budget.

Hope this makes sense.

Cal

On Tue, Apr 10, 2012 at 9:52 PM, Christophe Pettus  wrote:

>
> On Apr 10, 2012, at 1:31 PM, Cal Leeming [Simplicity Media Ltd] wrote:
>
> > * MUST be able to work 30+ hours a week.
> >
> [...]
>
> > The position is full time, offering around $2000/month (roughly
> £1200/month) for the right candidate - price/hours are negotiable.
>
> Just to be clear, assuming that the job is 30 hours per week, you are
> really offering $15.38 per hour?  That's roughly what a waiter in a
> mid-range San Francisco  restaurant makes, with tips.  If that really is
> your budget, you need to be looking at outsourcing companies, not a list
> like this one.
>
> If that compensation was a typo, apologies!
>
> --
> -- Christophe Pettus
>   x...@thebuild.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: [JOB] Urgent - PHP/Python Developer needed

2012-04-10 Thread Marcin Tustin
I must say I'm surprised - the last time I had a job that paid at that
level was my very first tech job, straight after A-levels.

You don't need to apologise or explain to us - my post was more to observe
that this doesn't seem like something that will get you CVs urgently.

On Tue, Apr 10, 2012 at 22:00, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

> Thanks for the feedback.
>
> Problem is - we do already have other full time developers on at
> 2000$/month (albeit for 130 hours, not 150), all of them with a varying
> skill set across both languages - and our clients also have in-house
> developers at roughly this same budget as well (both US and UK).
>
> Sometimes we get great paying rates (like the £250-500/day one I posted
> only a few weeks ago) for senior roles, but this role is considered junior
> and therefore has a much lower budget.
>
> Hope this makes sense.
>
> Cal
>
> On Tue, Apr 10, 2012 at 9:52 PM, Christophe Pettus wrote:
>
>>
>> On Apr 10, 2012, at 1:31 PM, Cal Leeming [Simplicity Media Ltd] wrote:
>>
>> > * MUST be able to work 30+ hours a week.
>> >
>> [...]
>>
>> > The position is full time, offering around $2000/month (roughly
>> £1200/month) for the right candidate - price/hours are negotiable.
>>
>> Just to be clear, assuming that the job is 30 hours per week, you are
>> really offering $15.38 per hour?  That's roughly what a waiter in a
>> mid-range San Francisco  restaurant makes, with tips.  If that really is
>> your budget, you need to be looking at outsourcing companies, not a list
>> like this one.
>>
>> If that compensation was a typo, apologies!
>>
>> --
>> -- Christophe Pettus
>>   x...@thebuild.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.
>



-- 
Marcin Tustin
Tel: 07773 787 105

-- 
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: [JOB] Urgent - PHP/Python Developer needed

2012-04-10 Thread andrea mucci
hi Cal

> Our solutions are high volume (peaking at around 5000 requests/minute), with 
> extremely large databases (400 million+ rows) and large content servers 
> (15TB+ of media files).

If you put in the hands of a junior dev this, your customer has to pay more for 
damages over wage offered
this is what makes no sense.

anyway, the fact that there is someone who has a salary so painful not exclude 
that the offer is a shit.

cheers,
El 10/04/2012, a las 22:31, Cal Leeming [Simplicity Media Ltd] escribió:

> Hi all,
> 
> Another urgent position has come up in our company, applicant needs to have 
> some experience with using Django but must also be comfortable with PHP (our 
> clients are a 50/50 split between PHP and Django).
> 
> --
> 
> Simplicity Media Ltd are an established UK company providing bespoke IT 
> solutions for a variety of clients across the globe.
> 
> We are currently looking for a flexible and diverse developer to maintain and 
> extend our existing PHP deployments.
> 
> Our solutions are high volume (peaking at around 5000 requests/minute), with 
> extremely large databases (400 million+ rows) and large content servers 
> (15TB+ of media files).
> 
> The successful candidate should have at least 2 years commercial experience, 
> be fluent OOP, and have a general understanding of what it means to be a good 
> programmer.
> 
> We're looking for a real person with real emotion, not a corporate robot - 
> and being a team player is absolutely critical. Our company attitude is firm 
> but fair, we encourage a healthy mixture of fun/work, and we even have a 
> 'NSFW' IRC channel!
> 
> Essential skills:
> * PHP 5.x (OOP)
> * MySQL
> * Linux (Debian)
> * Bash (shell/ssh etc)
> 
> Desired (non-essential) skills:
> * MongoDB
> * Redhat
> * Percona
> * Memcache
> * Redis
> * Python
> 
> Desired (non-essential) experience:
> * CodeIgniter (PHP)
> * TubeX (PHP)
> * Django (Python)
> * JIRA (Atlassian)
> * Basecamp
> * Zendesk
> * Livechat
> 
> MINIMUM CRITERIA:
> * MUST be able to work on either EST or GMT+0 timezone
> * MUST be able to work 30+ hours a week.
> * MUST be comfortable working on 18+ sites.
> * MUST be fluent in written & spoken English
> 
> The position is full time, offering around $2000/month (roughly £1200/month) 
> for the right candidate - price/hours are negotiable.
> 
> This position MUST be filled by 15th April 2012.
> 
> When applying, please also include a cover note explaining why you feel you 
> would be suitable for this role.
> 
> 
> -- 
> 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: Django tutorial

2012-04-10 Thread Ed McLaughlin
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add
'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '/usr/local/mysql/data/mysite',  #
Or path to database file if using sqlite3.
'USER': '',  # Not used with sqlite3.
'PASSWORD': '',  # Not used with sqlite3.
'HOST': '',  # Set to empty string for
localhost. Not used with sqlite3.
'PORT': '',  # Set to empty string for
default. Not used with sqlite3.
}
}

On Apr 10, 4:27 am, Ejah  wrote:
> Can you post the db part of your settings file?
>
> On 10 apr, 06:05, Ed McLaughlin  wrote:
>
>
>
>
>
>
>
> > _mysql.so is in there. When I try using sqlite I get this:
>
> > Eds-MacBook-Air:mysite3 edmclaugh76$ python manage.py syncdb
> > Traceback (most recent call last):
> >   File "manage.py", line 10, in 
> >     execute_from_command_line(sys.argv)
> >   File "/Library/Python/2.7/site-packages/django/core/management/
> > __init__.py", line 443, in execute_from_command_line
> >     utility.execute()
> >   File "/Library/Python/2.7/site-packages/django/core/management/
> > __init__.py", line 382, in execute
> >     self.fetch_command(subcommand).run_from_argv(self.argv)
> >   File "/Library/Python/2.7/site-packages/django/core/management/
> > base.py", line 196, in run_from_argv
> >     self.execute(*args, **options.__dict__)
> >   File "/Library/Python/2.7/site-packages/django/core/management/
> > base.py", line 232, in execute
> >     output = self.handle(*args, **options)
> >   File "/Library/Python/2.7/site-packages/django/core/management/
> > base.py", line 371, in handle
> >     return self.handle_noargs(**options)
> >   File "/Library/Python/2.7/site-packages/django/core/management/
> > commands/syncdb.py", line 57, in handle_noargs
> >     cursor = connection.cursor()
> >   File "/Library/Python/2.7/site-packages/django/db/backends/
> > __init__.py", line 306, in cursor
> >     cursor = self.make_debug_cursor(self._cursor())
> >   File "/Library/Python/2.7/site-packages/django/db/backends/sqlite3/
> > base.py", line 281, in _cursor
> >     self._sqlite_create_connection()
> >   File "/Library/Python/2.7/site-packages/django/db/backends/sqlite3/
> > base.py", line 271, in _sqlite_create_connection
> >     self.connection = Database.connect(**kwargs)
> > sqlite3.OperationalError: unable to open database file
>
> > Any ideas? I really appreciate the help!
>
> > On Apr 9, 10:16 pm, Mario Gudelj  wrote:
>
> > > Go to 
> > > /Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.7-inte
> > >  l.egg/
> > > on your Mac and see if _mysql.so is int there. You may need to re-install
> > > MySQL_python connector. Maybe this can 
> > > helphttp://www.brambraakman.com/blog/comments/installing_mysql_python_mys...
>
> > > Otherwise, you can always use SQlite for dev environment until you go to
> > > production. I find it a lot easier to manage.
>
> > > On 10 April 2012 10:54, Ed McLaughlin  wrote:
>
> > > > Hello! I am working through the Django tutorial (
> > > >https://docs.djangoproject.com/en/1.4/intro/tutorial01/) and I have
> > > > hit a roadblock in the 'database setup' portion of part 1. When I
> > > > enter the command 'python manage.py syncdb' I get the error below. I
> > > > believe I properly installed MySQL Community Server and mysqldb
> > > > Any help would be GREATLY appreciated.
>
> > > > Eds-MacBook-Air:mysite edmclaugh76$ python manage.py syncdb
> > > > Traceback (most recent call last):
> > > >  File "manage.py", line 10, in 
> > > >    execute_from_command_line(sys.argv)
> > > >  File "/Library/Python/2.7/site-packages/django/core/management/
> > > > __init__.py", line 443, in execute_from_command_line
> > > >    utility.execute()
> > > >  File "/Library/Python/2.7/site-packages/django/core/management/
> > > > __init__.py", line 382, in execute
> > > >    self.fetch_command(subcommand).run_from_argv(self.argv)
> > > >  File "/Library/Python/2.7/site-packages/django/core/management/
> > > > __init__.py", line 261, in fetch_command
> > > >    klass = load_command_class(app_name, subcommand)
> > > >  File "/Library/Python/2.7/site-packages/django/core/management/
> > > > __init__.py", line 69, in load_command_class
> > > >    module = import_module('%s.management.commands.%s' % (app_name,
> > > > name))
> > > >  File "/Library/Python/2.7/site-packages/django/utils/importlib.py",
> > > > line 35, in import_module
> > > >    __import__(name)
> > > >  File "/Library/Python/2.7/site-packages/django/core/management/
> > > > commands/syncdb.py", line 8, in 
> > > >    from django.core.management.sql import custom_sql_for_model,
> > > > emit_post_sync_signal
> > > >  File "/Library/Python/2.7/site-packages/django/core/management/
> > > > sql.py", line 6, in 
> > > >    from django.db import models
> > > >  File "/Library/Python/2.7/site-packages/django/db/__init__.p

Re: [JOB] Urgent - PHP/Python Developer needed

2012-04-10 Thread Cal Leeming [Simplicity Media Ltd]
On Tue, Apr 10, 2012 at 10:12 PM, andrea mucci  wrote:

> hi Cal
>
> Our solutions are high volume (peaking at around 5000 requests/minute),
> with extremely large databases (400 million+ rows) and large content
> servers (15TB+ of media files).
>
>
> If you put in the hands of a junior dev this, your customer has to pay
> more for damages over wage offered
> this is what makes no sense.
>

Not necessarily, you don't throw junior devs into the production
environment - that's just silly :)

See, we deal a lot with students and interns, so we already have the
structure in place to train people on the job, slowly introduce them into
sensitive/complex systems etc.

Everyone's got to start somewhere!


>
> anyway, the fact that there is someone who has a salary so painful not
> exclude that the offer is a shit.
>

No need for bad language


>
> cheers,
> El 10/04/2012, a las 22:31, Cal Leeming [Simplicity Media Ltd] escribió:
>
> Hi all,
>
> Another urgent position has come up in our company, applicant needs to
> have some experience with using Django but must also be comfortable with
> PHP (our clients are a 50/50 split between PHP and Django).
>
> --
>
> Simplicity Media Ltd are an established UK company providing bespoke IT
> solutions for a variety of clients across the globe.
>
> We are currently looking for a flexible and diverse developer to maintain
> and extend our existing PHP deployments.
>
> Our solutions are high volume (peaking at around 5000 requests/minute),
> with extremely large databases (400 million+ rows) and large content
> servers (15TB+ of media files).
>
> The successful candidate should have at least 2 years commercial
> experience, be fluent OOP, and have a general understanding of what it
> means to be a good programmer.
>
> We're looking for a real person with real emotion, not a corporate robot -
> and being a team player is absolutely critical. Our company attitude is
> firm but fair, we encourage a healthy mixture of fun/work, and we even have
> a 'NSFW' IRC channel!
>
> Essential skills:
> * PHP 5.x (OOP)
> * MySQL
> * Linux (Debian)
> * Bash (shell/ssh etc)
>
> Desired (non-essential) skills:
> * MongoDB
> * Redhat
> * Percona
> * Memcache
> * Redis
> * Python
>
> Desired (non-essential) experience:
> * CodeIgniter (PHP)
> * TubeX (PHP)
> * Django (Python)
> * JIRA (Atlassian)
> * Basecamp
> * Zendesk
> * Livechat
>
> MINIMUM CRITERIA:
> * MUST be able to work on either EST or GMT+0 timezone
> * MUST be able to work 30+ hours a week.
> * MUST be comfortable working on 18+ sites.
> * MUST be fluent in written & spoken English
>
> The position is full time, offering around $2000/month (roughly
> £1200/month) for the right candidate - price/hours are negotiable.
>
> This position MUST be filled by 15th April 2012.
>
> When applying, please also include a cover note explaining why you feel
> you would be suitable for this role.
>
>
>
> --
> 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: [JOB] Urgent - PHP/Python Developer needed

2012-04-10 Thread andrea mucci
hi cal

ok,
so, you can re-write your offer asking for a junior dev, inexperienced or less 
experienced and for example, if your customer offer courses, certifications or 
something like this.
this make sense and you will get more resumes and better answers.

i restructure my last sentence
> anyway, the fact that there is someone who has a salary so painful not 
> exclude that the offer is "bad"

cheers,
El 10/04/2012, a las 23:18, Cal Leeming [Simplicity Media Ltd] escribió:

> 
> 
> On Tue, Apr 10, 2012 at 10:12 PM, andrea mucci  wrote:
> hi Cal
> 
>> Our solutions are high volume (peaking at around 5000 requests/minute), with 
>> extremely large databases (400 million+ rows) and large content servers 
>> (15TB+ of media files).
> 
> 
> If you put in the hands of a junior dev this, your customer has to pay more 
> for damages over wage offered
> this is what makes no sense.
> 
> Not necessarily, you don't throw junior devs into the production environment 
> - that's just silly :)
> 
> See, we deal a lot with students and interns, so we already have the 
> structure in place to train people on the job, slowly introduce them into 
> sensitive/complex systems etc.
> 
> Everyone's got to start somewhere!
>  
> 
> anyway, the fact that there is someone who has a salary so painful not 
> exclude that the offer is a shit.
> 
> No need for bad language
>  
> 
> cheers,
> El 10/04/2012, a las 22:31, Cal Leeming [Simplicity Media Ltd] escribió:
> 
>> Hi all,
>> 
>> Another urgent position has come up in our company, applicant needs to have 
>> some experience with using Django but must also be comfortable with PHP (our 
>> clients are a 50/50 split between PHP and Django).
>> 
>> --
>> 
>> Simplicity Media Ltd are an established UK company providing bespoke IT 
>> solutions for a variety of clients across the globe.
>> 
>> We are currently looking for a flexible and diverse developer to maintain 
>> and extend our existing PHP deployments.
>> 
>> Our solutions are high volume (peaking at around 5000 requests/minute), with 
>> extremely large databases (400 million+ rows) and large content servers 
>> (15TB+ of media files).
>> 
>> The successful candidate should have at least 2 years commercial experience, 
>> be fluent OOP, and have a general understanding of what it means to be a 
>> good programmer.
>> 
>> We're looking for a real person with real emotion, not a corporate robot - 
>> and being a team player is absolutely critical. Our company attitude is firm 
>> but fair, we encourage a healthy mixture of fun/work, and we even have a 
>> 'NSFW' IRC channel!
>> 
>> Essential skills:
>> * PHP 5.x (OOP)
>> * MySQL
>> * Linux (Debian)
>> * Bash (shell/ssh etc)
>> 
>> Desired (non-essential) skills:
>> * MongoDB
>> * Redhat
>> * Percona
>> * Memcache
>> * Redis
>> * Python
>> 
>> Desired (non-essential) experience:
>> * CodeIgniter (PHP)
>> * TubeX (PHP)
>> * Django (Python)
>> * JIRA (Atlassian)
>> * Basecamp
>> * Zendesk
>> * Livechat
>> 
>> MINIMUM CRITERIA:
>> * MUST be able to work on either EST or GMT+0 timezone
>> * MUST be able to work 30+ hours a week.
>> * MUST be comfortable working on 18+ sites.
>> * MUST be fluent in written & spoken English
>> 
>> The position is full time, offering around $2000/month (roughly £1200/month) 
>> for the right candidate - price/hours are negotiable.
>> 
>> This position MUST be filled by 15th April 2012.
>> 
>> When applying, please also include a cover note explaining why you feel you 
>> would be suitable for this role.
>> 
>> 
>> -- 
>> 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: Django tutorial

2012-04-10 Thread Daniel Roseman
On Tuesday, 10 April 2012 22:15:40 UTC+1, Ed McLaughlin wrote:
>
> DATABASES = { 
> 'default': { 
> 'ENGINE': 'django.db.backends.sqlite3', # Add 
> 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 
> 'NAME': '/usr/local/mysql/data/mysite',  # 
> Or path to database file if using sqlite3. 
> 'USER': '',  # Not used with sqlite3. 
> 'PASSWORD': '',  # Not used with sqlite3. 
> 'HOST': '',  # Set to empty string for 
> localhost. Not used with sqlite3. 
> 'PORT': '',  # Set to empty string for 
> default. Not used with sqlite3. 
> } 
> } 
>

You haven't given the path to a file in the NAME value, as requested - 
you've given the path to a directory.
--
DR.

-- 
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/-/R4t7qhr__mMJ.
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 tutorial

2012-04-10 Thread andrea mucci
hi Ed

you have configured the DB with the sqlite3 driver and you point the NAME db to 
a mysql folder.
you need to put the folder for your sqlite database.
cheers,
El 10/04/2012, a las 23:15, Ed McLaughlin escribió:

> DATABASES = {
>'default': {
>'ENGINE': 'django.db.backends.sqlite3', # Add
> 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
>'NAME': '/usr/local/mysql/data/mysite',  #
> Or path to database file if using sqlite3.
>'USER': '',  # Not used with sqlite3.
>'PASSWORD': '',  # Not used with sqlite3.
>'HOST': '',  # Set to empty string for
> localhost. Not used with sqlite3.
>'PORT': '',  # Set to empty string for
> default. Not used with sqlite3.
>}
> }
> 
> On Apr 10, 4:27 am, Ejah  wrote:
>> Can you post the db part of your settings file?
>> 
>> On 10 apr, 06:05, Ed McLaughlin  wrote:
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> _mysql.so is in there. When I try using sqlite I get this:
>> 
>>> Eds-MacBook-Air:mysite3 edmclaugh76$ python manage.py syncdb
>>> Traceback (most recent call last):
>>>   File "manage.py", line 10, in 
>>> execute_from_command_line(sys.argv)
>>>   File "/Library/Python/2.7/site-packages/django/core/management/
>>> __init__.py", line 443, in execute_from_command_line
>>> utility.execute()
>>>   File "/Library/Python/2.7/site-packages/django/core/management/
>>> __init__.py", line 382, in execute
>>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>>   File "/Library/Python/2.7/site-packages/django/core/management/
>>> base.py", line 196, in run_from_argv
>>> self.execute(*args, **options.__dict__)
>>>   File "/Library/Python/2.7/site-packages/django/core/management/
>>> base.py", line 232, in execute
>>> output = self.handle(*args, **options)
>>>   File "/Library/Python/2.7/site-packages/django/core/management/
>>> base.py", line 371, in handle
>>> return self.handle_noargs(**options)
>>>   File "/Library/Python/2.7/site-packages/django/core/management/
>>> commands/syncdb.py", line 57, in handle_noargs
>>> cursor = connection.cursor()
>>>   File "/Library/Python/2.7/site-packages/django/db/backends/
>>> __init__.py", line 306, in cursor
>>> cursor = self.make_debug_cursor(self._cursor())
>>>   File "/Library/Python/2.7/site-packages/django/db/backends/sqlite3/
>>> base.py", line 281, in _cursor
>>> self._sqlite_create_connection()
>>>   File "/Library/Python/2.7/site-packages/django/db/backends/sqlite3/
>>> base.py", line 271, in _sqlite_create_connection
>>> self.connection = Database.connect(**kwargs)
>>> sqlite3.OperationalError: unable to open database file
>> 
>>> Any ideas? I really appreciate the help!
>> 
>>> On Apr 9, 10:16 pm, Mario Gudelj  wrote:
>> 
 Go to 
 /Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.7-inte
  l.egg/
 on your Mac and see if _mysql.so is int there. You may need to re-install
 MySQL_python connector. Maybe this can 
 helphttp://www.brambraakman.com/blog/comments/installing_mysql_python_mys...
>> 
 Otherwise, you can always use SQlite for dev environment until you go to
 production. I find it a lot easier to manage.
>> 
 On 10 April 2012 10:54, Ed McLaughlin  wrote:
>> 
> Hello! I am working through the Django tutorial (
> https://docs.djangoproject.com/en/1.4/intro/tutorial01/) and I have
> hit a roadblock in the 'database setup' portion of part 1. When I
> enter the command 'python manage.py syncdb' I get the error below. I
> believe I properly installed MySQL Community Server and mysqldb
> Any help would be GREATLY appreciated.
>> 
> Eds-MacBook-Air:mysite edmclaugh76$ python manage.py syncdb
> Traceback (most recent call last):
>  File "manage.py", line 10, in 
>execute_from_command_line(sys.argv)
>  File "/Library/Python/2.7/site-packages/django/core/management/
> __init__.py", line 443, in execute_from_command_line
>utility.execute()
>  File "/Library/Python/2.7/site-packages/django/core/management/
> __init__.py", line 382, in execute
>self.fetch_command(subcommand).run_from_argv(self.argv)
>  File "/Library/Python/2.7/site-packages/django/core/management/
> __init__.py", line 261, in fetch_command
>klass = load_command_class(app_name, subcommand)
>  File "/Library/Python/2.7/site-packages/django/core/management/
> __init__.py", line 69, in load_command_class
>module = import_module('%s.management.commands.%s' % (app_name,
> name))
>  File "/Library/Python/2.7/site-packages/django/utils/importlib.py",
> line 35, in import_module
>__import__(name)
>  File "/Library/Python/2.7/site-packages/django/core/management/
> commands/syncdb.py", line 8, in 
>from django.core.management.sql import custom_sql_for_model,
> emit_post_sync_signal
>>>

Re: [JOB] Urgent - PHP/Python Developer needed

2012-04-10 Thread Cal Leeming [Simplicity Media Ltd]
On Tue, Apr 10, 2012 at 10:26 PM, andrea mucci  wrote:

> hi cal
>
> ok,
> so, you can re-write your offer asking for a junior dev, inexperienced or
> less experienced and for example, if your customer offer courses,
> certifications or something like this.
> this make sense and you will get more resumes and better answers.
>

That's a good point tbh, I'll ask one of the sales guys to spice it up a
little bit.


>
> i restructure my last sentence
>
> anyway, the fact that there is someone who has a salary so painful not
>> exclude that the offer is "bad"
>>
> :)


>
> cheers,
> El 10/04/2012, a las 23:18, Cal Leeming [Simplicity Media Ltd] escribió:
>
>
>
> On Tue, Apr 10, 2012 at 10:12 PM, andrea mucci wrote:
>
>> hi Cal
>>
>> Our solutions are high volume (peaking at around 5000 requests/minute),
>> with extremely large databases (400 million+ rows) and large content
>> servers (15TB+ of media files).
>>
>>
>> If you put in the hands of a junior dev this, your customer has to pay
>> more for damages over wage offered
>> this is what makes no sense.
>>
>
> Not necessarily, you don't throw junior devs into the production
> environment - that's just silly :)
>
> See, we deal a lot with students and interns, so we already have the
> structure in place to train people on the job, slowly introduce them into
> sensitive/complex systems etc.
>
> Everyone's got to start somewhere!
>
>
>>
>> anyway, the fact that there is someone who has a salary so painful not
>> exclude that the offer is a shit.
>>
>
> No need for bad language
>
>
>>
>> cheers,
>> El 10/04/2012, a las 22:31, Cal Leeming [Simplicity Media Ltd] escribió:
>>
>> Hi all,
>>
>> Another urgent position has come up in our company, applicant needs to
>> have some experience with using Django but must also be comfortable with
>> PHP (our clients are a 50/50 split between PHP and Django).
>>
>> --
>>
>> Simplicity Media Ltd are an established UK company providing bespoke IT
>> solutions for a variety of clients across the globe.
>>
>> We are currently looking for a flexible and diverse developer to maintain
>> and extend our existing PHP deployments.
>>
>> Our solutions are high volume (peaking at around 5000 requests/minute),
>> with extremely large databases (400 million+ rows) and large content
>> servers (15TB+ of media files).
>>
>> The successful candidate should have at least 2 years commercial
>> experience, be fluent OOP, and have a general understanding of what it
>> means to be a good programmer.
>>
>> We're looking for a real person with real emotion, not a corporate robot
>> - and being a team player is absolutely critical. Our company attitude is
>> firm but fair, we encourage a healthy mixture of fun/work, and we even have
>> a 'NSFW' IRC channel!
>>
>> Essential skills:
>> * PHP 5.x (OOP)
>> * MySQL
>> * Linux (Debian)
>> * Bash (shell/ssh etc)
>>
>> Desired (non-essential) skills:
>> * MongoDB
>> * Redhat
>> * Percona
>> * Memcache
>> * Redis
>> * Python
>>
>> Desired (non-essential) experience:
>> * CodeIgniter (PHP)
>> * TubeX (PHP)
>> * Django (Python)
>> * JIRA (Atlassian)
>> * Basecamp
>> * Zendesk
>> * Livechat
>>
>> MINIMUM CRITERIA:
>> * MUST be able to work on either EST or GMT+0 timezone
>> * MUST be able to work 30+ hours a week.
>> * MUST be comfortable working on 18+ sites.
>> * MUST be fluent in written & spoken English
>>
>> The position is full time, offering around $2000/month (roughly
>> £1200/month) for the right candidate - price/hours are negotiable.
>>
>> This position MUST be filled by 15th April 2012.
>>
>> When applying, please also include a cover note explaining why you feel
>> you would be suitable for this role.
>>
>>
>>
>> --
>> 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

Re: Django tutorial

2012-04-10 Thread william ratcliff
Can you try creating a file in that directory at the top of your
settings.py file?
On Apr 10, 2012 5:15 PM, "Ed McLaughlin"  wrote:

> DATABASES = {
>'default': {
>'ENGINE': 'django.db.backends.sqlite3', # Add
> 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
>'NAME': '/usr/local/mysql/data/mysite',  #
> Or path to database file if using sqlite3.
>'USER': '',  # Not used with sqlite3.
>'PASSWORD': '',  # Not used with sqlite3.
>'HOST': '',  # Set to empty string for
> localhost. Not used with sqlite3.
>'PORT': '',  # Set to empty string for
> default. Not used with sqlite3.
>}
> }
>
> On Apr 10, 4:27 am, Ejah  wrote:
> > Can you post the db part of your settings file?
> >
> > On 10 apr, 06:05, Ed McLaughlin  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > _mysql.so is in there. When I try using sqlite I get this:
> >
> > > Eds-MacBook-Air:mysite3 edmclaugh76$ python manage.py syncdb
> > > Traceback (most recent call last):
> > >   File "manage.py", line 10, in 
> > > execute_from_command_line(sys.argv)
> > >   File "/Library/Python/2.7/site-packages/django/core/management/
> > > __init__.py", line 443, in execute_from_command_line
> > > utility.execute()
> > >   File "/Library/Python/2.7/site-packages/django/core/management/
> > > __init__.py", line 382, in execute
> > > self.fetch_command(subcommand).run_from_argv(self.argv)
> > >   File "/Library/Python/2.7/site-packages/django/core/management/
> > > base.py", line 196, in run_from_argv
> > > self.execute(*args, **options.__dict__)
> > >   File "/Library/Python/2.7/site-packages/django/core/management/
> > > base.py", line 232, in execute
> > > output = self.handle(*args, **options)
> > >   File "/Library/Python/2.7/site-packages/django/core/management/
> > > base.py", line 371, in handle
> > > return self.handle_noargs(**options)
> > >   File "/Library/Python/2.7/site-packages/django/core/management/
> > > commands/syncdb.py", line 57, in handle_noargs
> > > cursor = connection.cursor()
> > >   File "/Library/Python/2.7/site-packages/django/db/backends/
> > > __init__.py", line 306, in cursor
> > > cursor = self.make_debug_cursor(self._cursor())
> > >   File "/Library/Python/2.7/site-packages/django/db/backends/sqlite3/
> > > base.py", line 281, in _cursor
> > > self._sqlite_create_connection()
> > >   File "/Library/Python/2.7/site-packages/django/db/backends/sqlite3/
> > > base.py", line 271, in _sqlite_create_connection
> > > self.connection = Database.connect(**kwargs)
> > > sqlite3.OperationalError: unable to open database file
> >
> > > Any ideas? I really appreciate the help!
> >
> > > On Apr 9, 10:16 pm, Mario Gudelj  wrote:
> >
> > > > Go to
> /Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.7-inte
> l.egg/
> > > > on your Mac and see if _mysql.so is int there. You may need to
> re-install
> > > > MySQL_python connector. Maybe this can helphttp://
> www.brambraakman.com/blog/comments/installing_mysql_python_mys...
> >
> > > > Otherwise, you can always use SQlite for dev environment until you
> go to
> > > > production. I find it a lot easier to manage.
> >
> > > > On 10 April 2012 10:54, Ed McLaughlin  wrote:
> >
> > > > > Hello! I am working through the Django tutorial (
> > > > >https://docs.djangoproject.com/en/1.4/intro/tutorial01/) and I have
> > > > > hit a roadblock in the 'database setup' portion of part 1. When I
> > > > > enter the command 'python manage.py syncdb' I get the error below.
> I
> > > > > believe I properly installed MySQL Community Server and mysqldb
> > > > > Any help would be GREATLY appreciated.
> >
> > > > > Eds-MacBook-Air:mysite edmclaugh76$ python manage.py syncdb
> > > > > Traceback (most recent call last):
> > > > >  File "manage.py", line 10, in 
> > > > >execute_from_command_line(sys.argv)
> > > > >  File "/Library/Python/2.7/site-packages/django/core/management/
> > > > > __init__.py", line 443, in execute_from_command_line
> > > > >utility.execute()
> > > > >  File "/Library/Python/2.7/site-packages/django/core/management/
> > > > > __init__.py", line 382, in execute
> > > > >self.fetch_command(subcommand).run_from_argv(self.argv)
> > > > >  File "/Library/Python/2.7/site-packages/django/core/management/
> > > > > __init__.py", line 261, in fetch_command
> > > > >klass = load_command_class(app_name, subcommand)
> > > > >  File "/Library/Python/2.7/site-packages/django/core/management/
> > > > > __init__.py", line 69, in load_command_class
> > > > >module = import_module('%s.management.commands.%s' % (app_name,
> > > > > name))
> > > > >  File
> "/Library/Python/2.7/site-packages/django/utils/importlib.py",
> > > > > line 35, in import_module
> > > > >__import__(name)
> > > > >  File "/Library/Python/2.7/site-packages/django/core/management/
> > > > > commands/syncdb.py", l

Re: Django tutorial

2012-04-10 Thread william ratcliff
If mysite is a directory, rather than a file, then Daniel is correct.
On Apr 10, 2012 5:33 PM, "andrea mucci"  wrote:

> hi Ed
>
> you have configured the DB with the sqlite3 driver and you point the NAME
> db to a mysql folder.
> you need to put the folder for your sqlite database.
> cheers,
> El 10/04/2012, a las 23:15, Ed McLaughlin escribió:
>
> > DATABASES = {
> >'default': {
> >'ENGINE': 'django.db.backends.sqlite3', # Add
> > 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
> >'NAME': '/usr/local/mysql/data/mysite',  #
> > Or path to database file if using sqlite3.
> >'USER': '',  # Not used with sqlite3.
> >'PASSWORD': '',  # Not used with sqlite3.
> >'HOST': '',  # Set to empty string for
> > localhost. Not used with sqlite3.
> >'PORT': '',  # Set to empty string for
> > default. Not used with sqlite3.
> >}
> > }
> >
> > On Apr 10, 4:27 am, Ejah  wrote:
> >> Can you post the db part of your settings file?
> >>
> >> On 10 apr, 06:05, Ed McLaughlin  wrote:
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>> _mysql.so is in there. When I try using sqlite I get this:
> >>
> >>> Eds-MacBook-Air:mysite3 edmclaugh76$ python manage.py syncdb
> >>> Traceback (most recent call last):
> >>>   File "manage.py", line 10, in 
> >>> execute_from_command_line(sys.argv)
> >>>   File "/Library/Python/2.7/site-packages/django/core/management/
> >>> __init__.py", line 443, in execute_from_command_line
> >>> utility.execute()
> >>>   File "/Library/Python/2.7/site-packages/django/core/management/
> >>> __init__.py", line 382, in execute
> >>> self.fetch_command(subcommand).run_from_argv(self.argv)
> >>>   File "/Library/Python/2.7/site-packages/django/core/management/
> >>> base.py", line 196, in run_from_argv
> >>> self.execute(*args, **options.__dict__)
> >>>   File "/Library/Python/2.7/site-packages/django/core/management/
> >>> base.py", line 232, in execute
> >>> output = self.handle(*args, **options)
> >>>   File "/Library/Python/2.7/site-packages/django/core/management/
> >>> base.py", line 371, in handle
> >>> return self.handle_noargs(**options)
> >>>   File "/Library/Python/2.7/site-packages/django/core/management/
> >>> commands/syncdb.py", line 57, in handle_noargs
> >>> cursor = connection.cursor()
> >>>   File "/Library/Python/2.7/site-packages/django/db/backends/
> >>> __init__.py", line 306, in cursor
> >>> cursor = self.make_debug_cursor(self._cursor())
> >>>   File "/Library/Python/2.7/site-packages/django/db/backends/sqlite3/
> >>> base.py", line 281, in _cursor
> >>> self._sqlite_create_connection()
> >>>   File "/Library/Python/2.7/site-packages/django/db/backends/sqlite3/
> >>> base.py", line 271, in _sqlite_create_connection
> >>> self.connection = Database.connect(**kwargs)
> >>> sqlite3.OperationalError: unable to open database file
> >>
> >>> Any ideas? I really appreciate the help!
> >>
> >>> On Apr 9, 10:16 pm, Mario Gudelj  wrote:
> >>
>  Go to
> /Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.7-inte
> l.egg/
>  on your Mac and see if _mysql.so is int there. You may need to
> re-install
>  MySQL_python connector. Maybe this can helphttp://
> www.brambraakman.com/blog/comments/installing_mysql_python_mys...
> >>
>  Otherwise, you can always use SQlite for dev environment until you go
> to
>  production. I find it a lot easier to manage.
> >>
>  On 10 April 2012 10:54, Ed McLaughlin  wrote:
> >>
> > Hello! I am working through the Django tutorial (
> > https://docs.djangoproject.com/en/1.4/intro/tutorial01/) and I have
> > hit a roadblock in the 'database setup' portion of part 1. When I
> > enter the command 'python manage.py syncdb' I get the error below. I
> > believe I properly installed MySQL Community Server and mysqldb
> > Any help would be GREATLY appreciated.
> >>
> > Eds-MacBook-Air:mysite edmclaugh76$ python manage.py syncdb
> > Traceback (most recent call last):
> >  File "manage.py", line 10, in 
> >execute_from_command_line(sys.argv)
> >  File "/Library/Python/2.7/site-packages/django/core/management/
> > __init__.py", line 443, in execute_from_command_line
> >utility.execute()
> >  File "/Library/Python/2.7/site-packages/django/core/management/
> > __init__.py", line 382, in execute
> >self.fetch_command(subcommand).run_from_argv(self.argv)
> >  File "/Library/Python/2.7/site-packages/django/core/management/
> > __init__.py", line 261, in fetch_command
> >klass = load_command_class(app_name, subcommand)
> >  File "/Library/Python/2.7/site-packages/django/core/management/
> > __init__.py", line 69, in load_command_class
> >module = import_module('%s.management.commands.%s' % (app_name,
> > name))
> >  File "/Library/Python/2.7/site-

Re: Django tutorial

2012-04-10 Thread andrea mucci
a good solution could be:

SITE_ROOT = os.path.realpath(os.path.dirname(__file__))

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 
'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': os.path.join(SITE_ROOT,'sqlite.db'),  # Or 
path to database file if using sqlite3.
'USER': '',  # Not used with sqlite3.
'PASSWORD': '',  # Not used with sqlite3.
'HOST': '',  # Set to empty string for localhost. 
Not used with sqlite3.
'PORT': '',  # Set to empty string for default. Not 
used with sqlite3.
}
}

El 10/04/2012, a las 23:34, william ratcliff escribió:

> Can you try creating a file in that directory at the top of your settings.py 
> file? 
> 
> On Apr 10, 2012 5:15 PM, "Ed McLaughlin"  wrote:
> DATABASES = {
>'default': {
>'ENGINE': 'django.db.backends.sqlite3', # Add
> 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
>'NAME': '/usr/local/mysql/data/mysite',  #
> Or path to database file if using sqlite3.
>'USER': '',  # Not used with sqlite3.
>'PASSWORD': '',  # Not used with sqlite3.
>'HOST': '',  # Set to empty string for
> localhost. Not used with sqlite3.
>'PORT': '',  # Set to empty string for
> default. Not used with sqlite3.
>}
> }
> 
> On Apr 10, 4:27 am, Ejah  wrote:
> > Can you post the db part of your settings file?
> >
> > On 10 apr, 06:05, Ed McLaughlin  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > _mysql.so is in there. When I try using sqlite I get this:
> >
> > > Eds-MacBook-Air:mysite3 edmclaugh76$ python manage.py syncdb
> > > Traceback (most recent call last):
> > >   File "manage.py", line 10, in 
> > > execute_from_command_line(sys.argv)
> > >   File "/Library/Python/2.7/site-packages/django/core/management/
> > > __init__.py", line 443, in execute_from_command_line
> > > utility.execute()
> > >   File "/Library/Python/2.7/site-packages/django/core/management/
> > > __init__.py", line 382, in execute
> > > self.fetch_command(subcommand).run_from_argv(self.argv)
> > >   File "/Library/Python/2.7/site-packages/django/core/management/
> > > base.py", line 196, in run_from_argv
> > > self.execute(*args, **options.__dict__)
> > >   File "/Library/Python/2.7/site-packages/django/core/management/
> > > base.py", line 232, in execute
> > > output = self.handle(*args, **options)
> > >   File "/Library/Python/2.7/site-packages/django/core/management/
> > > base.py", line 371, in handle
> > > return self.handle_noargs(**options)
> > >   File "/Library/Python/2.7/site-packages/django/core/management/
> > > commands/syncdb.py", line 57, in handle_noargs
> > > cursor = connection.cursor()
> > >   File "/Library/Python/2.7/site-packages/django/db/backends/
> > > __init__.py", line 306, in cursor
> > > cursor = self.make_debug_cursor(self._cursor())
> > >   File "/Library/Python/2.7/site-packages/django/db/backends/sqlite3/
> > > base.py", line 281, in _cursor
> > > self._sqlite_create_connection()
> > >   File "/Library/Python/2.7/site-packages/django/db/backends/sqlite3/
> > > base.py", line 271, in _sqlite_create_connection
> > > self.connection = Database.connect(**kwargs)
> > > sqlite3.OperationalError: unable to open database file
> >
> > > Any ideas? I really appreciate the help!
> >
> > > On Apr 9, 10:16 pm, Mario Gudelj  wrote:
> >
> > > > Go to 
> > > > /Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.7-inte
> > > >  l.egg/
> > > > on your Mac and see if _mysql.so is int there. You may need to 
> > > > re-install
> > > > MySQL_python connector. Maybe this can 
> > > > helphttp://www.brambraakman.com/blog/comments/installing_mysql_python_mys...
> >
> > > > Otherwise, you can always use SQlite for dev environment until you go to
> > > > production. I find it a lot easier to manage.
> >
> > > > On 10 April 2012 10:54, Ed McLaughlin  wrote:
> >
> > > > > Hello! I am working through the Django tutorial (
> > > > >https://docs.djangoproject.com/en/1.4/intro/tutorial01/) and I have
> > > > > hit a roadblock in the 'database setup' portion of part 1. When I
> > > > > enter the command 'python manage.py syncdb' I get the error below. I
> > > > > believe I properly installed MySQL Community Server and mysqldb
> > > > > Any help would be GREATLY appreciated.
> >
> > > > > Eds-MacBook-Air:mysite edmclaugh76$ python manage.py syncdb
> > > > > Traceback (most recent call last):
> > > > >  File "manage.py", line 10, in 
> > > > >execute_from_command_line(sys.argv)
> > > > >  File "/Library/Python/2.7/site-packages/django/core/management/
> > > > > __init__.py", line 443, in execute_from_command_line
> > > > >utility.execute()
> > > > >  File "/Library/Python/2.7/site-packages/django/core/

Template inheritance and passing variables

2012-04-10 Thread bnkwsk
Hi,
while writing my first website in Django I ran into troubles with
passing variables in my inherited templates. Let me describe my
templates' structure.

I have a base template for all applications' templates which includes
some parts - just to divide the code into smaller parts.

My goal is to pass a variable (which will be different for every view
in every app) to a template included in base template (which is
inherited by my app's view's templates). I considered using a custom
context processor but since every view will have its own value of the
variable, it seems to be a bad idea.

-- base.html --


{% include "base_head.html" %}


{% include "base_login.html" %}

{% include "base_header.html" %}

{% include "base_menu.html" %}

{% block content %}
Default content...
{% endblock %}

{% include "base_footer.html" %}


---

-- base_footer.html ---
{{ app_variable }}




Link
Link
Link



---

Now, in one of my app's view I set the app_variable and render the
app's template.

-- views.py ---
def read(request, news_id):
news = get_object_or_404(News, pk = news_id)

app_variable = 'foo'

return render_to_response('news_read.html', { 'news': news,
'app_variable': app_variable }, context_instance =
RequestContext(request))
---

-- news_read.html -
{% extends "base.html" %}

{% block content %}

{{ news.title }}

{{ news.introduction|safe }}

{{ news.content|safe }}

{% endblock %}}
---

Now, what should I do in order to have the app_variable in base_footer
template's context?
I'd be grateful for your help and advice.

-- 
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: Template inheritance and passing variables

2012-04-10 Thread andrea mucci
Hi
in django documentation 
https://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs

Note
The include tag should be considered as an implementation of "render this 
subtemplate and include the HTML", not as "parse this subtemplate and include 
its contents as if it were part of the parent". This means that there is no 
shared state between included templates -- each include is a completely 
independent rendering process.


so a good solution will be, for example


> -- base.html --
> 
> 
>   
> 
>   
>   
>   {% block content %}
>   Default content...
>   {% endblock %}
>   

{% block footer %}
>   {{ app_variable }}
> 
>   
>   
>   
>   Link
>   Link
>   Link
>   
>   
>   
{% endblock %}
>   
> 



with this simple code you can use app_variable and in the same time if you want 
to change the footer code you can call from your template view the footer block 
and add different html code

cheers

El 10/04/2012, a las 23:36, bnkwsk escribió:


> Hi,
> while writing my first website in Django I ran into troubles with
> passing variables in my inherited templates. Let me describe my
> templates' structure.
> 
> I have a base template for all applications' templates which includes
> some parts - just to divide the code into smaller parts.
> 
> My goal is to pass a variable (which will be different for every view
> in every app) to a template included in base template (which is
> inherited by my app's view's templates). I considered using a custom
> context processor but since every view will have its own value of the
> variable, it seems to be a bad idea.
> 
> -- base.html --
> 
> 
>   {% include "base_head.html" %}
> 
>   
>   {% include "base_login.html" %}
> 
>   {% include "base_header.html" %}
> 
>   {% include "base_menu.html" %}
> 
>   {% block content %}
>   Default content...
>   {% endblock %}
> 
>   {% include "base_footer.html" %}
>   
> 
> ---
> 
> -- base_footer.html ---
> {{ app_variable }}
> 
> 
>   
>   
>   Link
>   Link
>   Link
>   
>   
> 
> ---
> 
> Now, in one of my app's view I set the app_variable and render the
> app's template.
> 
> -- views.py ---
> def read(request, news_id):
>news = get_object_or_404(News, pk = news_id)
> 
>app_variable = 'foo'
> 
>return render_to_response('news_read.html', { 'news': news,
> 'app_variable': app_variable }, context_instance =
> RequestContext(request))
> ---
> 
> -- news_read.html -
> {% extends "base.html" %}
> 
> {% block content %}
> 
>   {{ news.title }}
> 
>   {{ news.introduction|safe }}
> 
>   {{ news.content|safe }}
> 
> {% endblock %}}
> ---
> 
> Now, what should I do in order to have the app_variable in base_footer
> template's context?
> I'd be grateful for your help and advice.
> 
> -- 
> 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.



Is it a good practice to delegate views based on GET / POST?

2012-04-10 Thread John Yeukhon Wong
3/4 down the page
http://www.djangobook.com/en/2.0/chapter08/

urlpatterns = patterns('', # ... (r'^somepage/$', views.method_splitter, 
{'GET': views.some_page_get, 'POST': views.some_page_post}), # ... )


Is this a good practice at all? If I use the method splitter, my urls will 
look ugly. Or should I just separate based on the length of certain views? 
(If it's too long, break it into two, or use the delegator)

-- 
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/-/AzISlKRiq0UJ.
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: Is it a good practice to delegate views based on GET / POST?

2012-04-10 Thread andrea mucci
hi 

this is something personal choice
i prefer to check GET and POST directly from the view method, but in some case 
is useful to part the GET and the POST view for readable and clean coding


El 11/04/2012, a las 01:21, John Yeukhon Wong escribió:

> 3/4 down the page
> http://www.djangobook.com/en/2.0/chapter08/
> urlpatterns = patterns('', # ... (r'^somepage/$', views.method_splitter, 
> {'GET': views.some_page_get, 'POST': views.some_page_post}), # ... )
> 
> Is this a good practice at all? If I use the method splitter, my urls will 
> look ugly. Or should I just separate based on the length of certain views? 
> (If it's too long, break it into two, or use the delegator)
> 
> -- 
> 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/-/AzISlKRiq0UJ.
> 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.



Can't create a test suite for a Django app

2012-04-10 Thread Michael Parker
Hi all,

I'm having trouble creating a test suite in Django 1.3.

Say I have an installed app in a directory called app_name. One of the
files in that directory is foo.py which defines a class named Foo. I
want to test that, so I also have a file that directory called
foo_test.py which defines a class named FooTest. That file looks like:

  import unittest
  import foo

  class FooTest(unittest.TestCase):
def setUp(self):
  self.foo_instance = foo.Foo()

... etc


Now down the line I'll have other test cases in other files, and I'll
want to run them all as part of a test suite. So in the same directory
app_name I created a file tests.py which will define the suite. At
first I defined it like:


  from django.test.simple import DjangoTestSuiteRunner

  def suite():
runner = DjangoTestSuiteRunner()
return runner.build_suite(['app_name'])


Unfortunately, this fails because calling
runner.build_suite(['app_name']) searches app_name for a tests.py
file, executes suite(), and this continues recursively until the
Python interpreter stops everything for exceeding the maximum
recursion depth.

Changing runner.build_suite(['app_name']) to the following:

  runner.build_suite(['app_name.foo_test'])
  runner.build_suite(['app_name.foo_test.FooTest'])

Leads to errors like "ValueError: Test label 'app_name.foo_test' does
not refer to a test". And changing it to the following:

  runner.build_suite(['foo_test'])
  runner.build_suite(['foo_test.FooTest'])

Leads to errors like "App with label foo_test could not be found".

I'm kind of out of ideas at this point. Any help would be very much
appreciated!

Regards,
Mike

-- 
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: Force logout a user in signed cookie mode

2012-04-10 Thread Cherian Thomas
Hi, all
Can someone help?
- Cherian



On Tue, Apr 10, 2012 at 11:51 AM, Cherian  wrote:

> Hi all,
>
> In the signed cookie mode is it possible for me force logout an
> account?
> Say I login from two places, and I need to logout my account from the
> one access I forgot to logout in a public internet café. Can I do that
> from my current login?
> From my testing I could not do this. But there might be an override
> key I am missing. Also it’s quite possible that I since there is no
> session key on the server side to reset, this functionality might not
> be there.
> Can someone help?
>
> -Cherian
>

-- 
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.



Tutorial issue with admin

2012-04-10 Thread oneroler
I'm working on the tutorial and ran across an issue that I can't figure 
out.  In the admin site in "Select Polls to Change" instead of displaying 
the question associated with the poll (e.g. "What's up") it displays "poll 
object" for all polls.  I've attached a screen shot of the issue.  Below is 
my code.  Any help would be appreciated.

*mysite/polls.models.py*
from django.db import models

class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')

class Choice(models.Model):
poll = models.ForeignKey(Poll)
choice = models.CharField(max_length=200)
votes = models.IntegerField()

*mysite/polls/admin.py*
from polls.models import Poll, Choice
from django.contrib import admin

class PollAdmin(admin.ModelAdmin):
fieldsets = [
(None,   {'fields': ['question']}),
('Date information', {'fields': ['pub_date'], 'classes': 
['collapse']}),
]

admin.site.register(Poll, PollAdmin)
admin.site.register(Choice)

*mysite/settings.py*
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 
'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 
'/Users/Sam/dev/django/mysite/mysite1.sqlite',  # Or 
path to database file if using sqlite3.
'USER': '',  # Not used with sqlite3.
'PASSWORD': '',  # Not used with sqlite3.
'HOST': '',  # Set to empty string for 
localhost. Not used with sqlite3.
'PORT': '',  # Set to empty string for default. 
Not used with sqlite3.
}
}

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'polls',
)

-- 
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/-/r6d6l_4q6fUJ.
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: Is it a good practice to delegate views based on GET / POST?

2012-04-10 Thread Kevin
Separating GET and POST is normally used for RESTful web programming.  
Which is becoming a very common practice is popular competing frameworks, 
such as Rails.

Personally I would prefer a more "native" way in Django to separate 
GET/POST views.  I guess this could be done via a decorator or something.

Another reason you may want to separate GET/POST is for security.  For 
example, only letting some views accept POST requests, and basically shove 
a big 403 message to users who attempt to POST to a view which otherwise 
shouldn't accept a POST.  I normally limit this using the web server, so 
POST requests will not even reach the web application if the component 
doesn't even accept it.  I always have a mind set that the Internet is 
never safe, and everybody is a hacker.  It's better to be safe, than sorry 
that a malicious POST body reached your application.  An easy way to do 
this on the server is to use a regex mask for views which will accept a 
POST body, such as having an extension of ".do" or ".action".  If the view 
doesn't have this special extension, then only allow GET requests to pass 
through to WSGI.  You can also filter out headers and such on the server to 
further protect your WSGI application from the outside world.  If you don't 
have access to the server's configuration, well, then I'm sure the cloud 
service you deployed to is "safe enough".

On Tuesday, 10 April 2012 18:21:15 UTC-5, John Yeukhon Wong wrote:
>
> 3/4 down the page
> http://www.djangobook.com/en/2.0/chapter08/
>
> urlpatterns = patterns('', # ... (r'^somepage/$', views.method_splitter, 
> {'GET': views.some_page_get, 'POST': views.some_page_post}), # ... )
>
>
> Is this a good practice at all? If I use the method splitter, my urls will 
> look ugly. Or should I just separate based on the length of certain views? 
> (If it's too long, break it into two, or use the delegator)
>

-- 
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/-/8AwOL9nh7lcJ.
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.



Filtering ForeignKey Drop Down in Admin Interface

2012-04-10 Thread Setiaman Lee
Hi,

I managed to set in the QuerySet of ModelAdmin  to only allow user to
see their own record.
But when the child model link to parent model using ForeignKey a Drop
Down will be automatically created for the respective column.
Is there anyway to filter the drop down to only show the records that
has been created by the login user?


Rgrds,
Setiaman Lee.

-- 
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: Tutorial issue with admin

2012-04-10 Thread Romain Gaches

you just have to define a __unicode__ method [1] in your model

[1] 
https://docs.djangoproject.com/en/1.4/ref/models/instances/#django.db.models.Model.__unicode__



Le 11/04/2012 06:54, oneroler a écrit :
I'm working on the tutorial and ran across an issue that I can't 
figure out.  In the admin site in "Select Polls to Change" instead of 
displaying the question associated with the poll (e.g. "What's up") it 
displays "poll object" for all polls.  I've attached a screen shot of 
the issue.  Below is my code.  Any help would be appreciated.


_*mysite/polls.models.py*_
from django.db import models

class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')

class Choice(models.Model):
poll = models.ForeignKey(Poll)
choice = models.CharField(max_length=200)
votes = models.IntegerField()

_*mysite/polls/admin.py*_
from polls.models import Poll, Choice
from django.contrib import admin

class PollAdmin(admin.ModelAdmin):
fieldsets = [
(None,   {'fields': ['question']}),
('Date information', {'fields': ['pub_date'], 'classes': 
['collapse']}),

]

admin.site.register(Poll, PollAdmin)
admin.site.register(Choice)

_*mysite/settings.py*_
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 
'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 
'/Users/Sam/dev/django/mysite/mysite1.sqlite',  # 
Or path to database file if using sqlite3.

'USER': '',  # Not used with sqlite3.
'PASSWORD': '',  # Not used with sqlite3.
'HOST': '',  # Set to empty string for 
localhost. Not used with sqlite3.
'PORT': '',  # Set to empty string for 
default. Not used with sqlite3.

}
}

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'polls',
)
--
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/-/r6d6l_4q6fUJ.

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: Force logout a user in signed cookie mode

2012-04-10 Thread Mario Gudelj
Does this help
http://stackoverflow.com/questions/953879/how-to-force-user-logout-in-django
?

On 11 April 2012 14:40, Cherian Thomas  wrote:

> Hi, all
> Can someone help?
> - Cherian
>
>
>
> On Tue, Apr 10, 2012 at 11:51 AM, Cherian  wrote:
>
>> Hi all,
>>
>> In the signed cookie mode is it possible for me force logout an
>> account?
>> Say I login from two places, and I need to logout my account from the
>> one access I forgot to logout in a public internet café. Can I do that
>> from my current login?
>> From my testing I could not do this. But there might be an override
>> key I am missing. Also it’s quite possible that I since there is no
>> session key on the server side to reset, this functionality might not
>> be there.
>> Can someone help?
>>
>> -Cherian
>>
>
>  --
> 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.



Passing current logged in system user to a django app

2012-04-10 Thread Benedict Verheyen
Hi,


I've made a dashboard app for my company that is going to be widely used.
The dashboard is a collection of links to apps and some other functionality.
Server runs Debian Linux, Nginx with Gunicorn.
Nothing special but, now I need to log on twice, once for Windows, and once for 
the app.
Is there a way I can use the logon information of Windows, in other words, 
knowing
who the logged on windows user is and pass that on the my app in some way ?
My logon procedure now authenticates versus an AD server.

I did some searching and it doesn't seem straightforward to do.
An other solution I can think of is making the dashboard a GUI app instead, so 
I can
set up info for the Django apps, if that is possible.

Any ideas are welcome.

Cheers,
Benedict

-- 
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.