Re: problem with django, nginx and gunicorn

2014-05-02 Thread 'ReneMarxis' via Django users
Hello Javier

also thank you for your answer. However i do know how to implement such a 
long running task for a customer.
I generaly use celery and send out an email with a link on completition of 
such a task. For simple tasks i use just a cronjob. Most of those jobs run 
on an separeate machine normaly.

The question is more related to gevent und unicorn. I'd like to understand 
what tasks/aktions can run in paralell when using gevent in gunicorn.
Lets say there are some calls inside the app that return just some 
calculated values from db. Those calls need something about 200-300 ms to 
complete and doing nothing else than reading values from db and calculating 
some results and presenting them with an django template.
I'm running 6 to 8 workers in gunicorn. If i understood the meaning for 
using gevent correctly, the app should be able to serve more that 8 current 
connections, right? Except if there are calls inside the app that block GIL 
(what seems to happen for xhtml2pdf), which seems to block the gunicorn 
master-worker.

I did not change anything on the django app till now. I thought gunicorn 
would monkypath everything on startup. I'll probably have to investigate 
some time here ...

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


How to use SQL functions in django?

2014-05-02 Thread tcmtalk
I want to use MariaDB dynamic column in django. How to use SQL functions in
django model?

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


Centos 6.5 Python 3.3.x Django 1.6 Apache 2.2

2014-05-02 Thread Guillem Liarte
Hello,

I have looked through the web in several different especialised forums but 
I cannot find the way to do this properly.

My aim is to have an environment to host Django applications running Centos 
6. So far I have managed to:

- Get Centos 6.5 + Ptython 3.3.2 + Django 1.6 (virtual env), running a test 
application using python's webserver. Time to move into Apache.
- I manage to get it working from Apache but instead of Python 3.3.2, it 
uses the Python 2.6 installed in the system. No matter if I launch apache 
from the virtual environment, even once I have enabled python3. 

I know Djanog 1.6 can use python 2.6. But that is not what i want to 
achieve, as 1.7 will not.

Just to give some idea of what I have installed:



In the system:
python --version
Python 2.6.6 

>From RedHat SCL:

source /opt/rh/python33/enable

python --version 
Python 3.3.2 

Inside the virtual environment I have:

Django (1.6.3) 
pip (1.4.1) 
setuptools (0.9.8) 

That starts successfully:

python manage.py runserver 192.168.0.16:8000



Starting development server at http://192.168.0.16:8000/

  
Quit the server with CONTROL-C.  

When getting to admin or any error page:

Django Version:
  1.6.3
Python Version:
  3.3.2

Python Path:
  

['/data/app/guillem-py3-dj17-test/guillem_test',
 '/data/app/guillem-py3-dj17-test/lib64/python33.zip',
 '/data/app/guillem-py3-dj17-test/lib64/python3.3',
 '/data/app/guillem-py3-dj17-test/lib64/python3.3/plat-linux',
 '/data/app/guillem-py3-dj17-test/lib64/python3.3/lib-dynload',
 '/opt/rh/python33/root/usr/lib64/python3.3',
 '/opt/rh/python33/root/usr/lib/python3.3',
 '/data/app/guillem-py3-dj17-test/lib/python3.3/site-packages']
___

 
When starting this from Apache 2.2 instead of the python embedded server:


httpd -k restart -e debug
...
[Fri May 02 11:53:29 2014] [debug] mod_so.c(246): loaded module wsgi_module
...

The Apache service starts in my port of choice:

tcp0  0 192.168.0.16:8082   0.0.0.0:*   
LISTEN  1676/httpdWhat I get now is:

So now I get:

Django Version: 1.6
Python Executable:  /data/app/guillem-py3-dj17-test/bin/python
Python Version: 2.6.6
Python Path:

['/data/app/django-test/dev/test-1/HELLO_WORLD/lib/python2.6/site-packages',
 '/data/app/django-test/dev/test-1/HELLO_WORLD/HELLO_WORLD/..',
 '/usr/lib64/python26.zip',
 '/usr/lib64/python2.6',
 '/usr/lib64/python2.6/plat-linux2',
 '/usr/lib64/python2.6/lib-tk',
 '/usr/lib64/python2.6/lib-old',
 '/usr/lib64/python2.6/lib-dynload',
 '/usr/lib64/python2.6/site-packages',
 '/usr/lib64/python2.6/site-packages/gst-0.10',
 '/usr/lib64/python2.6/site-packages/gtk-2.0',
 '/usr/lib/python2.6/site-packages',
 '/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info',
 '/data/app/django-test/dev/test-1/virtual/lib/python3.3/site-packages',
 '/data/app/django-test/dev/test-1/HELLO_WORLD/']


Just to make it clear, that python inside the virtual env is python 3.3.2:

(guillem-py3-dj17-test)ndoluxel002:/data/app/guillem-py3-dj17-test/bin# pwd
/data/app/guillem-py3-dj17-test/bin
(guillem-py3-dj17-test)ndoluxel002:/data/app/guillem-py3-dj17-test/bin# which 
python
/data/app/guillem-py3-dj17-test/bin/python
(guillem-py3-dj17-test)ndoluxel002:/data/app/guillem-py3-dj17-test/bin# 
./python --version
Python 3.3.2

  






So, for some reason which most possibly lies with a misconfiguration from my 
part, Apache ignores the fact that theer is another python installed in the 
system.


I believe this happens because the installed mod_wsgi is not compatible:

mod_wsgi-3.2-3.el6.x86_64

Is this the case?




For whatI read here:

http://code.google.com/p/modwsgi/wiki/SupportForPython3X

I should be fine with mod_wsgi 3.2

___


What I have tried:

- Install apache 2.4 alongside 2.2. Even if I can get a suitable mod_wsgi 
mod, I get library dependancy problems, one with python 2.7, which should 
be solvable, and another for glibc, which may be more triky.

All, in it looks like Centos 6.5 + Python 3.3.X + Django 1.6 is not 
possible for the moment.

Am I right?

If there is a way, please let me know!

Many thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/aab4ab40-d466-4903-b75d-8a99285cad3f%40googlegroups.com.
F

Re: Email encoding (DKIM, long lines, etc..)

2014-05-02 Thread notsqrt
Thanks.

Ticket created at https://code.djangoproject.com/ticket/22561, with 
hopefully enough references and elements to make an educated choice.

Regards,

NotSqrt

Le jeudi 1 mai 2014 02:12:56 UTC+2, Russell Keith-Magee a écrit :
>
>
> On Wed, Apr 30, 2014 at 7:13 PM, > wrote:
>
>> Hi !
>>
>> I am implementing DKIM validation for my emails.
>> I noticed than some emails do not pass DKIM validation due to different 
>> body hashes.
>> I followed the email flow, and found that postfix automatically truncates 
>> lines to 998 characters if they are too long (in accordance to 
>> https://tools.ietf.org/html/rfc2822#section-2.1.1).
>>
>> Such emails can be generated by Sentry, by my own apps, etc..
>>
>> Now about Django:
>> When using EmailMessage, the charset is utf-8, and 
>> the Content-Transfer-Encoding is either 7bit or 8bit (automatically changes 
>> between them when the body contains non-ASCII characters).
>> cf the ticket where the developers decided to switch from base64 to this 
>> behaviour : https://code.djangoproject.com/ticket/3472
>>
>> Quick validation with:
>>
>> >>> from django.core.mail import EmailMessage
>>> >>> print EmailMessage('subject', 'body', 
>>> >>> 'fro...@example.net', 
>>> ['to@example.net ']).message().as_string()
>>> MIME-Version: 1.0
>>> Content-Type: text/plain; charset="utf-8"
>>> Content-Transfer-Encoding: 7bit
>>> Subject: subject
>>> From: fro...@example.net 
>>> To: to@example.net 
>>> Date: Wed, 30 Apr 2014 11:01:44 -
>>> Message-ID: <20140430110144.1564.85693@localhost>
>>> body
>>
>>
>>
>> So at the moment, because Django says not to use base64 for utf-8 emails 
>> in its code, Django does no longer make sure that the lines are not too 
>> long, despite the RFC.
>>
>> I see 3 ways to make sure that the lines are not too long :
>>
>>- automatically split lines in a way that can be recognized by email 
>>readers (no idea how to do that properly..) (in Django/in the apps) 
>>- go back to base64 (but it seems to increase spam scores)
>>- switch to quoted-printable (functioning code below, no idea of the 
>>potentially negative impact)
>>
>> from django.core.mail.message import utf8_charsetfrom email import Charset
>> utf8_charset.body_encoding = Charset.QP
>>
>> What do you think ?
>> Is Django code / app code the correct place to fix this ?
>>
>  
> I'd say so. EmailMessage et al are the end user's public interface to 
> sending mail. If a user can use our API to generate a non-RFC compliant 
> mail, then that's a bug. Even if the root cause of the bug lies in a deeper 
> layer (e.g., Python's email library), we should do everything we can to 
> provide a workaround so that end users aren't affected.
>
> Should Django respect the RFC ?
>>
>
> Absolutely. Django shouldn't expose a public API that makes it possible to 
> generate non-RFC emails payloads; furthermore, if there's any defacto 
> standards or common practices that make an email unacceptable on receipt 
> (e.g., the problem with base64 encoding getting flagged as spam), we should 
> be adhering to that, too.
>  
>
>> Any other ideas ?
>>
>>
> It sounds like you've found a problem; this should be logged as a ticket 
> so it isn't forgotten. If you want to try your hand at a patch, the help 
> would be most welcome.
>
> I'd need to do some more reading about the right solution; Quoted 
> Printable might be workable, but I'm also not aware if that will have any 
> downstream consequences. Some investigation will be required. The only 
> option I can rule out is moving back to base64, because that was done for a 
> reason. Unless you can validate that base64 encoding is no longer penalized 
> by popular spam services, this isn't an option.
>
> Yours,
> Russ Magee %-)
>  
>

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


Re: django-mutant

2014-05-02 Thread Eddilbert Macharia
Hi Simon,

Sorry for the delayed response,

I am trying to create a data collection system. i wanted the user to be 
able to create their models based on the data they want to collect.

i followed the tutorial and also tried the sample application from the 
tutorial but i got the following error.

Exception Type:TypeErrorException Value:

__init__() takes at least 2 arguments (2 given)

 
 But i think my biggest problem was i could not get a documentation for app 
explaining how to use.is there a tutorial or a better documentation 

Regards, I'm honored for your reply and though i did not understand how to 
use the app fully i liked it.

 


 


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


Re: I can't run django server nor activate the virtualenv

2014-05-02 Thread Fred DJar



I've got an error message running the last command. here is the screenshot




On Friday, 2 May 2014 07:52:24 UTC+1, Lee wrote:
>
> No, you were in the right locatin before. Look at your last screenshot. 
> There was a file called requirements and you do it from there. If it does 
> not work, please confirm what is in that requirements file
>

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


Re: Structuring an API in a large project

2014-05-02 Thread Adam "Cezar" Jenkins
On Thu, May 1, 2014 at 8:15 PM, Mike Dewhirst  wrote:

> On 2/05/2014 10:29 AM, Adam "Cezar" Jenkins wrote:
>
>>
>>
>>
>> On Thu, May 1, 2014 at 5:36 PM, Mike Dewhirst > > wrote:
>>
>> On 2/05/2014 2:16 AM, Adam "Cezar" Jenkins wrote:
>>
>> On Thu, May 1, 2014 at 11:10 AM, Venkatraman S
>> mailto:venka...@gmail.com>
>> >> wrote:
>>
>>
>>
>> Â  Â  On Thu, May 1, 2014 at 9:29 PM, Cezar Jenkins
>> Â  Â  mailto:emperorce...@gmail.com>
>> > __>> wrote:
>>
>> Â  Â  Â  Â  Right now I have a large project with an equally
>> large API (done
>> Â  Â  Â  Â  using django rest framework). The current structure
>> is something
>> Â  Â  Â  Â  like this:
>>
>> Â  Â  Â  Â  api
>> Â  Â  Â  Â  |-urls.py
>> Â  Â  Â  Â  |-models.py
>> Â  Â  Â  Â  |
>> Â  Â  Â  Â  v1
>>         Â  Â  |-views.py
>>         Â  Â  |-serializers.py
>>         Â  Â  |-permissions.py
>>         Â  Â  |-tests.py
>>
>>
>> Â  Â  Â  Â  etc
>>
>> Â  Â  Â  Â  As you can guess, the views.py file is pretty big
>> and I want to
>> Â  Â  Â  Â  refactor this out. Currently I have a few options in
>> front of
>> Â  Â  Â  Â  me, the one I'm leaning towards is to put an
>> 'api/v1' package
>> Â  Â  Â  Â  into each app and use the api app to tie all the
>> urls together
>> Â  Â  Â  Â  and hold views that don't fall into an app.
>>
>>
>> Â  Â  If the only pain point is the big views file, then why not
>> just
>>     refactor that into multiple files under 'v1' Â itself -
>> nothing is
>>     stopping you from doing that.Â
>>
>>
>>
>>
>> That was one way I started refactoring, but ran into issues. Say
>> I have
>> a destinations.py view file in the api, but I also have a
>> destinations
>> app. In my views file I can't do 'from destinations.models import
>> Destination' cause the name conflicts. So I started having to name
>> things 'destinations_api.py' which seemed really dirty.
>>
>>
>> I might have missed something here but the usual Django way of
>> refactoring a large views (models too) file is to convert it into a
>> directory containing a file for each view. Then you can still refer
>> to each view using the dotted names as previously. No need to change
>> other code in other parts of the app which calls them.
>>
>>
>> You're correct that code outside of those view wouldn't have to change,
>> but the name of the file the view is in can clash with something outside
>> that file.
>>
>
> But if inside the app.views.__init__.py file you import the view classes
> and defs you can call them without mentioning the filenames within which
> they exist eg.
>
> from __future__ import absolute_import (if you are using Python 2.x)
> from .conflictingfilename import ClassyView, defined_function
>
> Thereafter, elsewhere you can call ...
>
> app.views.ClassyView.function_within_classyview()
> app.views.defined_function()
>

Thanks. This is actually a really great work around.


>
>
>
>  Â
>>
>>
>> Â
>>
>> Â  Â  --
>> Â  Â  You received this message because you are subscribed to a
>> topic in
>> Â  Â  the Google Groups "Django users" group.
>> Â  Â  To unsubscribe from this topic, visit
>> Â  Â
>> https://groups.google.com/d/__topic/django-users/__
>> rizwdsi5o1k/unsubscribe
>> > rizwdsi5o1k/unsubscribe>.
>> Â  Â  To unsubscribe from this group and all its topics, send an
>> email to
>> Â  Â django-users+unsubscribe@__googlegroups.com
>> 
>> Â  Â  > >.
>>
>> Â  Â  To post to this group, send email to
>> django-users@googlegroups.com > googlegroups.com>
>> Â  Â  > >.
>>
>> Â  Â  Visit this group at
>> http://groups.google.com/__group/django-users
>> .
>> Â  Â  To view this discussion on the web visit
>> Â  Â
>> https://groups.google.com/d/__msgid/django-users/__
>> CAN7tdFT0BAG5XoKoiavKr7v24DqSQ__Tc7D%2Bq5EY7Wgoh_VzvzeA%__
>> 40mail.gmail.com
>> > CAN7tdFT0BAG5XoKoiavKr7v24DqSQTc7D%2Bq5EY7Wgoh_VzvzeA%40ma

What is the best framework to develop one ERP in django?

2014-05-02 Thread Fellipe Henrique
Hi everyone!

I start to build my online version of my company ERP.

But, I try to use Bootstrap Twitter, Foundation.. and all inputs seems to
me bigger.. and we doesn't make a good screen for the user.

I try to use Ext JS, but, I have some difficult to integrate with Django..

Anyone has another framework for these case?

Cheers!

T.·.F.·.A.·. S+F
*Fellipe Henrique P. Soares*

e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge'
*Blog: http://fhbash.wordpress.com/ *
*GitHub: https://github.com/fellipeh *
*Twitter: @fh_bash*

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


Re: I can't run django server nor activate the virtualenv

2014-05-02 Thread Andreas Kuhne
You are not running your commands in a virtual environment. You can't run
pip outside the virtual environment because that requires root permissions.
If you type "sudo pip install -r requirements", it will install the files,
but I'm not sure you want to do that.

Every shell you open, you have to run "source activate" from the bin
folder. Otherwise you will be running on the systems default.

So before you write "pip install -r requirements", make sure you are in the
bin folder and write "source activate".

Regards,

Andréas

2014-05-02 15:29 GMT+02:00 Fred DJar :

>
> I've got an error message running the last command. here is the screenshot
>
>
> 
>
>
> On Friday, 2 May 2014 07:52:24 UTC+1, Lee wrote:
>>
>> No, you were in the right locatin before. Look at your last screenshot.
>> There was a file called requirements and you do it from there. If it does
>> not work, please confirm what is in that requirements file
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/fea28e89-1b67-475d-8959-a345cdb65473%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: I can't run django server nor activate the virtualenv

2014-05-02 Thread Andreas Kuhne
You can always see if your shell is running with a virtual environment, by
the (env) in front of the prompt. If you check your last screenshot, you
will see that you are running in a virtualenvironment there.

Regards,

Andréas

2014-05-02 15:48 GMT+02:00 Andreas Kuhne :

> You are not running your commands in a virtual environment. You can't run
> pip outside the virtual environment because that requires root permissions.
> If you type "sudo pip install -r requirements", it will install the files,
> but I'm not sure you want to do that.
>
> Every shell you open, you have to run "source activate" from the bin
> folder. Otherwise you will be running on the systems default.
>
> So before you write "pip install -r requirements", make sure you are in
> the bin folder and write "source activate".
>
> Regards,
>
> Andréas
>
> 2014-05-02 15:29 GMT+02:00 Fred DJar :
>
>
>> I've got an error message running the last command. here is the screenshot
>>
>>
>> 
>>
>>
>> On Friday, 2 May 2014 07:52:24 UTC+1, Lee wrote:
>>>
>>> No, you were in the right locatin before. Look at your last screenshot.
>>> There was a file called requirements and you do it from there. If it does
>>> not work, please confirm what is in that requirements file
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/fea28e89-1b67-475d-8959-a345cdb65473%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

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


Re: I can't run django server nor activate the virtualenv

2014-05-02 Thread Fred DJar
OMG another problem appeared from nowhere 
the "source activate" command is not working. i can't activate my virtualenv






On Friday, 2 May 2014 14:50:12 UTC+1, Andréas Kühne wrote:
>
> You can always see if your shell is running with a virtual environment, by 
> the (env) in front of the prompt. If you check your last screenshot, you 
> will see that you are running in a virtualenvironment there.
>
> Regards,
>
> Andréas
>
> 2014-05-02 15:48 GMT+02:00 Andreas Kuhne 
> >:
>
>> You are not running your commands in a virtual environment. You can't run 
>> pip outside the virtual environment because that requires root permissions. 
>> If you type "sudo pip install -r requirements", it will install the files, 
>> but I'm not sure you want to do that. 
>>
>> Every shell you open, you have to run "source activate" from the bin 
>> folder. Otherwise you will be running on the systems default.
>>
>> So before you write "pip install -r requirements", make sure you are in 
>> the bin folder and write "source activate".
>>
>> Regards,
>>
>> Andréas
>>
>> 2014-05-02 15:29 GMT+02:00 Fred DJar >
>> :
>>
>>
>>> I've got an error message running the last command. here is the 
>>> screenshot
>>>
>>>
>>> 
>>>
>>>
>>> On Friday, 2 May 2014 07:52:24 UTC+1, Lee wrote:

 No, you were in the right locatin before. Look at your last screenshot. 
 There was a file called requirements and you do it from there. If it does 
 not work, please confirm what is in that requirements file

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

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


Re: What is the best framework to develop one ERP in django?

2014-05-02 Thread Venkatraman S
On Fri, May 2, 2014 at 7:13 PM, Fellipe Henrique  wrote:

>
> I start to build my online version of my company ERP.
>
> But, I try to use Bootstrap Twitter, Foundation.. and all inputs seems to
> me bigger.. and we doesn't make a good screen for the user.
>

Why do you need both Bootstrap and Foundation? It looks to me that you are
talking about UI design which is independent of Django. What you need is a
designer and a html/css guy who can convert that design into pages.


> I try to use Ext JS, but, I have some difficult to integrate with Django..
>
> Anyone has another framework for these case?
>

There is nothing called an 'ERP Framework' - you need to specify your
requirements and use the language/technology of your choice and convert
those specs into the product that you wish for. This is a 'general' advice
and not specific to Django.

-V

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


Re: What is the best framework to develop one ERP in django?

2014-05-02 Thread Fellipe Henrique
Hi,

>>This is a 'general' advice and not specific to Django.

Yes, I know that, but I just ask, if anyone knows if any framework to work
in these case exists... I don't use Bootstrap *and* Foundation.. I try both.

T.·.F.·.A.·. S+F
*Fellipe Henrique P. Soares*

e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge'
*Blog: http://fhbash.wordpress.com/ *
*GitHub: https://github.com/fellipeh *
*Twitter: @fh_bash*


2014-05-02 11:12 GMT-03:00 Venkatraman S :

>
> On Fri, May 2, 2014 at 7:13 PM, Fellipe Henrique wrote:
>
>>
>> I start to build my online version of my company ERP.
>>
>> But, I try to use Bootstrap Twitter, Foundation.. and all inputs seems to
>> me bigger.. and we doesn't make a good screen for the user.
>>
>
> Why do you need both Bootstrap and Foundation? It looks to me that you are
> talking about UI design which is independent of Django. What you need is a
> designer and a html/css guy who can convert that design into pages.
>
>
>> I try to use Ext JS, but, I have some difficult to integrate with Django..
>>
>> Anyone has another framework for these case?
>>
>
> There is nothing called an 'ERP Framework' - you need to specify your
> requirements and use the language/technology of your choice and convert
> those specs into the product that you wish for. This is a 'general' advice
> and not specific to Django.
>
> -V
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAN7tdFQ-xZde%2BM80L5V55KHE-6wiPNtSzaHdic5P4Ydc27qkqg%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Centos 6.5 Python 3.3.x Django 1.6 Apache 2.2

2014-05-02 Thread Tom Evans
On Fri, May 2, 2014 at 12:11 PM, Guillem Liarte
 wrote:
> Hello,
>
> I have looked through the web in several different especialised forums but I
> cannot find the way to do this properly.
>
> My aim is to have an environment to host Django applications running Centos
> 6. So far I have managed to:
>
> - Get Centos 6.5 + Ptython 3.3.2 + Django 1.6 (virtual env), running a test
> application using python's webserver. Time to move into Apache.
> - I manage to get it working from Apache but instead of Python 3.3.2, it
> uses the Python 2.6 installed in the system. No matter if I launch apache
> from the virtual environment, even once I have enabled python3.
>

mod_wsgi is linked against a specific version of python, chosen at
compile time. The people who compiled the mod_wsgi package in CentOS
chose to link it against python 2.6, and not python 3.3.

You will need to obtain, or install manually, mod_wsgi compiled
against python 3.

Cheers

Tom

PS: Why Python 3.3 and not Python 3.4?

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


Re: Centos 6.5 Python 3.3.x Django 1.6 Apache 2.2

2014-05-02 Thread Brad Pitcher
What does your Apache vhost config look like? You will need to add a
WSGIDaemonProcess directive where you can specify the python path for the
virtual environment, like so:

WSGIDaemonProcess processname user=wsgi group=apache processes=1 threads=10
umask=0022 display-name=displayname
python-path=/data/app/guillem-py3-dj17-test/lib64/python3.3/site-packages/

-
Brad Pitcher


On Fri, May 2, 2014 at 4:11 AM, Guillem Liarte <
guillem.lia...@googlemail.com> wrote:

> Hello,
>
> I have looked through the web in several different especialised forums but
> I cannot find the way to do this properly.
>
> My aim is to have an environment to host Django applications running
> Centos 6. So far I have managed to:
>
> - Get Centos 6.5 + Ptython 3.3.2 + Django 1.6 (virtual env), running a
> test application using python's webserver. Time to move into Apache.
> - I manage to get it working from Apache but instead of Python 3.3.2, it
> uses the Python 2.6 installed in the system. No matter if I launch apache
> from the virtual environment, even once I have enabled python3.
>
> I know Djanog 1.6 can use python 2.6. But that is not what i want to
> achieve, as 1.7 will not.
>
> Just to give some idea of what I have installed:
>
>
>
> In the system:
> python --version
> Python 2.6.6
>
> From RedHat SCL:
>
> source /opt/rh/python33/enable
>
> python --version
> Python 3.3.2
>
> Inside the virtual environment I have:
>
> Django (1.6.3)
> pip (1.4.1)
> setuptools (0.9.8)
>
> That starts successfully:
>
> python manage.py runserver 192.168.0.16:8000
>
>
>
> Starting development server at http://192.168.0.16:8000/
>
> Quit the server with CONTROL-C.
>
> When getting to admin or any error page:
>
> Django Version:
>   1.6.3
> Python Version:
>   3.3.2
>
> Python Path:
>
>
> ['/data/app/guillem-py3-dj17-test/guillem_test',
>  '/data/app/guillem-py3-dj17-test/lib64/python33.zip',
>  '/data/app/guillem-py3-dj17-test/lib64/python3.3',
>  '/data/app/guillem-py3-dj17-test/lib64/python3.3/plat-linux',
>  '/data/app/guillem-py3-dj17-test/lib64/python3.3/lib-dynload',
>  '/opt/rh/python33/root/usr/lib64/python3.3',
>  '/opt/rh/python33/root/usr/lib/python3.3',
>  '/data/app/guillem-py3-dj17-test/lib/python3.3/site-packages']
> ___
>
>
> When starting this from Apache 2.2 instead of the python embedded server:
>
>
> httpd -k restart -e debug
>
>
> ...
> [Fri May 02 11:53:29 2014] [debug] mod_so.c(246): loaded module wsgi_module
> ...
>
> The Apache service starts in my port of choice:
>
> tcp0  0 192.168.0.16:8082   0.0.0.0:*   
> LISTEN  1676/httpdWhat I get now is:
>
>
> So now I get:
>
> Django Version:   1.6
> Python Executable:/data/app/guillem-py3-dj17-test/bin/python
> Python Version:   2.6.6
> Python Path:  
>
> ['/data/app/django-test/dev/test-1/HELLO_WORLD/lib/python2.6/site-packages',
>
>
>  '/data/app/django-test/dev/test-1/HELLO_WORLD/HELLO_WORLD/..',
>  '/usr/lib64/python26.zip',
>  '/usr/lib64/python2.6',
>  '/usr/lib64/python2.6/plat-linux2',
>  '/usr/lib64/python2.6/lib-tk',
>
>
>  '/usr/lib64/python2.6/lib-old',
>  '/usr/lib64/python2.6/lib-dynload',
>  '/usr/lib64/python2.6/site-packages',
>  '/usr/lib64/python2.6/site-packages/gst-0.10',
>  '/usr/lib64/python2.6/site-packages/gtk-2.0',
>
>
>  '/usr/lib/python2.6/site-packages',
>  '/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info',
>  '/data/app/django-test/dev/test-1/virtual/lib/python3.3/site-packages',
>  '/data/app/django-test/dev/test-1/HELLO_WORLD/']
>
>
>
> Just to make it clear, that python inside the virtual env is python 3.3.2:
>
> (guillem-py3-dj17-test)ndoluxel002:/data/app/guillem-py3-dj17-test/bin# pwd
> /data/app/guillem-py3-dj17-test/bin
> (guillem-py3-dj17-test)ndoluxel002:/data/app/guillem-py3-dj17-test/bin# which 
> python
>
>
> /data/app/guillem-py3-dj17-test/bin/python
> (guillem-py3-dj17-test)ndoluxel002:/data/app/guillem-py3-dj17-test/bin# 
> ./python --version
> Python 3.3.2
>
>
>
> 
>
>
> So, for some reason which most possibly lies with a misconfiguration from my 
> part, Apache ignores the fact that theer is another python installed in the 
> system.
>
>
> I believe this happens because the installed mod_wsgi is not compatible:
>
>
> mod_wsgi-3.2-3.el6.x86_64
>
> Is this the case?
>
>
>
>
> For whatI read here:
>
> http://code.google.com/p/modwsgi/wiki/SupportForPython3X
>
> I should be fine with mod_wsgi 3.2
>
> ___
>
>
> What I have tried:
>
> - Install apache 2.4 alongside 2.2. Even if I can get a suitable mod_wsgi
> mod, I get library dependancy problems, one with python 2.7, which should
> be solvable, and another for glibc, which may be more triky.
>
> All, in it looks like Centos 6.5 + Python 3.3.X + Django 1.6 is not
> possible for the moment.
>
> Am I right?
>
> If there is a way, please let me know!
>
> Many thanks in advance.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django 

Re: What is the best framework to develop one ERP in django?

2014-05-02 Thread Ovnicraft
On Fri, May 2, 2014 at 8:43 AM, Fellipe Henrique  wrote:

> Hi everyone!
>
> I start to build my online version of my company ERP.
>

DRY and check a great python project, OpenERP.



>
> But, I try to use Bootstrap Twitter, Foundation.. and all inputs seems to
> me bigger.. and we doesn't make a good screen for the user.
>
> I try to use Ext JS, but, I have some difficult to integrate with Django..
>

All around your issue is static files maybe you can check a cookie cutter
django: https://github.com/pydanny/cookiecutter-django it will help you to
use bootstrap.

Regards,

>
> Anyone has another framework for these case?
>
> Cheers!
>
> T.·.F.·.A.·. S+F
> *Fellipe Henrique P. Soares*
>
> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \
> 's/(.)/chr(ord($1)-2*3)/ge'
> *Blog: http://fhbash.wordpress.com/ *
> *GitHub: https://github.com/fellipeh *
> *Twitter: @fh_bash*
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAF1jwZH7_ino6XVgstHr_PDqcPS7X8N%3Dinuitkgb%2BnE7A7Ft%3DA%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Cristian Salamea
@ovnicraft

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


Re: I can't run django server nor activate the virtualenv

2014-05-02 Thread Fred DJar



I got this error message trying to fetch the requirements 




On Monday, 28 April 2014 11:03:40 UTC+1, Fred DJar wrote:
>
>
>
>
> *Hello guys, i'm a newbie so bear with me :)I have installed python 2.7 
> and django 1.6 on my desktop (ubuntu 14)but i can't run the application or 
> activate the virtualenv*
>
> *this is the message i got:*
> ubuntu@ubuntu:~/Downloads/saf$ python manage.py runserver
> Traceback (most recent call last):
>   File "manage.py", line 10, in 
> execute_from_command_line(sys.argv)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
> line 399, in execute_from_command_line
> utility.execute()
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
> line 392, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
> line 242, in run_from_argv
> self.execute(*args, **options.__dict__)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
> line 280, in execute
> translation.activate('en-us')
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/__init__.py",
>  
> line 130, in activate
> return _trans.activate(language)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
>  
> line 188, in activate
> _active.value = translation(language)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
>  
> line 177, in translation
> default_translation = _fetch(settings.LANGUAGE_CODE)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
>  
> line 159, in _fetch
> app = import_module(appname)
>   File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", 
> line 40, in import_module
> __import__(name)
>
>

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


Re: There is any POS software made in Django?

2014-05-02 Thread C. Kirby
I don't have much POS experience (at least, not the point-os-sale type) but 
a quick googling found this
https://github.com/maxolasersquad/orthosie https://github.com/maxolasersquad/orthosie>

Kirby

On Thursday, May 1, 2014 5:59:28 PM UTC-5, Fellipe Henrique wrote:
>
> Hi,
>
> I'm started my django app, it's a POS software to control receivable, 
> invoice of the costumer.
>
> There`s any software like that made using Django?
>
> Cheers
>

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


which to use for dynamic data in the database eav or json

2014-05-02 Thread Eddilbert Macharia
Hi guys,

I have been trying to decide which approach to use to store dynamic data in 
the database i.e. data from a survey application in that a user creates 
there on form like in http://www.wufoo.com/.

Storing JSON has its limitation like searching while EAV is generally 
getting negative reviews from the online community sighting performance 
overhead in the queries.

For those who have actual done such an application which is better in the 
long run.

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


Re: Structuring an API in a large project

2014-05-02 Thread Scot Hacker
On Thursday, May 1, 2014 8:59:25 AM UTC-7, Cezar Jenkins wrote:
>
>
> As you can guess, the views.py file is pretty big and I want to refactor 
> this out. Currently I have a few options in front of me, the one I'm 
> leaning towards is to put an 'api/v1' package into each app and use the api 
> app to tie all the urls together and hold views that don't fall into an app.
>
>
>
Hmm, I think the convention is to keep api code with each of your apps, so 
there shouldn't be a danger of anything getting too big / unwieldy:

apps
-- app1
models.py
views.py
apiviews.py
serializers.py
-- app2
models.py
views.py
apiviews.py
serializers.py

etc. import statements throughout the project are nice and readable. Works 
well for our (very large) project anyway.

./s

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


Re: How to use SQL functions in django?

2014-05-02 Thread Jagdeep Singh


On Friday, 2 May 2014 13:25:56 UTC+5:30, TCM Talk wrote:
>
> I want to use MariaDB dynamic column in django. How to use SQL functions 
> in django model?
>

Raw SQL queries 
:
https://docs.djangoproject.com/en/dev/topics/db/sql/
http://doughellmann.com/2007/12/30/using-raw-sql-in-django.html
 

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


how to break an email list into manageable sizes for emailing

2014-05-02 Thread MikeKJ
def send( self ):
c = Context({ "content": self.introductory_text, "user":None, 
"request":None, "updates": [] })#Section.updates.all()[:20] })
t = loader.get_template('emailer/html/updates.html')
subject = self.subject
recipients = []
if self.to_all_principal_contacts:
self.add_principal_contacts()
if self.to_all_subscribers:
self.add_subscribers()
for i in self.recipients.all():
recipients.append( i.email )
self.save()
html = t.render(c)
for i in recipients:
send_html_email( subject, html, "emailataddress.com", i, 
image_root=settings.PROJECT_DIR )
from datetime import datetime
self.sent_on = datetime.now()
self.sent = True
self.save()

What I want to do is break recipients[] into chunks of say 100 and then 
send_html_email on each email address within each chunk for all chunks BUT 
I want to preserve the self.sent = True self.save() to be done after all 
chunks have been sent.
I think it may also need some method of timebreak between each chunk being 
processed.
This is come about because the server/host seems to have a problem with 
sending 1500 emails in one go.  The above sends to small numbers but not 
all in one go.

Thanks for helping





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


Re: which to use for dynamic data in the database eav or json

2014-05-02 Thread C. Kirby
If you are using postgres as your data store (And I recommend you do) take 
a look at the hstore type:
http://www.postgresql.org/docs/9.0/static/hstore.html

There is a django app to help you work with hstore:
https://github.com/djangonauts/django-hstore

Here is a discussion by Craig Kerstiens about using hstore with django:
http://www.craigkerstiens.com/2012/06/11/schemaless-django/

Lastly, Marc Tamlyn is a django core contributor working on a Kickstarter 
to add more postgres support to django:
https://www.kickstarter.com/projects/mjtamlyn/improved-postgresql-support-in-django

Hope this helps some.

Kirby

On Friday, May 2, 2014 10:38:51 AM UTC-5, Eddilbert Macharia wrote:
>
> Hi guys,
>
> I have been trying to decide which approach to use to store dynamic data 
> in the database i.e. data from a survey application in that a user creates 
> there on form like in http://www.wufoo.com/.
>
> Storing JSON has its limitation like searching while EAV is generally 
> getting negative reviews from the online community sighting performance 
> overhead in the queries.
>
> For those who have actual done such an application which is better in the 
> long run.
>

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


Re: error in "makemessages" command on latest django version (1.8dev)

2014-05-02 Thread Fabio Caritas Barrionuevo da Luz
it was really a bug


fixed in
https://github.com/django/django/commit/d1799233f46c39379fe429a4ece128d96b128006


Thanks

Em quarta-feira, 30 de abril de 2014 18h52min41s UTC-3, Fabio Caritas 
Barrionuevo da Luz escreveu:
>
> hello, was testing in the latest version of Django[1] directly from Github 
> and am having this problem
>
>
> *optparse.OptionConflictError: option -e/--extension: conflicting option 
> string(s): -e*
>
> That would be a bug or am I doing something wrong
>
> In this link you can see all the steps I did to get this error
>
> https://asciinema.org/a/9213
>
>
> [1] 
> https://github.com/django/django/tree/8f6dff372b174e772920de6d82bd085f1a74eaf2
>

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


Re: which to use for dynamic data in the database eav or json

2014-05-02 Thread Eddilbert Macharia
Hello Kirby,

thanks for the assist.

I had actually checked at this posts, I was wondering if i was to use the 
hstore or json and eav which in the long run would cause less maintaince 
issues for a data collection system where users create their own forms to 
collect data.

Regards.

Eddilbert

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


Re: error in "makemessages" command on latest django version (1.8dev)

2014-05-02 Thread Fabio Caritas Barrionuevo da Luz
Sorry, I did not see there was already an open issue to handle this problem 

https://code.djangoproject.com/ticket/22328



Em quarta-feira, 30 de abril de 2014 18h52min41s UTC-3, Fabio Caritas 
Barrionuevo da Luz escreveu:
>
> hello, was testing in the latest version of Django[1] directly from Github 
> and am having this problem
>
>
> *optparse.OptionConflictError: option -e/--extension: conflicting option 
> string(s): -e*
>
> That would be a bug or am I doing something wrong
>
> In this link you can see all the steps I did to get this error
>
> https://asciinema.org/a/9213
>
>
> [1] 
> https://github.com/django/django/tree/8f6dff372b174e772920de6d82bd085f1a74eaf2
>

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


Deployment of django project using setuptools

2014-05-02 Thread Tomas Ehrlich
Hi there,
when I deploy my django projects I always run several commands after
pulling latest code from repository. I've started using setup.py few
weeks ago which adds manage.py script into $VENV/bin.

Basicaly, I always do:

source $VENV/bin/activate
export DJANGO_SETTINGS_MODULE=...

git pull
python setup.py install
manage.py syncdb --noinput
manage.py migrate
manage.py collectstatic --noinput
manage.py compilemessages


I wrote deployment scripts in fabric, salt, ansible, but now I'm
thinking that all these 'manage.py' actions should be part of setup
script. Anytime when would I run ``python setup.py install``
the setup script would run all defined management commands so my
environment, database and other stuff stays up to date.


I've found that install command can be extended:

http://www.niteoweb.com/blog/setuptools-run-custom-code-during-install

I haven't found any references that anyone have used this method to
deploy django project, so I'm looking for anyone who tried this
approach before.


Thanks in advance

Cheers,
   Tom


signature.asc
Description: PGP signature


Proper way to nest data (deeply)

2014-05-02 Thread Scott Harper
Hello,

I am using django as a tool to help edit data for a game project I am 
working on. Unfortunately, the data relationships have gotten pretty deep 
recently, and I'm having some difficulty getting the formsets to work 
properly.

So here's the ugly setup: I have a table of Maps, nodes, encounters, and 
enemy fights. I have multiple fights per encounter; multiple encounters per 
node; and multiple nodes per map.

Map
 -Node
  -Encounter

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


Re: Proper way to nest data (deeply)

2014-05-02 Thread Venkatraman S
https://github.com/django-mptt/django-mptt


On Fri, May 2, 2014 at 11:07 PM, Scott Harper wrote:

> Hello,
>
> I am using django as a tool to help edit data for a game project I am
> working on. Unfortunately, the data relationships have gotten pretty deep
> recently, and I'm having some difficulty getting the formsets to work
> properly.
>
> So here's the ugly setup: I have a table of Maps, nodes, encounters, and
> enemy fights. I have multiple fights per encounter; multiple encounters per
> node; and multiple nodes per map.
>
> Map
>  -Node
>   -Encounter
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d2558428-0da3-4529-a459-20e4b249d92b%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Proper way to nest data (deeply)

2014-05-02 Thread Venkatraman S
It looks pretty simple to me actually and am not sure if you need mptt.
Just the FK needs to be designed properly to capture the 1-to-many
relationships.


On Fri, May 2, 2014 at 11:13 PM, Venkatraman S  wrote:

> https://github.com/django-mptt/django-mptt
>
>
> On Fri, May 2, 2014 at 11:07 PM, Scott Harper 
> wrote:
>
>> Hello,
>>
>> I am using django as a tool to help edit data for a game project I am
>> working on. Unfortunately, the data relationships have gotten pretty deep
>> recently, and I'm having some difficulty getting the formsets to work
>> properly.
>>
>> So here's the ugly setup: I have a table of Maps, nodes, encounters, and
>> enemy fights. I have multiple fights per encounter; multiple encounters per
>> node; and multiple nodes per map.
>>
>> Map
>>  -Node
>>   -Encounter
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/d2558428-0da3-4529-a459-20e4b249d92b%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

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


Re: Structuring an API in a large project

2014-05-02 Thread Adam "Cezar" Jenkins
On Fri, May 2, 2014 at 10:44 AM, Scot Hacker  wrote:

> On Thursday, May 1, 2014 8:59:25 AM UTC-7, Cezar Jenkins wrote:
>>
>>
>> As you can guess, the views.py file is pretty big and I want to refactor
>> this out. Currently I have a few options in front of me, the one I'm
>> leaning towards is to put an 'api/v1' package into each app and use the api
>> app to tie all the urls together and hold views that don't fall into an app.
>>
>>
>>
> Hmm, I think the convention is to keep api code with each of your apps, so
> there shouldn't be a danger of anything getting too big / unwieldy:
>
> apps
> -- app1
> models.py
> views.py
> apiviews.py
> serializers.py
> -- app2
> models.py
> views.py
> apiviews.py
> serializers.py
>
> etc. import statements throughout the project are nice and readable. Works
> well for our (very large) project anyway.
>
> ./s
>
>
Thanks. I really like this.

>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/rizwdsi5o1k/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/eeeb2695-db81-42f6-9594-1d83d86641df%40googlegroups.com
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

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


Proper way to handle nested data (deeply nested)

2014-05-02 Thread Scott Harper
I am using django as a tool for editing data for a game I'm working on; but 
I have some pretty deeply-nested relationships, and I'm hitting some 
problems getting forms to work properly.

The setup:
I have a data structure for nodes in a map. Each map has many nodes; each 
node has many encounters; each encounter has many individual monster fights.

So the ownership I have set up is this:
Map
|-Node
||-Encounter
|||-Fight
|||-Fight
||-Encounter
|||-fight
|-Node
||-Encounter
|||-Fight
|||-Fight

...and so forth. I have tried setting up nested inline formsets (there are 
a couple examples online if you search them) and they worked fine to edit 
each encounter on each node on the map, but as soon as I tried turning the 
Encounter form into a nested inline formset (so a doubly-nested formset) I 
can SEE the data when I render the HTML, but when I try to submit the form 
data, I get a strange error in query.py when validating: line 115 (in 
version 1.6.0); self._result_cache isn't None, but it IS empty, so 
self._result_cache[k] is an invalid index.

The question:
I don't even know that I'm going about this the best way. So if I'm 
thinking about presenting my data all wrong, I welcome correction. If the 
means seems appropriate but I must be missing some check or other to ensure 
that I'm sending useable data.

I want to believe that there's a better way to handle this than hacking 
together two nested formsets, but I'm new enough at django and web 
frameworks that I'm not sure what my alternatives are.

I welcome any assistance that you folks can offer. Thank you.

-- Scott

(PS: I erroneously sent a partial message, for which I apologize.)

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


Re: Subjectively Required Fields

2014-05-02 Thread Nathan McCorkle
JQuery doesn't solve validation on the backend though, so you'd still want
some logic there in case someone modifies or goes around the jQuery and
sends packets with bad data.
On Apr 29, 2014 12:11 AM, "Venkatraman S"  wrote:

> What do you mean by an invalid date? IF you are referring to the date
> format, then why not enforce a jquery datepicker and let the user choose
> from it - which would make sure that specified date is 'clean'.
>
> If not the above, a closer look at clean() method would help you ;)
>
>
> On Mon, Apr 28, 2014 at 4:58 PM, Daniel Watkins <
> dwatkins.gc...@googlemail.com> wrote:
>
>> Hello all,
>>
>> We're running in to an interesting validation problem.  We have a model
>> which represents a (specific type of) date interval, bounded by a start
>> date and end date. Both fields are optional, but if end date is specified
>> then start date must be specified. We are creating an instance of this
>> using a ModelForm.
>>
>> We initially tried to do this with the model's clean method:
>>
>> def clean(self):
>> if self.end_date and not self.start_date:
>> raise ValidationError('Start date must be specified if an end
>> date is specified.')
>>
>> This works fine if start date is not specified. However, the error is
>> also shown if an invalid date is given, along with the "Invalid date"
>> message against the field. This isn't really what we want (as it's not
>> especially user-friendly).
>>
>> I'm pretty sure that this is because the form strips out the invalid date
>> from the data it puts in to the model before this is validated, though I'm
>> not 100% sure on this.
>>
>> Is there any way we can achieve what we want with model validation, or
>> will we have to put the logic in to the form?
>>
>>
>> Cheers,
>>
>> Dan
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/468dc535-c494-4418-86c7-c857f66d130d%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAN7tdFQCVFaTtpUrgBmYo-K70V03Qi2v%2BDU-kmo2UE71faeYsg%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Deployment of django project using setuptools

2014-05-02 Thread Tomáš Ehrlich
I've started experimenting with this idea and created simple app:

https://github.com/elvard/django-deploy

I would very appreciate any opinions, ideas or second thoughts.


Cheers,
   Tom


Dne pátek, 2. května 2014 19:13:30 UTC+2 Tomáš Ehrlich napsal(a):
>
> Hi there, 
> when I deploy my django projects I always run several commands after 
> pulling latest code from repository. I've started using setup.py few 
> weeks ago which adds manage.py script into $VENV/bin. 
>
> Basicaly, I always do: 
>
> source $VENV/bin/activate 
> export DJANGO_SETTINGS_MODULE=... 
>
> git pull 
> python setup.py install 
> manage.py syncdb --noinput 
> manage.py migrate 
> manage.py collectstatic --noinput 
> manage.py compilemessages 
>
>
> I wrote deployment scripts in fabric, salt, ansible, but now I'm 
> thinking that all these 'manage.py' actions should be part of setup 
> script. Anytime when would I run ``python setup.py install`` 
> the setup script would run all defined management commands so my 
> environment, database and other stuff stays up to date. 
>
>
> I've found that install command can be extended: 
>
> http://www.niteoweb.com/blog/setuptools-run-custom-code-during-install 
>
> I haven't found any references that anyone have used this method to 
> deploy django project, so I'm looking for anyone who tried this 
> approach before. 
>
>
> Thanks in advance 
>
> Cheers, 
>Tom 
>

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


Re: Proper way to handle nested data (deeply nested)

2014-05-02 Thread Scott Harper
Okay, so here's what I ended up going with:

Rather than nested inline form sets, I made a formset for all of the 
encounters related to the map. Then, in my template when I iterate across 
all the nodes, I'm comparing all the encounters' nodes with the current 
node, and from there adding each encounter to the HTML. It's working pretty 
well so far.

Now to get the monsters' forms working... but I think I have a decent 
enough idea of how to do that now.

-- Scott

On Friday, May 2, 2014 11:50:10 AM UTC-6, Scott Harper wrote:
>
> I am using django as a tool for editing data for a game I'm working on; 
> but I have some pretty deeply-nested relationships, and I'm hitting some 
> problems getting forms to work properly.
>
> The setup:
> I have a data structure for nodes in a map. Each map has many nodes; each 
> node has many encounters; each encounter has many individual monster fights.
>
> So the ownership I have set up is this:
> Map
> |-Node
> ||-Encounter
> |||-Fight
> |||-Fight
> ||-Encounter
> |||-fight
> |-Node
> ||-Encounter
> |||-Fight
> |||-Fight
>
> ...and so forth. I have tried setting up nested inline formsets (there are 
> a couple examples online if you search them) and they worked fine to edit 
> each encounter on each node on the map, but as soon as I tried turning the 
> Encounter form into a nested inline formset (so a doubly-nested formset) I 
> can SEE the data when I render the HTML, but when I try to submit the form 
> data, I get a strange error in query.py when validating: line 115 (in 
> version 1.6.0); self._result_cache isn't None, but it IS empty, so 
> self._result_cache[k] is an invalid index.
>
> The question:
> I don't even know that I'm going about this the best way. So if I'm 
> thinking about presenting my data all wrong, I welcome correction. If the 
> means seems appropriate but I must be missing some check or other to ensure 
> that I'm sending useable data.
>
> I want to believe that there's a better way to handle this than hacking 
> together two nested formsets, but I'm new enough at django and web 
> frameworks that I'm not sure what my alternatives are.
>
> I welcome any assistance that you folks can offer. Thank you.
>
> -- Scott
>
> (PS: I erroneously sent a partial message, for which I apologize.)
>

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


Re: I can't run django server nor activate the virtualenv

2014-05-02 Thread Lee
So it looks like its uninstalling the Django you already have installed in 
the global packages, in order to install the version specified in the 
requirements file, but is hitting a permissions error in doing so because 
you are not logged in as root (or elevating with sudo). I presume your 
virtualenv was set up using global site packages if its picking that up. So 
you have 2 options.

1) Elevate your permissions to delete the existing django in the site root 
with the following command (im not sure if you need to deactivate your 
virtualenv or not to do that since I never install anything globally):

*sudo pip uninstall django*
Enter your password when prompted

Then with your virtualenv activated try the previous command again:

*pip install -r requirements*

2) delete your virtualenv, and create a new one, specifying no site 
packages so you have an isolated virtualenv rather than the one you have 
now:

*rmvirtualenv env*

Then the following to create the new one, activate it and then install your 
requirements:

*mkvirtualenv --no-site-packages env*
*source activate* (from the bin folder as usual)
*pip install -r requirements*

Thanks

On Monday, 28 April 2014 11:03:40 UTC+1, Fred DJar wrote:
>
>
>
>
> *Hello guys, i'm a newbie so bear with me :)I have installed python 2.7 
> and django 1.6 on my desktop (ubuntu 14)but i can't run the application or 
> activate the virtualenv*
>
> *this is the message i got:*
> ubuntu@ubuntu:~/Downloads/saf$ python manage.py runserver
> Traceback (most recent call last):
>   File "manage.py", line 10, in 
> execute_from_command_line(sys.argv)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
> line 399, in execute_from_command_line
> utility.execute()
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
> line 392, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
> line 242, in run_from_argv
> self.execute(*args, **options.__dict__)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
> line 280, in execute
> translation.activate('en-us')
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/__init__.py",
>  
> line 130, in activate
> return _trans.activate(language)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
>  
> line 188, in activate
> _active.value = translation(language)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
>  
> line 177, in translation
> default_translation = _fetch(settings.LANGUAGE_CODE)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
>  
> line 159, in _fetch
> app = import_module(appname)
>   File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", 
> line 40, in import_module
> __import__(name)
>
>

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


Re: Proper way to handle nested data (deeply nested)

2014-05-02 Thread m1chael
This may or may not work for you, but did you see
https://github.com/tabo/django-treebeard/ ?



On Fri, May 2, 2014 at 6:17 PM, Scott Harper  wrote:
> Okay, so here's what I ended up going with:
>
> Rather than nested inline form sets, I made a formset for all of the
> encounters related to the map. Then, in my template when I iterate across
> all the nodes, I'm comparing all the encounters' nodes with the current
> node, and from there adding each encounter to the HTML. It's working pretty
> well so far.
>
> Now to get the monsters' forms working... but I think I have a decent enough
> idea of how to do that now.
>
> -- Scott
>
>
> On Friday, May 2, 2014 11:50:10 AM UTC-6, Scott Harper wrote:
>>
>> I am using django as a tool for editing data for a game I'm working on;
>> but I have some pretty deeply-nested relationships, and I'm hitting some
>> problems getting forms to work properly.
>>
>> The setup:
>> I have a data structure for nodes in a map. Each map has many nodes; each
>> node has many encounters; each encounter has many individual monster fights.
>>
>> So the ownership I have set up is this:
>> Map
>> |-Node
>> ||-Encounter
>> |||-Fight
>> |||-Fight
>> ||-Encounter
>> |||-fight
>> |-Node
>> ||-Encounter
>> |||-Fight
>> |||-Fight
>>
>> ...and so forth. I have tried setting up nested inline formsets (there are
>> a couple examples online if you search them) and they worked fine to edit
>> each encounter on each node on the map, but as soon as I tried turning the
>> Encounter form into a nested inline formset (so a doubly-nested formset) I
>> can SEE the data when I render the HTML, but when I try to submit the form
>> data, I get a strange error in query.py when validating: line 115 (in
>> version 1.6.0); self._result_cache isn't None, but it IS empty, so
>> self._result_cache[k] is an invalid index.
>>
>> The question:
>> I don't even know that I'm going about this the best way. So if I'm
>> thinking about presenting my data all wrong, I welcome correction. If the
>> means seems appropriate but I must be missing some check or other to ensure
>> that I'm sending useable data.
>>
>> I want to believe that there's a better way to handle this than hacking
>> together two nested formsets, but I'm new enough at django and web
>> frameworks that I'm not sure what my alternatives are.
>>
>> I welcome any assistance that you folks can offer. Thank you.
>>
>> -- Scott
>>
>> (PS: I erroneously sent a partial message, for which I apologize.)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6a63e607-14ef-4b4b-af5e-d2bfa3277a3a%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

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


Re: I can't run django server nor activate the virtualenv

2014-05-02 Thread Fred DJar
Trying your first solution gave me this error messages !




And trying the second solution gave me the message that rmvirtualenv : 
command not found !


On Friday, 2 May 2014 23:26:43 UTC+1, Lee wrote:
>
> So it looks like its uninstalling the Django you already have installed in 
> the global packages, in order to install the version specified in the 
> requirements file, but is hitting a permissions error in doing so because 
> you are not logged in as root (or elevating with sudo). I presume your 
> virtualenv was set up using global site packages if its picking that up. So 
> you have 2 options.
>
> 1) Elevate your permissions to delete the existing django in the site root 
> with the following command (im not sure if you need to deactivate your 
> virtualenv or not to do that since I never install anything globally):
>
> *sudo pip uninstall django*
> Enter your password when prompted
>
> Then with your virtualenv activated try the previous command again:
>
> *pip install -r requirements*
>
> 2) delete your virtualenv, and create a new one, specifying no site 
> packages so you have an isolated virtualenv rather than the one you have 
> now:
>
> *rmvirtualenv env*
>
> Then the following to create the new one, activate it and then install 
> your requirements:
>
> *mkvirtualenv --no-site-packages env*
> *source activate* (from the bin folder as usual)
> *pip install -r requirements*
>
> Thanks
>
> On Monday, 28 April 2014 11:03:40 UTC+1, Fred DJar wrote:
>>
>>
>>
>>
>> *Hello guys, i'm a newbie so bear with me :)I have installed python 2.7 
>> and django 1.6 on my desktop (ubuntu 14)but i can't run the application or 
>> activate the virtualenv*
>>
>> *this is the message i got:*
>> ubuntu@ubuntu:~/Downloads/saf$ python manage.py runserver
>> Traceback (most recent call last):
>>   File "manage.py", line 10, in 
>> execute_from_command_line(sys.argv)
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
>> line 399, in execute_from_command_line
>> utility.execute()
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
>> line 392, in execute
>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
>> line 242, in run_from_argv
>> self.execute(*args, **options.__dict__)
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
>> line 280, in execute
>> translation.activate('en-us')
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/__init__.py",
>>  
>> line 130, in activate
>> return _trans.activate(language)
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
>>  
>> line 188, in activate
>> _active.value = translation(language)
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
>>  
>> line 177, in translation
>> default_translation = _fetch(settings.LANGUAGE_CODE)
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
>>  
>> line 159, in _fetch
>> app = import_module(appname)
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 
>> 40, in import_module
>> __import__(name)
>>
>>

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


Re: I can't run django server nor activate the virtualenv

2014-05-02 Thread Lee
Whoops sorry, should have thought, rmvirtualenv and mkvirtualenv come with 
virtualenvwrapper, not the default virtualenv...

Regarding the first error, was that the whole error or was there some more 
after where the screenshot cut off? Looks like it tried to install django 
that time so I guess the uninstall of the global version helped to some 
extent. 

Regarding the second option, ignore deleting the existing virtualenv 
(though you can just delete the original directories it created for it if 
you like) for now and just create a new one with a different name with the 
following:

*virtualenv --no-site-packages newenvname*

activate it as before then try running *pip install -r requirements *again  

On Saturday, 3 May 2014 00:23:03 UTC+1, Fred DJar wrote:
>
> Trying your first solution gave me this error messages !
>
>
>
> 
>
> And trying the second solution gave me the message that rmvirtualenv : 
> command not found !
>
>
> On Friday, 2 May 2014 23:26:43 UTC+1, Lee wrote:
>>
>> So it looks like its uninstalling the Django you already have 
>> installed in the global packages, in order to install the version specified 
>> in the requirements file, but is hitting a permissions error in doing 
>> so because you are not logged in as root (or elevating with sudo). I 
>> presume your virtualenv was set up using global site packages if its 
>> picking that up. So you have 2 options.
>>
>> 1) Elevate your permissions to delete the existing django in the site 
>> root with the following command (im not sure if you need to deactivate your 
>> virtualenv or not to do that since I never install anything globally):
>>
>> *sudo pip uninstall django*
>> Enter your password when prompted
>>
>> Then with your virtualenv activated try the previous command again:
>>
>> *pip install -r requirements*
>>
>> 2) delete your virtualenv, and create a new one, specifying no site 
>> packages so you have an isolated virtualenv rather than the one you have 
>> now:
>>
>> *rmvirtualenv env*
>>
>> Then the following to create the new one, activate it and then install 
>> your requirements:
>>
>> *mkvirtualenv --no-site-packages env*
>> *source activate* (from the bin folder as usual)
>> *pip install -r requirements*
>>
>> Thanks
>>
>> On Monday, 28 April 2014 11:03:40 UTC+1, Fred DJar wrote:
>>>
>>>
>>>
>>>
>>> *Hello guys, i'm a newbie so bear with me :)I have installed python 2.7 
>>> and django 1.6 on my desktop (ubuntu 14)but i can't run the application or 
>>> activate the virtualenv*
>>>
>>> *this is the message i got:*
>>> ubuntu@ubuntu:~/Downloads/saf$ python manage.py runserver
>>> Traceback (most recent call last):
>>>   File "manage.py", line 10, in 
>>> execute_from_command_line(sys.argv)
>>>   File 
>>> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
>>>  
>>> line 399, in execute_from_command_line
>>> utility.execute()
>>>   File 
>>> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
>>>  
>>> line 392, in execute
>>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>>   File 
>>> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
>>> line 242, in run_from_argv
>>> self.execute(*args, **options.__dict__)
>>>   File 
>>> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
>>> line 280, in execute
>>> translation.activate('en-us')
>>>   File 
>>> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/__init__.py",
>>>  
>>> line 130, in activate
>>> return _trans.activate(language)
>>>   File 
>>> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
>>>  
>>> line 188, in activate
>>> _active.value = translation(language)
>>>   File 
>>> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
>>>  
>>> line 177, in translation
>>> default_translation = _fetch(settings.LANGUAGE_CODE)
>>>   File 
>>> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
>>>  
>>> line 159, in _fetch
>>> app = import_module(appname)
>>>   File 
>>> "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 
>>> 40, in import_module
>>> __import__(name)
>>>
>>>

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


Working with ModelForms

2014-05-02 Thread LaPerl
Hi all,

I have 5 different models all with relations with themselves. I want to use 
ModelForm to generate a form that will contain fields of all these models. 
I read and read, I tried different things to do this (inheritance, 
subclassing...) and then use the class based views to do CRUD with the 
object that contains the fields that I want to show to the user. I don't 
want to use FBV, but I am thinking that this i not possible, is that true?

Maybe I don't understand how does it works, please someone that put me in 
the right way.

Thank you very much

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


[no subject]

2014-05-02 Thread Igor Korot
Hi, ALL,
This is my first official post here so be gentle... ;-)

I'm trying to make an application based on the following db structure:

table 1: id - primary key, fname char(40), lname char(40)
table 2: id - primary key, position char(20)
table 3: table1_id, table2_id - foreign key

Now, from what I understand Django does not work well with tables
without PK. So in order to make it around it just makes a bogus
primary key in the table called id.

What I'd like to know is this: there is no point of creating a PK for
a table 3. In fact it is wrong as it completely destroys the purpose
of the db schema.
Can I prevent the creation of the PK in this one table somehow? If its
not possible, is there a place where I can submit this as a
bug/feature request?

Thank you for any help.

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