Re: compiler

2012-11-05 Thread Markus Christen
I have tryed your input, but i have always the same problem... i cant fix 
it. it doesent work and i dont know why. (i have it in pycharm and there 
are only these 2 return problems marked.)
 

Am Freitag, 2. November 2012 18:44:46 UTC+1 schrieb ke1g:

> Surely the error message included a line number?
>
> Also, probably not related, but check that there is no whitespace after 
> your line ending back-slashes.  (Hint it is safer to put the opening triple 
> quote before the backslash, and safer yet to put the triple quoted string 
> in a pare of parentheses, the opening one where you have the backslash.)
>
> On Wed, Oct 31, 2012 at 3:28 AM, Markus Christen 
> 
> > wrote:
>
>> Good Morning
>> I have downloaded files, that can helps by my mssql-odbc connection. This 
>> is my downloaded file:
>>
>> http://code.google.com/p/django-pyodbc/source/browse/trunk/sql_server/pyodbc/compiler.py?r=190
>>  
>> On lines 188 and 273, i become the message "'return' outside of 
>> function". It's not a space/tab fail, i have checked this.
>> How can i fix this?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/django-users/-/uvBBHw13tokJ.
>> To post to this group, send email to django...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-users...@googlegroups.com .
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>

-- 
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/-/DMb-vkIM5xsJ.
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.



from django.contrib.admin.models import User

2012-11-05 Thread Bastian
Hi,

When I need to use the 'User' class I always import it from 
django.contrib.auth.models. Now reading some code from other people 
sometimes I see it imported from django.contrib.admin.models and it seems 
to have the same consequences.
Can anybody tell me the difference between the two ways of importing 'User'?

Cheers!
Bastian

-- 
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/-/aLj2wmpfr0oJ.
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: from django.contrib.admin.models import User

2012-11-05 Thread André Dieb
>From what I see on django's source code (dev), there used to be an import
of django.contrib.auth.models.User inside django.contrib.admin.models,
which means the answer to your question may be: there was no difference.

Though, probably best to use contrib.auth on any older version.


On Mon, Nov 5, 2012 at 8:41 AM, Bastian  wrote:

> Hi,
>
> When I need to use the 'User' class I always import it from
> django.contrib.auth.models. Now reading some code from other people
> sometimes I see it imported from django.contrib.admin.models and it seems
> to have the same consequences.
> Can anybody tell me the difference between the two ways of importing
> 'User'?
>
> Cheers!
> Bastian
>
> --
> 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/-/aLj2wmpfr0oJ.
> 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.
>



-- 
@andredieb 

-- 
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 first step. -ImportError: No module named django.core-

2012-11-05 Thread Elena Williams
Hi Francesco,

What happens when you try:

$ cd C:\Python27\fra_env\

(or whatever the equivalent of this might be in the shell you are using)

$ python Scripts\django-admin.py startproject mysite

Regards,
Elena :)



On Mon, Nov 5, 2012 at 1:19 AM, Francescos wrote:

> Hi Elena,
>
> Thanks for replying.
> I guess the PATH var is well set. In fact, if I hit python into cmd.exe
> and then import django everything work (I can print the django version,
> as well).
> So, Django is installed and reachable apparently. At this point I guess
> there is a problem in looking for the modules..
> I also guess is important to consider that I am using 
> virtualenv that,
> once activated, it adds to the PATH this: C:\Python27\fran_env\Scriptswhere 
> is located django-admin.py. This file is also located here:
> C:\Python27\fra_env\Lib\**site-packages\django\bin
>
> Francesco
>
> On Sunday, November 4, 2012 2:07:53 AM UTC, elena wrote:
>
>> Hi Francesco,
>>
>> What you're seeing is the most basic django/python error. It means that
>> your python can't find django from your current path.
>>
>> You should start by checking for the simple things.
>>
>> What happens when you try putting the following in your terminal?:
>> $ python
>>
>> and then:
>> >>> import django
>>
>> Also where is your django-admin.py file located?
>>
>> Elena :)
>>
>>
>> ---
>> Elena :)
>> @elequ
>> 04022 90172
>>
>>
>>
>> On Sun, Nov 4, 2012 at 6:24 AM, Francescos wrote:
>>
>>>  Hello everyone,
>>> Following the django tut I've sat up all the installation and reached
>>> the step where I had to run the command: django-admin.py startproject
>>> mysite
>>> result: I receive the error specified in the subject.
>>> I installed virtualenv (as said 
>>> here)
>>> and activate it before running the command django-admin.py startproject
>>> mysite.
>>> Any suggestion for this problem? Thanks everyone.
>>> Configuration:
>>> - Windows 7 & cmd.exe
>>> - Python2.7
>>> - virtualenviroment at: C:\Python27\fra_env\
>>> - PATH contains: C:\Python27\fra_env\**Scripts
>>> - django-admin.py is in C:\Python27\fra_env\Scripts AND
>>> C:\Python27\fra_env\Lib\**site-packages\django\bin
>>>
>>> I hope someone can help me!
>>> Francesco
>>>
>>> --
>>> 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/-/v_**l9HV306cIJ
>>> .
>>> To post to this group, send email to django...@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users...@**
>>> googlegroups.com.
>>>
>>> For more options, visit this group at http://groups.google.com/**
>>> group/django-users?hl=en
>>> .
>>>
>>
>>  --
> 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/-/kmyIAnk7cYcJ.
>
> 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 browse client side and server side files in Django/Python?

2012-11-05 Thread sachitad
I have written a front end Django/Python application. It's like a syncing 
tool. Users can first browse the source and destination. Source is client's 
computer and destination is server's computer. The interface is similar to 
grsync. I need to implement it in the template(front-end application). 
Here's my form.html:

> 
> Session Name: maxlength="100" />
> Source:
> Destination:
> 
> 
> 


Now when the user click on the open in the source the files and folders in 
the client's computer should be shown and when user press OK the path 
should be loaded in the Source field. How can I do this?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/RsSyN5G4U-0J.
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 make new app in django cms

2012-11-05 Thread Mario Ardi
Hy..please help me.
How to make new app in django cms and how to make this new app can work in 
django cms ?
I'am new in Django Cms developer. 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/-/WI0SryOjZn8J.
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.



I'm lookling for an internship django

2012-11-05 Thread Mariusz
I'm a junior programmer Python/Django (also HTML/CSS), and computer science 
student.
I'm looking for non-profit internship to learn more code in Django 
(HTML/CSS).
I have portfoilo html/css - for interested.

If you help me in study Django - please send me message.

-- 
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/-/kMgeAX4q9DIJ.
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: Location of non-app-specific static files?

2012-11-05 Thread Ryan
That is not a bad idea as everything that is project specific, but not app 
specific, would live in one place.

Thanks,

Ryan

On Sunday, 4 November 2012 15:14:43 UTC, Xavier Ordoquy wrote:
>
> Hi,
>
> One thing I've seen - and adopted - is to have one application that 
> contains the static files.
> It looks like:
>
> └── mysite
> ├── __init__.py
> ├── settings.py
>
> ├── theme
>
> ├── __init__.py
>
> ├── models.py (empty file)
>
> └── static
>
> ├── static
> ├── templates
> ├── urls.py
> └── wsgi.py
>
>
> Then you add the application in your INSTALLED_APPS and you're done.
>
> Regards,
> Xavier Ordoquy,
> Linovia.
>
> Le 4 nov. 2012 à 00:23, Ryan > a écrit 
> :
>
> Hi,
>
> I have been wondering where people put their non-app-specific static files 
> in their django projects?  For example, the base css file that applies to 
> all pages across the project or perhaps the jquery file?
>
> Currently I have the following structure:
>
> .
> ├── app
> │   ├── __init__.py
> │   ├── models.py
> │   ├── static
> │   │   └── app
> │   │   ├── css
> │   │   ├── img
> │   │   └── js
> │   ├── templates
> │   │   └── app
> │   ├── tests.py
> │   └── views.py
> ├── manage.py
> └── mysite
> ├── __init__.py
> ├── settings.py
> ├── static
> ├── templates
> ├── urls.py
> └── wsgi.py
>
> My STATIC_ROOT setting points to the ./mysite/static directory as this is 
> where I would like collectstatic to dump all the static files for 
> deployment, however this is also the obvious place (for me anyway) to place 
> non-app-specific static files as they apply to the project as a whole like 
> the templates directory at this level.
>
> Does any one have any input on this?
>
> Thanks,
>
> Ryan
>
> -- 
> 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/-/4H39KqmnTugJ.
> To post to this group, send email to django...@googlegroups.com
> .
> To unsubscribe from this group, send email to 
> django-users...@googlegroups.com .
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>
>

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



I get a problem at [Activate the admin site] of [Writing your first Django app, part 2 ]

2012-11-05 Thread Jun Luo
Hi all,
  I followed all three steps to activate the admin site. but when I went to 
/admin, it came as follow:

NameError at /admin

name 'admin' is not defined


Request Method:GETRequest URL:http://127.0.0.1:8000/adminDjango Version:
1.4.2Exception Type:NameErrorException Value:

name 'admin' is not defined

Exception Location:D:\learn\django\project1\mysite\mysite\urls.py in 
, line 16Python Executable:C:\Python27\python.exePython Version:
2.7.3Python Path:

['D:\\learn\\django\\project1\\mysite',
 'C:\\Python27\\lib\\site-packages\\distribute-0.6.30-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\pymongo-2.3_-py2.7-win32.egg',
 'C:\\Windows\\system32\\python27.zip',
 'C:\\Python27\\DLLs',
 'C:\\Python27\\lib',
 'C:\\Python27\\lib\\plat-win',
 'C:\\Python27\\lib\\lib-tk',
 'C:\\Python27',
 'C:\\Python27\\lib\\site-packages',
 'C:\\Python27\\lib\\site-packages\\win32',
 'C:\\Python27\\lib\\site-packages\\win32\\lib',
 'C:\\Python27\\lib\\site-packages\\Pythonwin']

Server time:Mon, 5 Nov 2012 17:43:23 +0800




   - C:\Python27\lib\site-packages\django\core\handlers\base.py in 
   get_response
   1. 
  
  response = middleware_method(request)
  
  ...
   ▶ Local vars 
   - C:\Python27\lib\site-packages\django\middleware\common.py in 
   process_request
   1. 
  
  if (not urlresolvers.is_valid_path(request.path_info, 
urlconf) and
  
  ...
   ▶ Local vars 
   - C:\Python27\lib\site-packages\django\core\urlresolvers.py in 
   is_valid_path
   1. 
  
  resolve(path, urlconf)
  
  ...
   ▶ Local vars 
   - C:\Python27\lib\site-packages\django\core\urlresolvers.py in resolve
   1. 
  
  return get_resolver(urlconf).resolve(path)
  
  ...
   ▶ Local vars 
   - C:\Python27\lib\site-packages\django\core\urlresolvers.py in resolve
   1. 
  
  for pattern in self.url_patterns:
  
  ...
   ▶ Local vars 
   - C:\Python27\lib\site-packages\django\core\urlresolvers.py in 
   url_patterns
   1. 
  
  patterns = getattr(self.urlconf_module, "urlpatterns", 
self.urlconf_module)
  
  ...
   ▶ Local vars 
   - C:\Python27\lib\site-packages\django\core\urlresolvers.py in 
   urlconf_module
   1. 
  
  self._urlconf_module = import_module(self.urlconf_name)
  
  ...
   ▶ Local vars 
   - C:\Python27\lib\site-packages\django\utils\importlib.py in 
   import_module
   1. 
  
  __import__(name)
  
  ...
   ▶ Local vars 
   - D:\learn\django\project1\mysite\mysite\urls.py in 
   1. 
  
  url(r'^admin/', include(admin.site.urls)),
  
  ...
   ▶ Local vars 
   

can anyone tell me what happened and how to fix it? 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/-/Gs8Vam1ywtsJ.
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: Postgres versus mysql? Or, is RDS worth migrating for?

2012-11-05 Thread Hristo Deshev
On 11/05/2012 04:50 AM, martharotter wrote:
> I was advised recently to port my startup's Django databases from
> postgres to mysql for two reasons:

Technical arguments aside (Russ Magee got those covered anyway) I'd
advise against that port too. You are doing a startup and you have to
focus on growing your business. Porting your app to a different DB
engine because somebody said so can very well kill the entire business
in terms of lost momentum, missing features, etc. I wouldn't do it and
would spend the time on marketing and growing my product/service instead.

Best,
Hristo

-- 
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: Choosing a JS framework to go together with Django

2012-11-05 Thread Joni Bekenstein
By writing a custom serialization for your models you have a good place to 
handle variations to those models. You don't really have to dump all of 
your fields, you can even create a custom field specifically for the 
frontend, but doesn't really exists in your backend model. 

Besides, If and when your model changes, the frontend part that depends on 
what changed will probably have to be adjusted, regardless of it beeing a 
plain old django template or something else.

On Thursday, September 6, 2012 12:30:30 AM UTC-3, dotnetCarpenter wrote:
>
> @Kelly Nicholes In backbone.js everything is in JS, meaning that there 
> could be no conflict between declarative code and Django handled templates. 
> If I can expose my python models, through auto serialization (JSON) from 
> Django, I can see a productivity win. But I'm a little afraid of the tight 
> coupling in data models between back-end and front-end. My main concern is 
> that I'll have to rewrite large parts of JS if/when the models change. Have 
> you any experience ironing out these issues? Maybe it's not a problem but I 
> lack experience with both frameworks.
>
> I'll look more into backbone.js :)
>
> Den onsdag den 5. september 2012 16.34.29 UTC+2 skrev Kelly Nicholes:
>>
>> It would be a travesty to not mention backbone.js.
>>
>> On Tuesday, September 4, 2012 7:39:49 AM UTC-6, dotnetCarpenter wrote:
>>>
>>> Hi all.
>>>
>>> I'm new here and just took over a Django project for the first time. I'm 
>>> still getting to grip with Django but as a front end dev for the past 5 
>>> years, I'm also looking for a client-side library/framework to go together 
>>> with my project.
>>> My requirements for a JS framework is that it:
>>>
>>>1. is unobtrusive (Django rendered HTML will be shown to scraper 
>>>bots like google)
>>>2. provides some sort of structure (MVC, MVP, MVVM ect.)
>>>3. embraces standards
>>>4. doesn't conflict with Django templates or does so intentionally
>>>5. ideally uses the same template language as Django
>>>
>>> In the ideal world a request/response scenario would look like this:
>>>
>>>1. A client make a (HTTP) request to the (django powered) web site 
>>>with (HTTP) Accept header text/html
>>>2. Django response in the usual way by rendering the assign View 
>>>(django template)
>>>3. The view figure out if JS is supported (implemented in JS). If 
>>>no, this scenario stays in loop 1-3. If yes, then 4.
>>>4. The client (usually a browser) wire up the client-side app 
>>>structure, hook in to URI links, add transitions between views, 
>>>data-bindings ect.
>>>5. Subsequent request are now handle by the JS framework, either 
>>>user initiated (e.g. clicking a link) or app initiated (e.g. pulling 
>>> extra 
>>>data), that will modify the request header to Accept header 
>>>application/json or application/django-template.
>>>6. If django receive a request with an application/django-template 
>>>header it will serve the view as plain text. E.g. Content-type: 
>>> text/plain. 
>>>On the other hand if django receive a request with application/json, it 
>>>will send the object model defined in the view as JSON.
>>>7. The client-side JS framework will receive a template to render in 
>>>the first request and the data to render in the template in the second 
>>>request. A promise object could be used to synchronize the two calls.
>>>
>>> This way django will work as intended for non JS clients and silently 
>>> convert to a RIA in clients that supports JS, with minimal double work for 
>>> the two execution contexts.
>>> A big pro in this is the fact that both django and the JS framework 
>>> share template and data (only has to defined once - in django) - we'll duck 
>>> type all the way. But does this JS framework exist? Does anyone have any 
>>> experience with working with django and JS frameworks? Is there any obvious 
>>> pitfalls in my ideal world scenario in regard to Django? And finally, is it 
>>> possible to serve templates as plain text with django?
>>>  
>>>
>>> Cheers, Jon and thanks in advance
>>>
>>> PS. I accidentally cross-posted this to the Django Developers group 
>>> before realizing it was the wrong forum. Sorry about that. 
>>>
>>>

-- 
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/-/LspqoxAlnbwJ.
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: Location of non-app-specific static files?

2012-11-05 Thread Joni Bekenstein
Check this out: 
https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#staticfiles-dirs

I put a static folder in my project root where I put all the project 
specific (ant not app specific) static files. The folder's path is then 
added to STATICFILES_DIRS.

But note that this static folder is different than STATIC_ROOT folder where 
the collectstatic management command collects all static files for 
deployment 
(https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-STATIC_ROOT)

I separate them because the first one is checked into version control, 
while the second one is not.

On Monday, November 5, 2012 5:53:33 AM UTC-3, Ryan wrote:
>
> That is not a bad idea as everything that is project specific, but not app 
> specific, would live in one place.
>
> Thanks,
>
> Ryan
>
> On Sunday, 4 November 2012 15:14:43 UTC, Xavier Ordoquy wrote:
>>
>> Hi,
>>
>> One thing I've seen - and adopted - is to have one application that 
>> contains the static files.
>> It looks like:
>>
>> └── mysite
>> ├── __init__.py
>> ├── settings.py
>>
>> ├── theme
>>
>> ├── __init__.py
>>
>> ├── models.py (empty file)
>>
>> └── static
>>
>> ├── static
>> ├── templates
>> ├── urls.py
>> └── wsgi.py
>>
>>
>> Then you add the application in your INSTALLED_APPS and you're done.
>>
>> Regards,
>> Xavier Ordoquy,
>> Linovia.
>>
>> Le 4 nov. 2012 à 00:23, Ryan  a écrit :
>>
>> Hi,
>>
>> I have been wondering where people put their non-app-specific static 
>> files in their django projects?  For example, the base css file that 
>> applies to all pages across the project or perhaps the jquery file?
>>
>> Currently I have the following structure:
>>
>> .
>> ├── app
>> │   ├── __init__.py
>> │   ├── models.py
>> │   ├── static
>> │   │   └── app
>> │   │   ├── css
>> │   │   ├── img
>> │   │   └── js
>> │   ├── templates
>> │   │   └── app
>> │   ├── tests.py
>> │   └── views.py
>> ├── manage.py
>> └── mysite
>> ├── __init__.py
>> ├── settings.py
>> ├── static
>> ├── templates
>> ├── urls.py
>> └── wsgi.py
>>
>> My STATIC_ROOT setting points to the ./mysite/static directory as this is 
>> where I would like collectstatic to dump all the static files for 
>> deployment, however this is also the obvious place (for me anyway) to place 
>> non-app-specific static files as they apply to the project as a whole like 
>> the templates directory at this level.
>>
>> Does any one have any input on this?
>>
>> Thanks,
>>
>> Ryan
>>
>> -- 
>> 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/-/4H39KqmnTugJ.
>> To post to this group, send email to django...@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> django-users...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>>

-- 
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/-/vi2h0QwI0hsJ.
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: BDD 4 Django

2012-11-05 Thread Daniel França
Hello all.
I posted a tutorial about BDD4Django in my blog.(installation, usage,
examples)
They'are available in 2 languages

English:
http://codevening.wordpress.com/2012/10/18/bdd4django-tutorial/
http://codevening.wordpress.com/2012/10/31/tutorial-bdd4django-part-2/

Portuguese:
http://codevening.wordpress.com/2012/10/20/tutorial-de-bdd4django-portugues/
http://codevening.wordpress.com/2012/11/05/tutorial-de-bdd4django-parte-2-portugues/

The demo used in the part 2 of the tutorial is available in the last
version of the package (0.3.8)
Suggestions are welcome, feel free to comment, share or ask anything about
this package.

Best Regards,

Daniel França
about.me/danielfranca

On Sun, Sep 23, 2012 at 7:25 PM, Daniel França wrote:

> Hi guys,
>
> I just created a package for a better integration between
> Morelia(BDD)/Splinter(Browser Test) and Django.
> So you can create the features for BDD tests just thinking about the
> browser interaction.
>
> You just need to create a class based in BDDTestcCase. The BDDTestCase
> already comes with some methods that fill most of browser integration steps
> in features (like "I Visit url", "I click the button", "I see the text",
> etc).
>
> Besides the already existing features of Morelia, now it's possible to run
> some specific scenarios only.
>
> The tests run in a browser accessing the tests database (it requires
> Django >= 1.4)
>
> The documentation and source code can be found here:
> https://github.com/danielfranca/BDD4Django
> It can be installed using pip.
>
>
> Feel free to ask, criticize or suggest anything.
>
> Best Regards,
> Daniel França
>

-- 
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: Choosing a JS framework to go together with Django

2012-11-05 Thread Faraz Masood Khan
Have a look at following Unobtrusive Ajax, it is plug out of ASP.NET MVC, 
simple yet powerful.

https://github.com/farazmasoodkhan/DjangoAjax



On Tuesday, September 4, 2012 6:39:49 PM UTC+5, dotnetCarpenter wrote:
>
> Hi all.
>
> I'm new here and just took over a Django project for the first time. I'm 
> still getting to grip with Django but as a front end dev for the past 5 
> years, I'm also looking for a client-side library/framework to go together 
> with my project.
> My requirements for a JS framework is that it:
>
>1. is unobtrusive (Django rendered HTML will be shown to scraper bots 
>like google)
>2. provides some sort of structure (MVC, MVP, MVVM ect.)
>3. embraces standards
>4. doesn't conflict with Django templates or does so intentionally
>5. ideally uses the same template language as Django
>
> In the ideal world a request/response scenario would look like this:
>
>1. A client make a (HTTP) request to the (django powered) web site 
>with (HTTP) Accept header text/html
>2. Django response in the usual way by rendering the assign View 
>(django template)
>3. The view figure out if JS is supported (implemented in JS). If no, 
>this scenario stays in loop 1-3. If yes, then 4.
>4. The client (usually a browser) wire up the client-side app 
>structure, hook in to URI links, add transitions between views, 
>data-bindings ect.
>5. Subsequent request are now handle by the JS framework, either user 
>initiated (e.g. clicking a link) or app initiated (e.g. pulling extra 
>data), that will modify the request header to Accept header 
>application/json or application/django-template.
>6. If django receive a request with an application/django-template 
>header it will serve the view as plain text. E.g. Content-type: 
> text/plain. 
>On the other hand if django receive a request with application/json, it 
>will send the object model defined in the view as JSON.
>7. The client-side JS framework will receive a template to render in 
>the first request and the data to render in the template in the second 
>request. A promise object could be used to synchronize the two calls.
>
> This way django will work as intended for non JS clients and silently 
> convert to a RIA in clients that supports JS, with minimal double work for 
> the two execution contexts.
> A big pro in this is the fact that both django and the JS framework share 
> template and data (only has to defined once - in django) - we'll duck type 
> all the way. But does this JS framework exist? Does anyone have any 
> experience with working with django and JS frameworks? Is there any obvious 
> pitfalls in my ideal world scenario in regard to Django? And finally, is it 
> possible to serve templates as plain text with django?
>  
>
> Cheers, Jon and thanks in advance
>
> PS. I accidentally cross-posted this to the Django Developers group before 
> realizing it was the wrong forum. Sorry about that. 
>
>

-- 
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/-/j4NQCOQM9T0J.
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: Postgres versus mysql? Or, is RDS worth migrating for?

2012-11-05 Thread Faraz Masood Khan
I recommend if you do transactions a lot, stick to Postgresql by all means. 
MySQL isn't transactional database, to test what I mean, create a InnoDB 
database with a very simple InnoDB table (two columns would be fine), than 
do 1000 inserts in transactions; note the time and you will find that 
InnoDB is very very slow on insert, plus transactions death locks are very 
frequent.

On Monday, November 5, 2012 7:50:56 AM UTC+5, martharotter wrote:
>
> I was advised recently to port my startup's Django databases from postgres 
> to mysql for two reasons: 
>
> 1) RDS on Amazon makes it your life much easier
> 2) When I need to scale my web app and have to hire people to help me, it 
> will be much easier to find solid mysql people than postgres people. 
>
> Any thoughts on these? Are they legitimate concerns? It's always a pain to 
> migrate, but I guess if it's worth doing I'd rather do that now when it 
> makes less of an impact. 
>
> Thanks in advance for your help!
> --Martha 
> http://woop.ie 
>
>

-- 
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/-/dJ8jP6DRylgJ.
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 autocomplete search with jQuery

2012-11-05 Thread carlos
Hi i found in google
http://code.google.com/p/django-autocomplete/

and other autocomplete for complete selects
https://github.com/digi604/django-smart-selects

i thing the first help you

cheers

On Sun, Nov 4, 2012 at 2:25 PM, Serena  wrote:

> Hello, how are you? I am new to Django and I have little knowledge of
> AJAX, is that you could help (some step by step tutorial) to use some
> autocomplete widget to search for model fields.
>
> El viernes, 30 de julio de 2010 08:59:16 UTC-4:30, Quenten Griffith
> escribió:
>>
>> I actually just set this up last weekend.  I used this link to
>> understand how to do it http://lethain.com/entry/2007/**
>> dec/01/using-jquery-django-**autocomplete-fields/
>> I also found a plugin that takes most of the work off of you from
>> developing the feature.  http://bitbucket.org/tyrion/**
>> django-autocomplete/overview
>>
>> On Jul 30, 1:34 am, Joel Klabo  wrote:
>> > I have been looking around for some examples but I can't find anything
>> > recent. This is my first AJAX experience so I would love to just see
>> > an example because it's not quite making sense to me. Does anyone know
>> > of a tutorial? Or have some code samples I could check out? I have
>> > checked google btw.
>
>  --
> 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/-/lxdg4qLiqNcJ.
> 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.



Form Inheritance best Practice: Manipulating Fields of the Base Class

2012-11-05 Thread sbrandt
This is a very theoretical question about best practice. I and surely most 
other users know how to do this in *any* way, but I'm interested in the *best 
*solution, if it exists.

Given that:

   - I am inheriting a given form I cannot modify directly, let's say the 
   AuthenticationForm
   - I want to to manipulate a field of this form, i.e. add a "placeholder" 
   attribute to the username and password fields
   - I want to use the fields of the parent class because of DRY and 
   maintainability

The solutins I saw until now somehow contain injecting the attribute in the 
__init__ method:

class MyAuthenticationForm(AuthenticationForm):

def __init__(self, *args, **kwargs):

...

self.fields['username'].widget.attrs['placeholder'] = 'username'

...


Since this is done every instantiation, I feel like this is a bit 
redundant. In fact, these operations are negligible and should not affect 
performance at all. This solution does seem to work as well:

class MyAuthenticationForm(AuthenticationForm):

pass

MyAuthenticationForm.base_fields['username'].widget.attrs['placeholder'] = 
'username'

...

It seems a bit dirty to change the class outside the class definition, but 
at least it is only called once and manipulates the class instead of the 
objects which seems on the other hand much more reasonable.

What do you think? Is there a hook that is only called once the class is 
created? Are there benefits or drawbacks?


Greets

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



Iframe, IE and request.session data

2012-11-05 Thread James DeMichele
Hello,



I’m hoping someone here might be able to help me figure out how to fix this
issue I am seeing with IE and an iframe.



I’m using Django 1.4 and there is some data that I store on the session
like such:



request.session[“KEY”] = “VALUE”



And then on a different request, I am able to retrieve the data by doing
request.session.get(“KEY”). This works for all browsers when not within an
iframe (including IE). However, when my site is running in an iframe, on
IE, this data is not retrieved. I’ve found multiple pages on the interwebs
that you need to set the P3P on the header. I’ve done this.



response["P3P"] = 'CP="CAO IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi
HIS OUR IND CNT"'



THIS does not fix the fact that the data on the session does not exist in
IE.



Is there a fix for this? Or is my site completely unsuable in IE in an
iframe?



Thanks.



-James

-- 
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 mod-wsgi multiple instances of One Class object

2012-11-05 Thread drunksaint


I am currently using a DJango - apache installation (on mod_wsgi) to run a 
website (project) which hosts an intranet cards game, whose rules are 
complicated enogh that it requires only 1 master list+dict data structure 
of scores for each user. Individual user's score can be impacted by other 
users actions also. I am using a Score class which I instantiate in urls.py 
and all players / users access this class' object [scObj = Scorer('Spades') 
]. internally in this obj there are Dicts of players actions, score updates 
etc etc.

class Scorer:
def __init__(self, suitname):
self.__suitname = suitname

The scorer class is separately stored in Scorer.py

scObjs = (Scorer('Spades'), Scorer('Hearts'), Scorer('Clubs'), 
Scorer('Diamonds'),)

The objects are created in urls.py

This model was running perfectly in the DEV deployement. When I moved to 
PROD in apache, this broke (as in there are multiple instances of scObj 
being created, so a score update from player-1's move on player-2 is not 
reflected in a different move by player-3 on player-2) . I need to simulate 
a singleton class behaviour / global scObj behaviour, which I am not able 
to do. I am running apache in worker - mpm - multithreaded mode, so I 
assume that the problem of multiple copies of scObj being there due to 
multi-process is not there.

Is the problem related to mod_wsgi?

-- 
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/-/omNsLiRhcpkJ.
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: compiler

2012-11-05 Thread Bill Freeman
So the error printout doesn't give the line number of the offending return
statement?

On Mon, Nov 5, 2012 at 4:26 AM, Markus Christen
wrote:

> I have tryed your input, but i have always the same problem... i cant fix
> it. it doesent work and i dont know why. (i have it in pycharm and there
> are only these 2 return problems marked.)
>
>
> Am Freitag, 2. November 2012 18:44:46 UTC+1 schrieb ke1g:
>
>> Surely the error message included a line number?
>>
>> Also, probably not related, but check that there is no whitespace after
>> your line ending back-slashes.  (Hint it is safer to put the opening triple
>> quote before the backslash, and safer yet to put the triple quoted string
>> in a pare of parentheses, the opening one where you have the backslash.)
>>
>> On Wed, Oct 31, 2012 at 3:28 AM, Markus Christen 
>> wrote:
>>
>>> Good Morning
>>> I have downloaded files, that can helps by my mssql-odbc connection.
>>> This is my downloaded file:
>>> http://code.google.com/p/**django-pyodbc/source/browse/**
>>> trunk/sql_server/pyodbc/**compiler.py?r=190
>>>
>>> On lines 188 and 273, i become the message "'return' outside of
>>> function". It's not a space/tab fail, i have checked this.
>>> How can i fix this?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To view this discussion on the web visit https://groups.google.com/d/**
>>> msg/django-users/-/**uvBBHw13tokJ
>>> .
>>> To post to this group, send email to django...@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users...@**
>>> googlegroups.com.
>>>
>>> For more options, visit this group at http://groups.google.com/**
>>> group/django-users?hl=en
>>> .
>>>
>>
>>  --
> 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/-/DMb-vkIM5xsJ.
>
> 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: Iframe, IE and request.session data

2012-11-05 Thread Mario Gudelj
It's a security feature in IE as far as I know. Try going to internet
options and set the security option to low and it will work. I don't think
there's a workaround for that.
On Nov 6, 2012 6:59 AM, "James DeMichele" 
wrote:

> Hello,
>
>
>
> I’m hoping someone here might be able to help me figure out how to fix
> this issue I am seeing with IE and an iframe.
>
>
>
> I’m using Django 1.4 and there is some data that I store on the session
> like such:
>
>
>
> request.session[“KEY”] = “VALUE”
>
>
>
> And then on a different request, I am able to retrieve the data by doing
> request.session.get(“KEY”). This works for all browsers when not within an
> iframe (including IE). However, when my site is running in an iframe, on
> IE, this data is not retrieved. I’ve found multiple pages on the interwebs
> that you need to set the P3P on the header. I’ve done this.
>
>
>
> response["P3P"] = 'CP="CAO IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi
> CONi HIS OUR IND CNT"'
>
>
>
> THIS does not fix the fact that the data on the session does not exist in
> IE.
>
>
>
> Is there a fix for this? Or is my site completely unsuable in IE in an
> iframe?
>
>
>
> Thanks.
>
>
>
> -James
>
> --
> 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: compiler

2012-11-05 Thread Nikolas Stevenson-Molnar
I know you checked it, but indentation is the only thing I can think of
that would cause this. The problem isn't necessarily on the line with
the return statement, there may be an earlier line indented incorrectly.
Have you tried PyCharm's "Convert Indents" feature? Edit > Convert
Indents > To Tabs (or To Spaces).

_Nik

On 11/5/2012 1:26 AM, Markus Christen wrote:
> I have tryed your input, but i have always the same problem... i cant
> fix it. it doesent work and i dont know why. (i have it in pycharm
> and there are only these 2 return problems marked.)
>  
>
> Am Freitag, 2. November 2012 18:44:46 UTC+1 schrieb ke1g:
>
> Surely the error message included a line number?
>
> Also, probably not related, but check that there is no whitespace
> after your line ending back-slashes.  (Hint it is safer to put the
> opening triple quote before the backslash, and safer yet to put
> the triple quoted string in a pare of parentheses, the opening one
> where you have the backslash.)
>
> On Wed, Oct 31, 2012 at 3:28 AM, Markus Christen
> > wrote:
>
> Good Morning
> I have downloaded files, that can helps by my mssql-odbc
> connection. This is my downloaded file:
> 
> http://code.google.com/p/django-pyodbc/source/browse/trunk/sql_server/pyodbc/compiler.py?r=190
> 
> 
>  
> On lines 188 and 273, i become the message "'return' outside
> of function". It's not a space/tab fail, i have checked this.
> How can i fix this?
> -- 
> You received this message because you are subscribed to the
> Google Groups "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/uvBBHw13tokJ
> .
> To post to this group, send email to
> django...@googlegroups.com .
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en
> .
>
>
> -- 
> 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/-/DMb-vkIM5xsJ.
> 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: compiler

2012-11-05 Thread Nikolas Stevenson-Molnar
I tried copy/pasting the code you linked into PyCharm and it worked
fine. Gotta be spacing/indentation somewhere.

_Nik

On 11/5/2012 1:26 AM, Markus Christen wrote:
> I have tryed your input, but i have always the same problem... i cant
> fix it. it doesent work and i dont know why. (i have it in pycharm
> and there are only these 2 return problems marked.)
>  
>
> Am Freitag, 2. November 2012 18:44:46 UTC+1 schrieb ke1g:
>
> Surely the error message included a line number?
>
> Also, probably not related, but check that there is no whitespace
> after your line ending back-slashes.  (Hint it is safer to put the
> opening triple quote before the backslash, and safer yet to put
> the triple quoted string in a pare of parentheses, the opening one
> where you have the backslash.)
>
> On Wed, Oct 31, 2012 at 3:28 AM, Markus Christen
> > wrote:
>
> Good Morning
> I have downloaded files, that can helps by my mssql-odbc
> connection. This is my downloaded file:
> 
> http://code.google.com/p/django-pyodbc/source/browse/trunk/sql_server/pyodbc/compiler.py?r=190
> 
> 
>  
> On lines 188 and 273, i become the message "'return' outside
> of function". It's not a space/tab fail, i have checked this.
> How can i fix this?
> -- 
> You received this message because you are subscribed to the
> Google Groups "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/uvBBHw13tokJ
> .
> To post to this group, send email to
> django...@googlegroups.com .
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en
> .
>
>
> -- 
> 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/-/DMb-vkIM5xsJ.
> 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.



Error setting up Django 1.4 on cPanel Server

2012-11-05 Thread Bestrafung
I am slowly working all of this out and the first 3 or 4 times I tried to 
setup Django on our cPanel server I kept getting the same 403 Forbidden 
error. I scrapped everything and started from scratch as I wanted to use 
Python 2.7 instead of 2.5. Now I am receiving completely different errors 
I've never encountered before. I used the below post on the cpanel forums 
as a guide, making my own changes as necessary, documenting my full 
progress along the way. The new error lists in the browser as a 200 error 
which has me confused as I thought a 200 meant everything was good. I'm 
re-checking everything for a typo but I really have no idea what's causing 
this.

http://forums.cpanel.net/f5/django-python-cpanel-71229-p2.html#post439009

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

// Server Setup \\
\\==//

// download and innstall Python 2.7
// file URL http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar -xvzf Python-2.7.3.tgz
cd Python-2.7.3
./configure --enable-shared --prefix=/opt/python2.7
make install

// alias python so always opens 2.7
cd /root
echo alias python='/opt/python2.7/bin/python' >> .bash_profile

// fix LD_LIBRARY_PATH
echo /opt/python2.7/lib > /etc/ld.so.conf.d/python2.7.conf
ldconfig

/ install setuptools
// URL http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py
/ install MySQLdb for Python
// http://pypi.python.org/pypi/MySQL-python/1.2.3
tar -xvzf MySQL-python-1.2.3.tar.gz
cd MySQL-python-1.2.3
python setup.py build
python setup.py install

// test import
python
import sqlite3
import MySQLdb
quit()

// install mod_wsgi
// http://modwsgi.googlecode.com/files/mod_wsgi-3.4.tar.gz
tar -xvzf mod_wsgi-3.4.tar.gz
cd mod_wsgi-3.4
./configure --with-apxs=/usr/local/apache/bin/apxs 
--with-python=/opt/python2.7/bin/python
make
make install

// In WHM | Apache Setup, in Pre VirtualHost Include, add:
LoadModule wsgi_module /usr/local/apache/modules/mod_wsgi.so
AddHandler wsgi-script .wsgi
WSGISocketPrefix run/wsgi

// create a “run” directory for Apache's .pid files
mkdir -p /usr/local/apache/run
chmod a+w /usr/local/apache/run

===
 Client Setup
===

// Add to user's .bash_profile:
# Use python 2.7
alias python='/opt/python/bin/python'
# Set python path
export PYTHONPATH='$PYTHONPATH:/home/[username]/sites/[domain.com]'

// Prepare the project folder
mkdir -p /home/[user]/sites/[domain]
cd /home/[user]/sites/[domain]
svn co http://code.djangoproject.com/svn/django/trunk/ django-trunk
=OR=
svn co http://code.djangoproject.com/svn/django/branches/releases/1.4.X/ django
ln -s django-trunk/django django
mkdir .python-eggs
chmod 777 .python-eggs
/home/[username]/sites/domain.com/django/bin/django-admin.py startproject foobar
cd /home/[username]
chown -R [username]: sites

// test imports as user
python
import MySQLdb
import sqlite3
import django
quit()

// create bootstrap
nano /home/username/public_html/something.wsgi

// contents of bootstrap:
#!/opt/python2.7/bin/python
import os, sys
sys.path.insert(0,'/home/username/sites/domain.com')
os.environ['DJANGO_SETTINGS_MODULE'] = 'foobar.settings'
os.environ['PYTHON_EGG_CACHE'] = '/home/username/sites/domain.com/.python-eggs'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

// setup vhost
mkdir -p /usr/local/apache/conf/userdata/std/2/username/domain.com
nano /usr/local/apache/conf/userdata/std/2/username/domain.com/vhost.conf

// contents of vhost.conf

Alias /robots.txt /home/username/sites/domain.com/foobar/media/robots.txt
Alias /site_media /home/username/sites/domain.com/foobar/media
Alias /admin_media /home/username/sites/domain.com/django/contrib/admin/media



# See the link below for an introduction about this mod_wsgi config.
# 
http://groups.google.com/group/modwsgi/browse_thread/thread/60cb0ec3041ac1bc/2c547b701c4d74aa

WSGIScriptAlias / /home/username/public_html/something.wsgi
WSGIDaemonProcess [username] processes=7 threads=1 display-name=%{GROUP}
WSGIProcessGroup [username]
WSGIApplicationGroup %{GLOBAL} 


# This fixes the broken ErrorDocument directive we inherit that breaks auth
# if we use a WSGI app.
ErrorDocument 401 "Authentication Error"
ErrorDocument 403 "Forbidden"

// include the vhost in apache
/scripts/verify_vhost_includes
/scripts/ensure_vhost_includes --user=username

// restart django just to be sure
touch /home/username/public_html/something.wsgi

Re: from django.contrib.admin.models import User

2012-11-05 Thread Russell Keith-Magee
On Mon, Nov 5, 2012 at 7:50 PM, André Dieb  wrote:

> From what I see on django's source code (dev), there used to be an import
> of django.contrib.auth.models.User inside django.contrib.admin.models,
> which means the answer to your question may be: there was no difference.
>
> Incorrect - there *is* a difference. The import from admin is a side
effect caused by admin's usage of the auth app; the auth import is the
official location. As a result, the import from admin is not supported, and
may be removed at any time without warning. Unless you like surprises,
stick to the auth import.

Yours,
Russ Magee %-)

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



Re: compiler

2012-11-05 Thread Kurtis Mullins
You could use Lint to check your code for syntax errors.


On Mon, Nov 5, 2012 at 4:18 PM, Nikolas Stevenson-Molnar <
nik.mol...@consbio.org> wrote:

>  I tried copy/pasting the code you linked into PyCharm and it worked fine.
> Gotta be spacing/indentation somewhere.
>
>
> _Nik
>
> On 11/5/2012 1:26 AM, Markus Christen wrote:
>
> I have tryed your input, but i have always the same problem... i cant fix
> it. it doesent work and i dont know why. (i have it in pycharm and there
> are only these 2 return problems marked.)
>
>
> Am Freitag, 2. November 2012 18:44:46 UTC+1 schrieb ke1g:
>
>> Surely the error message included a line number?
>>
>> Also, probably not related, but check that there is no whitespace after
>> your line ending back-slashes.  (Hint it is safer to put the opening triple
>> quote before the backslash, and safer yet to put the triple quoted string
>> in a pare of parentheses, the opening one where you have the backslash.)
>>
>> On Wed, Oct 31, 2012 at 3:28 AM, Markus Christen 
>> wrote:
>>
>>> Good Morning
>>> I have downloaded files, that can helps by my mssql-odbc connection.
>>> This is my downloaded file:
>>> http://code.google.com/p/**django-pyodbc/source/browse/**
>>> trunk/sql_server/pyodbc/**compiler.py?r=190
>>>
>>> On lines 188 and 273, i become the message "'return' outside of
>>> function". It's not a space/tab fail, i have checked this.
>>> How can i fix this?
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To view this discussion on the web visit https://groups.google.com/d/**
>>> msg/django-users/-/**uvBBHw13tokJ
>>> .
>>> To post to this group, send email to django...@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users...@**
>>> googlegroups.com.
>>> For more options, visit this group at http://groups.google.com/**
>>> group/django-users?hl=en
>>> .
>>>
>>
>>  --
> 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/-/DMb-vkIM5xsJ.
> 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.



initializing virtualenvwrapper on Mac (10.6.8) for Django

2012-11-05 Thread Luisa Beck


I want to use Django and create virtual environments. I don't quite 
understand the initializing steps documentation on the virtualenvwrapper 
website. I've installed virtualenvwrapper in 
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages. 
I've already installed XCode, Homebrew and Posgres as well.

The documentation tells me to:

$ export WORKON_HOME=~/Envs

$ mkdir -p $WORKON_HOME

$ source /usr/local/bin/virtualenvwrapper.sh

$ mkvirtualenv env1`

I'm especially confused about the first line. Is it telling me that I need 
to *create* a project folder named 'WORKON_HOME' and export it into another 
folder called 'Envs'? (I've searched for both folders on my mac but didn't 
find them). And then in the second line I make another directory 
'WORKON_HOME'? If you have suggestions or links to better 
explanations/tutorials, I would greatly appreciate it. 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/-/QxJcDlsxBdEJ.
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: initializing virtualenvwrapper on Mac (10.6.8) for Django

2012-11-05 Thread Lachlan Musicman
WORKON_HOME is a shell variable, which is why it's then called/accessed
using the $ - $WORKON_HOME

Export tells the shell to put it in it's local vars for the session, and to
set the var to ~/Export

the mkdir -p will create the directory ~/Envs (or whatever you chose to set
WORKON_HOME to). It will also create all parent dirs (-p)

source tells the shell to start using the shell script following it as a
resource (which can contain vars and functions, eg mkvirtualev)

To make this persistent  you should put the first and third lines into your
shell rc file, usually .bashrc (also, .kshrc, .bash/bashrc, .profile, etc).
You can put them as is, at the bottom.

Cheers
L.


On Tue, Nov 6, 2012 at 1:07 PM, Luisa Beck  wrote:

> I want to use Django and create virtual environments. I don't quite
> understand the initializing steps documentation on the virtualenvwrapper
> website. I've installed virtualenvwrapper in
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages.
> I've already installed XCode, Homebrew and Posgres as well.
>
> The documentation tells me to:
>
> $ export WORKON_HOME=~/Envs
>
> $ mkdir -p $WORKON_HOME
>
> $ source /usr/local/bin/virtualenvwrapper.sh
>
> $ mkvirtualenv env1`
>
> I'm especially confused about the first line. Is it telling me that I need
> to *create* a project folder named 'WORKON_HOME' and export it into
> another folder called 'Envs'? (I've searched for both folders on my mac but
> didn't find them). And then in the second line I make another directory
> 'WORKON_HOME'? If you have suggestions or links to better
> explanations/tutorials, I would greatly appreciate it. 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/-/QxJcDlsxBdEJ.
> 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.
>



-- 
...we look at the present day through a rear-view mirror. This is something
Marshall McLuhan said back in the Sixties, when the world was in the grip
of authentic-seeming future narratives. He said, “We look at the present
through a rear-view mirror. We march backwards into the future.”

http://www.warrenellis.com/?p=14314

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



Re: initializing virtualenvwrapper on Mac (10.6.8) for Django

2012-11-05 Thread Lachlan Musicman
I should add that you can see what any shell VAR is set to by using

echo $VAR

or see what they are all set to by using

printenv

And that by shell I'm generically referring to all shells: sh, csh, ksh,
bash, dash, ash.

Cheers
L.



On Tue, Nov 6, 2012 at 2:10 PM, Lachlan Musicman  wrote:

> WORKON_HOME is a shell variable, which is why it's then called/accessed
> using the $ - $WORKON_HOME
>
> Export tells the shell to put it in it's local vars for the session, and
> to set the var to ~/Export
>
> the mkdir -p will create the directory ~/Envs (or whatever you chose to
> set WORKON_HOME to). It will also create all parent dirs (-p)
>
> source tells the shell to start using the shell script following it as a
> resource (which can contain vars and functions, eg mkvirtualev)
>
> To make this persistent  you should put the first and third lines into
> your shell rc file, usually .bashrc (also, .kshrc, .bash/bashrc, .profile,
> etc). You can put them as is, at the bottom.
>
> Cheers
> L.
>
>
> On Tue, Nov 6, 2012 at 1:07 PM, Luisa Beck  wrote:
>
>> I want to use Django and create virtual environments. I don't quite
>> understand the initializing steps documentation on the virtualenvwrapper
>> website. I've installed virtualenvwrapper in
>> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages.
>> I've already installed XCode, Homebrew and Posgres as well.
>>
>> The documentation tells me to:
>>
>> $ export WORKON_HOME=~/Envs
>>
>> $ mkdir -p $WORKON_HOME
>>
>> $ source /usr/local/bin/virtualenvwrapper.sh
>>
>> $ mkvirtualenv env1`
>>
>> I'm especially confused about the first line. Is it telling me that I
>> need to *create* a project folder named 'WORKON_HOME' and export it into
>> another folder called 'Envs'? (I've searched for both folders on my mac but
>> didn't find them). And then in the second line I make another directory
>> 'WORKON_HOME'? If you have suggestions or links to better
>> explanations/tutorials, I would greatly appreciate it. 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/-/QxJcDlsxBdEJ.
>> 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.
>>
>
>
>
> --
> ...we look at the present day through a rear-view mirror. This is
> something Marshall McLuhan said back in the Sixties, when the world was in
> the grip of authentic-seeming future narratives. He said, “We look at the
> present through a rear-view mirror. We march backwards into the future.”
>
> http://www.warrenellis.com/?p=14314
>



-- 
...we look at the present day through a rear-view mirror. This is something
Marshall McLuhan said back in the Sixties, when the world was in the grip
of authentic-seeming future narratives. He said, “We look at the present
through a rear-view mirror. We march backwards into the future.”

http://www.warrenellis.com/?p=14314

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