Re: Massive import from CSV to Database

2011-11-13 Thread Fabio Natali

On 11/12/2011 08:25 PM, Dan Poirier wrote:

There are some ways to make large data imports much faster.  See e.g.

   http://www.caktusgroup.com/blog/2011/09/20/bulk-inserts-django/


Hi Dan!

Import speed was not my primary concern during these first attempts. I 
thought that django-csv-importer would "Just Work (TM)".


According to your and Andre's reply I'll probably have to change my mind 
and work out a custom solution with bulkopt.py or something similar.


Thank you very much. Fabio.

--
Fabio Natali

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



Re: Massive import from CSV to Database

2011-11-13 Thread Fabio Natali

On 11/13/2011 08:38 AM, Fabio Natali wrote:
[...]

Here is my try:

###
from django.db import models
from csvImporter.model import CsvModel

class MyCsvModel(CsvModel):
name = models.CharField()
age = models.IntegerField()
length = models.FloatField()
class Meta:
delimiter = ";"

my_csv_list = MyCsvModel.import_data(data = open("file.csv"))
###


My fault! Here comes the correct version:

###
from csvImporter import fields
from csvImporter.model import CsvModel

class MyCsvModel(CsvModel):
name = fields.CharField()
age = fields.IntegerField()
length = fields.FloatField()
class Meta:
delimiter = ";"
###

Thanks to pyhoster who helped me in spotting out the mistake! And thanks 
to Anthony Tresontani for providing django-csv-importer!


Now that I managed to make it work, I'll have some speed tests and 
decide if this solution really fits my needs.


Bye!!

--
Fabio Natali

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



Re: [] Re: memcached - Errors and Solution - please provide comments!

2011-11-13 Thread ionic drive
Hello and thanks for the respond.

My knowledge on caching was little. I used it, but I never programmed it
my self. So I had no idea about how the keys would be stored.

The solution was... I did not mess with my memcached.py or anything
else. I just use it as everybody else is using it.

The problem was in my code. The keys where sometimes too long and '\n'
new line characters got inserted. But control characters are not
allowed.

Don't kill me know... I was thinking come one, maybe the guy who was
writing this bit of code had similar troubles and already corrected it.
I know this should have been the first approach but for some reason I
had the feeling that he did not see this sort of troubles.

### Code 
But he saw it and fixed it already:
---
key = 'base_text' + sha1(url).hexdigest()
### /Code 

so now there are no more troubles with long urls as keys.
Sorry for the noise!

Maybe some noobs (and me!) learned something!

Best wishes
ionic


On Sun, 2011-11-13 at 03:35 +, Cal Leeming [Simplicity Media Ltd]
wrote:
> +1 on hashing the key.
> 
> 
> Just my two cents worth but, the way our company does it as standard
> is something like this:
> 
> 
> import hashlib
> def generate_key(*args, **kwargs):
> return hashlib.sha224(pickle.dumps([args, kwargs])).hexdigest()
> 
> 
> Then you can do stuff like:
> lol = YourModel.objects.all()[0]
> generate_key('YourModel', lol.id, 'other stuff')
> 
> 
> We actually have a replacement caching class which does all this stuff
> behind the scenes that uses this approach, been doing this for almost
> a year with not a single problem so far (although ours still uses md5,
> rather than sha224)
> 
> 
> Cal
> 
> 
> 
> On Thu, Nov 10, 2011 at 12:07 PM, Henrik Genssen
>  wrote:
> Hi inonc,
> 
> >Why am I the only one who seems to be faced with such issues?
> >I thought millions out there do use memcached as their
> backend...?
> >Wouldn't be MD5 a great solution to all of us? The guys with
> small
> >sites, don't have issues with scaling, and the guys with big
> sites are
> >in the need of a stable memcached backend.
> >
> >Thanks for your help
> >ionic
> 
> 
> this is a question I stopped asking my self.
> We inherited the cache-module and overwrote simply the
> problematic function, where the key are generated (also to
> support caching POST requests).
> I was tiered, discussing the need for this (e.g. for XMLRPC
> requests - as 2 + 2 might always be 4 :-)
> 
> regards
> 
> Henrik
> 
> 
> --
> You received this message because you are subscribed to the
> Google Groups "Django users" group.
> To post to this group, send email to
> django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users
> +unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
> 
> 
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users
> +unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.


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



Re: Massive import from CSV to Database

2011-11-13 Thread Fabio Natali

On 11/12/2011 07:40 PM, Andre Terra wrote:

Hello,  Fabio

I took a look at django-csv-importer but since my files weren't quite
clean (or comma separated), I ended up rolling my own solution using
celery[1], to make the uploading rask asynchronous, and DSE[2], to allow
for faster bulk imports, as well as a lot of trial and error.

Take a look at those libraries as they may help you in rolling out your
own solution as well. Let be know if you need more pointers!


Hi again Andre!

I am having a look at those libraries. As for reading data from a CSV 
file, what's your tip? Should I rely on the CSV read/write capabilities 
that come with Python Standard Library?


Cheers! Fabio.

--
Fabio Natali

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



Re: How many read operations is the get() method causing?

2011-11-13 Thread Daniel Roseman
On Saturday, 12 November 2011 23:04:44 UTC, Emil Sandin wrote:
>
> Hi, I am running a Django app on appengine, but I am constantly 
> hitting the roof with read operations. 
> I have not found an easy way to find what's causing this, so I am 
> trying to find it out myself. 
> To me, it seems that even if I use all().filter(..) or get(), the 
> database is queried for all instances. 
>
> I wrote a custom manager like this: 
>
> class LoggingManager(models.Manager): 
> def get_query_set(self): 
> query_set = super(SignalsManager, self).get_query_set() 
> logging.debug("Got the following queryset from the backend:") 
> logging.debug(query_set) 
> if query_set.count(): 
> key = "num_of_reads_for_" + str(type(query_set[0])) 
> num_of_calls_so_far = memcache.get(key) or 0 
> num_of_calls_so_far += query_set.count() 
> memcache.delete(key) 
> memcache.add(key, num_of_calls_so_far ) 
> logging.debug("++") 
> logging.debug("total number of reads for " + key) 
> logging.debug(num_of_calls_so_far) 
> logging.debug("--") 
> return query_set 
>
> I then created a class: 
>
> class Foo(models.Model): 
> bar = models.CharField(max_length=10) 
> objects = LoggingManager() 
>
> When I tried this in the shell I got: 
>
> >>> Foo(bar="Hi").save() 
> >>> Foo(bar="there").save() 
> >>> Foo.objects.get(bar="Hi") 
> DEBUG:root:Got the following queryset from the backend: 
> DEBUG:root:[, ] 
> DEBUG:root:++ 
> DEBUG:root:total number of reads for num_of_reads_for_ 'models.Foo'> 
> DEBUG:root:2 
> DEBUG:root:-- 
>  
> >>> Foo.objects.all().filter(bar="Hi") 
> DEBUG:root:Got the following queryset from the backend: 
> DEBUG:root:[, ] 
> DEBUG:root:++ 
> DEBUG:root:total number of reads for num_of_reads_for_ 'models.Foo'> 
> DEBUG:root:4 
> DEBUG:root:-- 
> [] 
> >>> Foo.objects.all().filter(bar="NotExisting") 
> DEBUG:root:Got the following queryset from the backend: 
> DEBUG:root:[, ] 
> DEBUG:root:++ 
> DEBUG:root:total number of reads for num_of_reads_for_ 'models.Foo'> 
> DEBUG:root:6 
> DEBUG:root:-- 
> [] 
>
> According to the Django documentation, 'the act of creating a QuerySet 
> doesn't involve any database activity'. 
> But since the queryset contains two instances of Foo object when I use 
> the get() method or all().filter(), isn't the database queried for all 
> Foo instances? And then the queryset is filtered? 
> Am I doing something wrong here? Is there a better way to do this? 
> And does anybody know how this would affect App Engines Quote Details, 
> since they have a limit of number of operations? 
>
> I am using: 
> Python 2.5.1, 
> Django (1, 3, 0, 'alpha', 1)


This message is probably off-topic for this list, as Django running on 
AppEngine is not really the same as Django standalone - it depends on 
django-nonrel to talk to the nonrelational datastore, so database behaviour 
is very different. You would probably be better off asking on a specific 
django-nonrel mailing list.

In ordinary Django, each call to LoggingManager would result in a single 
database hit, which would be executed when it reaches the first logging 
call, since in order to output the string representation of the QuerySet 
Django would need to actually evaluate it. The call to type(query_set[0]) 
would not cause another hit, because Django has already stored the values 
inside the QuerySet's internal cache.

Clearly django-nonrel is doing something different here, but I don't have 
enough experience with it to tell you what. I can say that in plain 
AppEngine, without Django, you can call `queryset.kind()` to get the 
queryset's model without any database access, but I don't know if that will 
work with django-nonrel.
--
DR.

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



Re: MVP--an open source repository for libraries and modules

2011-11-13 Thread Stuart Laughlin
http://www.acronymfinder.com/MVP.html ?

On Nov 12, 9:04 am, skier31415  wrote:
> I'm a coder, but I don't code for the majority of my time.  What I do
> is identify, install, employ, and adapt mostly working solutions.  I
> stand on the shoulders of giants.  There are very few good ways to
> identify these solutions.  The top on my list is "how flashy is the
> site", and "how extensive is the documentation".  Not necessarily the
> best metrics.  I want to curate and peer review open source code.
> It's called Open Include.
>
> I'm looking for help creating an MVP for this site.  I have my design
> docs in place, and have a front end developer.  I am an algorithm
> developer--check out my work at deterministicprogramming.com  We need
> help with django specifically.
>
> Thank you very much,
> Bill Dvorak
>
> --
>
> William Dvorak
>
> Algorithms Consultant
> Deterministic Programming
> deterministicprogramming.com

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



direct insert to intermediary table

2011-11-13 Thread SElsner
Hello,

I am moving data from a ODBC source to Django. This works well with
models explicitly defined. But how would I create records directly for
the (implicit) intermediary ManyToMany relationship table?

Cheers

Sebastian

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



include() combined with login_required()

2011-11-13 Thread Gelonida N
Hi,


I wondered whether (and if yes how) I can combine
login_required and include() in my urls.py file


Basically I'd like to require login for every url belonging to a certain
application.


currently urls.py looks like:


from django.conf.urls.defaults import patterns, include, url
from django.contrib.auth.decorators import login_required


urlpatterns = patterns('',
url(r'^secured_app/', include('secured_app.urls')),
. .  .
)


I tried to change it to
urlpatterns = patterns('',
url(r'^secured_app/', login_required(
include('secured_app.urls'))),
. .  .
)


I now get the login pronpt, but afterwards django errors of the kind.


'tuple' object is not callable


So obviously I must do it differntly.

What is the correct way of requestiong authentification for an entire
app without having to decorate each entry in the apps url.py file.

Thanks a lot for suggestions.






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



a class that defines __slots__ without defining __getstate__ cannot be pickled

2011-11-13 Thread Gelonida N
Hi,

I have now an error message showing up when accessing the django admin
interface for some of my models. Fails already at the front page

The main problem, that I have is, that the stack trace does not relate
to any line of my code, so I'm alittle at a loss how to fix it.


The stack trace is:

Traceback (most recent call last):
  File "/usr/lib/python2.6/logging/handlers.py", line 541, in emit
s = self.makePickle(record)
  File "/usr/lib/python2.6/logging/handlers.py", line 511, in makePickle
s = cPickle.dumps(record.__dict__, 1)
  File "/opt/mh_python/lib/python2.6/copy_reg.py", line 77, in _reduce_ex
raise TypeError("a class that defines __slots__ without "
TypeError: a class that defines __slots__ without defining __getstate__
cannot be pickled


I think the issue might be related to the fact, that I am using a socket
logger and that socket logging tries to pickle the log record.
Perhaps the admin interface adds args to a log record, that cannot be
pickled?


Ther admin interface seems to work, but I don't really like having back
traces, that I don't understand in my logs.



How to best continue locating the root cause?




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



Which Linux distro to use on EC2?

2011-11-13 Thread ydjango
I am setting up nginex, apache, python django, mysql based application
on EC2. I expect high web traffic and high mysql query usage. Mysql
and web server will on seperate servers.

Which linux distro should I use for heavy production use - Ubuntu,
Centos or Debian?

Does it matter?

I see most instructions on web is using Ubuntu and it seems it is
considered easiest to set up. But I read somewhere that Ubuntu is not
for server use. What is the downside if I chose ubuntu?

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



setting up openlayers proxy.cgi

2011-11-13 Thread Daryl
I need to know how to setup a proxy.cgi script  on my Local Django
Development setup and can't seem to find the right information to do
it.
The closest i've gotten to running any cgi script is when it just
displays the source code on the webpage...which isn't exactly
'running' is it?
Is it ok to run a cgi server and the Django runserver at the same
time? Is that the problem?
I'd really appreciate any help with this as its taken up a lot of my
time and I need the proxy setup for an Openlayers project. Yes, I did
try and post this question on Geodjango Users, but didn't even get it
published...

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



Re: MVP--an open source repository for libraries and modules

2011-11-13 Thread Kurtis Mullins
Im assuming he means Model View Presentation because of the Django Context.
On Nov 13, 2011 8:53 AM, "Stuart Laughlin"  wrote:

> http://www.acronymfinder.com/MVP.html ?
>
> On Nov 12, 9:04 am, skier31415  wrote:
> > I'm a coder, but I don't code for the majority of my time.  What I do
> > is identify, install, employ, and adapt mostly working solutions.  I
> > stand on the shoulders of giants.  There are very few good ways to
> > identify these solutions.  The top on my list is "how flashy is the
> > site", and "how extensive is the documentation".  Not necessarily the
> > best metrics.  I want to curate and peer review open source code.
> > It's called Open Include.
> >
> > I'm looking for help creating an MVP for this site.  I have my design
> > docs in place, and have a front end developer.  I am an algorithm
> > developer--check out my work at deterministicprogramming.com  We need
> > help with django specifically.
> >
> > Thank you very much,
> > Bill Dvorak
> >
> > --
> >
> > William Dvorak
> >
> > Algorithms Consultant
> > Deterministic Programming
> > deterministicprogramming.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: Which Linux distro to use on EC2?

2011-11-13 Thread Charles Cossé
The main difference with Ubuntu is that it's a binary distribution
(pre-compiled binaries for a standardized platform).  I use Gentoo,
personally, which is a variant of Debian with "portage" rather than "apt".
  LAMP server stuff is readily available on all distros of Linux.  If
you're hardcore then use Gentoo.  If you're medium-core then use Debian.
 If you're softcore then use Ubuntu.  If you like RedHat style more than
Debian, then go CentOS.  Whichever you choose, you'll immediately need to
familiarize yourself with it's package manager and how things are done on
that platform.  good luck :-)

On Sun, Nov 13, 2011 at 12:56 PM, ydjango  wrote:

> I am setting up nginex, apache, python django, mysql based application
> on EC2. I expect high web traffic and high mysql query usage. Mysql
> and web server will on seperate servers.
>
> Which linux distro should I use for heavy production use - Ubuntu,
> Centos or Debian?
>
> Does it matter?
>
> I see most instructions on web is using Ubuntu and it seems it is
> considered easiest to set up. But I read somewhere that Ubuntu is not
> for server use. What is the downside if I chose ubuntu?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
AsymptopiaSoftware|Software@theLimit
  http://www.asymptopia.org

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



point url with folder to s3

2011-11-13 Thread ydjango
I have all my static being served from https://www.example.com/media/

in my code I have all images pointing to /media all over the code.
for example: 

Is there a way I can point it to use S3 and cloudfront to serve the
static files.

My understanding is that I cannot use CNAME. If I was using
media.example.com instead of www.example.com/media, I could have used
CNAME.

Any other solution? (without requiring me to change all the instances
of /media in all my code)

I use nginx and apache and django 1.1.x. (I will be upgrading Django
soon if ORM performance does not become an issue.)

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



Admin Change List: Display Foreign Keys as Links to Related Change Form

2011-11-13 Thread Lee
This has gotta be easy but I'm not finding a solution in this list or
snippets: how do I make Admin display foreign keys on change lists as
links to the related record's change form? The displayed value is
correct I just need it to be a hyperlink.

Thanks for any help-

Lee

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



Re: point url with folder to s3

2011-11-13 Thread Justin Steward
On Mon, Nov 14, 2011 at 8:47 AM, ydjango  wrote:
> I have all my static being served from https://www.example.com/media/
>
> in my code I have all images pointing to /media all over the code.
> for example: 
>
> Is there a way I can point it to use S3 and cloudfront to serve the
> static files.
>
> My understanding is that I cannot use CNAME. If I was using
> media.example.com instead of www.example.com/media, I could have used
> CNAME.
>
> Any other solution? (without requiring me to change all the instances
> of /media in all my code)
>
> I use nginx and apache and django 1.1.x. (I will be upgrading Django
> soon if ORM performance does not become an issue.)
>

If updating the code is out of the question, then why not put a
redirect into the apache or nginx conf, something along the lines of
(untested, for nginx. Look up modrewrite to do this in your apache
conf):

server {
  listen 80;
  server_name www.example.com;
  rewrite /media/(.*)
http://domain.of.external.media.com/path/to/media/$1 permanent;
  # the rest of your nginx conf here
}

And then take your time to replace references to /media in your code,
because you really should anyway.

You should probably be using a variable in your code for media
location in the future, so you only have to change /media once. Isn't
there a variable in the settings explicitly for the url of static
media?

~Justin

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



The name of my User

2011-11-13 Thread chronosx7
Hi, I am new to dJango an now I need to get the name of the user that
authenticated before the execution of the Save method but I can't seem
to find any way to accomplish this.

Does anyone know how to do this?

Thanks for your help

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



Re: Which Linux distro to use on EC2?

2011-11-13 Thread Casey Greene
I would suggest that you use whatever your sysadmin (or if no sysadmin, 
developer (or if it's just you, you)) are most familiar with.  I assume 
the packages that you are using (at least the ones you've listed) will 
be in the package management systems for any of the distros that you 
have listed.


I'm also pretty sure that gentoo is not a variant of debian.

Casey

On 11/13/2011 03:58 PM, Charles Cossé wrote:

The main difference with Ubuntu is that it's a binary distribution
(pre-compiled binaries for a standardized platform).  I use Gentoo,
personally, which is a variant of Debian with "portage" rather than
"apt".   LAMP server stuff is readily available on all distros of Linux.
  If you're hardcore then use Gentoo.  If you're medium-core then use
Debian.  If you're softcore then use Ubuntu.  If you like RedHat style
more than Debian, then go CentOS.  Whichever you choose, you'll
immediately need to familiarize yourself with it's package manager and
how things are done on that platform.  good luck :-)

On Sun, Nov 13, 2011 at 12:56 PM, ydjango mailto:neerash...@gmail.com>> wrote:

I am setting up nginex, apache, python django, mysql based application
on EC2. I expect high web traffic and high mysql query usage. Mysql
and web server will on seperate servers.

Which linux distro should I use for heavy production use - Ubuntu,
Centos or Debian?

Does it matter?

I see most instructions on web is using Ubuntu and it seems it is
considered easiest to set up. But I read somewhere that Ubuntu is not
for server use. What is the downside if I chose ubuntu?

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




--
AsymptopiaSoftware|Software@theLimit
http://www.asymptopia.org

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


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



Re: Which Linux distro to use on EC2?

2011-11-13 Thread Joey Espinosa
No, Gentoo is not a variant of Debian.

I also don't think there are variants that are for "hardcore" users more
than others. If you're "hardcore", then you should be able to do things
like write your own kernel modules and perform low-level disk operations no
matter the distro.

I personally love Ubuntu on EC2. The ami/ec2 tools are in the repository by
default, and are updated regularly. If you use the official AMIs from
Canonical, then you'll get a setup that is optimized for EC2 without you
having to do anything extra (for instance, "byobu" runs automatically when
you connect via SSH).

In the end, it all really depends on you. As Casey mentioned, you are
probably better off with what you're already familiar with. After all, what
good is the "best" OS if you're more familiar with the "good enough" OS?
You'll be more productive with what you are comfortable managing. I'm
familiar with many distros (certified in Red Hat & Solaris, and long time
Gentoo user), but I go with Ubuntu on EC2 every time.

Hope this helped.

--
Joey "JoeLinux" Espinosa
Software Developer
http://about.me/joelinux
On Nov 13, 2011 7:10 PM, "Casey Greene"  wrote:

> I would suggest that you use whatever your sysadmin (or if no sysadmin,
> developer (or if it's just you, you)) are most familiar with.  I assume the
> packages that you are using (at least the ones you've listed) will be in
> the package management systems for any of the distros that you have listed.
>
> I'm also pretty sure that gentoo is not a variant of debian.
>
> Casey
>
> On 11/13/2011 03:58 PM, Charles Cossé wrote:
>
>> The main difference with Ubuntu is that it's a binary distribution
>> (pre-compiled binaries for a standardized platform).  I use Gentoo,
>> personally, which is a variant of Debian with "portage" rather than
>> "apt".   LAMP server stuff is readily available on all distros of Linux.
>>  If you're hardcore then use Gentoo.  If you're medium-core then use
>> Debian.  If you're softcore then use Ubuntu.  If you like RedHat style
>> more than Debian, then go CentOS.  Whichever you choose, you'll
>> immediately need to familiarize yourself with it's package manager and
>> how things are done on that platform.  good luck :-)
>>
>> On Sun, Nov 13, 2011 at 12:56 PM, ydjango > > wrote:
>>
>>I am setting up nginex, apache, python django, mysql based application
>>on EC2. I expect high web traffic and high mysql query usage. Mysql
>>and web server will on seperate servers.
>>
>>Which linux distro should I use for heavy production use - Ubuntu,
>>Centos or Debian?
>>
>>Does it matter?
>>
>>I see most instructions on web is using Ubuntu and it seems it is
>>considered easiest to set up. But I read somewhere that Ubuntu is not
>>for server use. What is the downside if I chose ubuntu?
>>
>>--
>>You received this message because you are subscribed to the Google
>>Groups "Django users" group.
>>To post to this group, send email to django-users@googlegroups.com
>>> >.
>>To unsubscribe from this group, send email to
>>
>> django-users+unsubscribe@**googlegroups.com
>>
>> > **>.
>>For more options, visit this group at
>>
>> http://groups.google.com/**group/django-users?hl=en
>> .
>>
>>
>>
>>
>> --
>> AsymptopiaSoftware|Software@**theLimit
>> http://www.asymptopia.org
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscribe@**googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/**group/django-users?hl=en
>> .
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@**
> googlegroups.com .
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en
> .
>
>

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



Re: Which Linux distro to use on EC2?

2011-11-13 Thread Kurtis Mullins
I don't have a recommendation on a specific distribution -- that's really a
matter of personal taste and experience. However, try to go with a
free-tier instance until you really need to upgrade. There are only certain
images that can be used with that free-tier. It's a pretty good deal! I've
used both Amazon's CentOS based Distribution and Ubuntu on it -- I prefer
Ubuntu, coming from a Debian backend. CentOS has quite a bit of a server
community as well, though.

On Sun, Nov 13, 2011 at 7:22 PM, Joey Espinosa wrote:

> No, Gentoo is not a variant of Debian.
>
> I also don't think there are variants that are for "hardcore" users more
> than others. If you're "hardcore", then you should be able to do things
> like write your own kernel modules and perform low-level disk operations no
> matter the distro.
>
> I personally love Ubuntu on EC2. The ami/ec2 tools are in the repository
> by default, and are updated regularly. If you use the official AMIs from
> Canonical, then you'll get a setup that is optimized for EC2 without you
> having to do anything extra (for instance, "byobu" runs automatically when
> you connect via SSH).
>
> In the end, it all really depends on you. As Casey mentioned, you are
> probably better off with what you're already familiar with. After all, what
> good is the "best" OS if you're more familiar with the "good enough" OS?
> You'll be more productive with what you are comfortable managing. I'm
> familiar with many distros (certified in Red Hat & Solaris, and long time
> Gentoo user), but I go with Ubuntu on EC2 every time.
>
> Hope this helped.
>
> --
> Joey "JoeLinux" Espinosa
> Software Developer
> http://about.me/joelinux
> On Nov 13, 2011 7:10 PM, "Casey Greene"  wrote:
>
>> I would suggest that you use whatever your sysadmin (or if no sysadmin,
>> developer (or if it's just you, you)) are most familiar with.  I assume the
>> packages that you are using (at least the ones you've listed) will be in
>> the package management systems for any of the distros that you have listed.
>>
>> I'm also pretty sure that gentoo is not a variant of debian.
>>
>> Casey
>>
>> On 11/13/2011 03:58 PM, Charles Cossé wrote:
>>
>>> The main difference with Ubuntu is that it's a binary distribution
>>> (pre-compiled binaries for a standardized platform).  I use Gentoo,
>>> personally, which is a variant of Debian with "portage" rather than
>>> "apt".   LAMP server stuff is readily available on all distros of Linux.
>>>  If you're hardcore then use Gentoo.  If you're medium-core then use
>>> Debian.  If you're softcore then use Ubuntu.  If you like RedHat style
>>> more than Debian, then go CentOS.  Whichever you choose, you'll
>>> immediately need to familiarize yourself with it's package manager and
>>> how things are done on that platform.  good luck :-)
>>>
>>> On Sun, Nov 13, 2011 at 12:56 PM, ydjango >> > wrote:
>>>
>>>I am setting up nginex, apache, python django, mysql based application
>>>on EC2. I expect high web traffic and high mysql query usage. Mysql
>>>and web server will on seperate servers.
>>>
>>>Which linux distro should I use for heavy production use - Ubuntu,
>>>Centos or Debian?
>>>
>>>Does it matter?
>>>
>>>I see most instructions on web is using Ubuntu and it seems it is
>>>considered easiest to set up. But I read somewhere that Ubuntu is not
>>>for server use. What is the downside if I chose ubuntu?
>>>
>>>--
>>>You received this message because you are subscribed to the Google
>>>Groups "Django users" group.
>>>To post to this group, send email to django-users@googlegroups.com
>>>>> >.
>>>To unsubscribe from this group, send email to
>>>
>>> django-users+unsubscribe@**googlegroups.com
>>>
>>> >> **>.
>>>For more options, visit this group at
>>>
>>> http://groups.google.com/**group/django-users?hl=en
>>> .
>>>
>>>
>>>
>>>
>>> --
>>> AsymptopiaSoftware|Software@**theLimit
>>> http://www.asymptopia.org
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+unsubscribe@**googlegroups.com
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/**group/django-users?hl=en
>>> .
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to django-users+unsubscribe@**
>> googlegroups.com .
>> For more options, visit this group at http://groups.google.com/**
>> group/django-users?hl=en

Re: runserver namespace problem?

2011-11-13 Thread Ken
Does anybody have any idea?

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



Re: Which Linux distro to use on EC2?

2011-11-13 Thread ydjango
I was concerned that Ubuntu being a desktop OS might have some
limitations which CENTOS or Debian being Server OS might not have.
Based on answers so far, looks like all the distributions are quite
close and my concern about ubuntu is unfounded. If it is all matter
taste then I will go with Ubuntu.

thanks everyone.


On Nov 13, 5:01 pm, Kurtis Mullins  wrote:
> I don't have a recommendation on a specific distribution -- that's really a
> matter of personal taste and experience. However, try to go with a
> free-tier instance until you really need to upgrade. There are only certain
> images that can be used with that free-tier. It's a pretty good deal! I've
> used both Amazon's CentOS based Distribution and Ubuntu on it -- I prefer
> Ubuntu, coming from a Debian backend. CentOS has quite a bit of a server
> community as well, though.
>
> On Sun, Nov 13, 2011 at 7:22 PM, Joey Espinosa 
> wrote:
>
> > No, Gentoo is not a variant of Debian.
>
> > I also don't think there are variants that are for "hardcore" users more
> > than others. If you're "hardcore", then you should be able to do things
> > like write your own kernel modules and perform low-level disk operations no
> > matter the distro.
>
> > I personally love Ubuntu on EC2. The ami/ec2 tools are in the repository
> > by default, and are updated regularly. If you use the official AMIs from
> > Canonical, then you'll get a setup that is optimized for EC2 without you
> > having to do anything extra (for instance, "byobu" runs automatically when
> > you connect via SSH).
>
> > In the end, it all really depends on you. As Casey mentioned, you are
> > probably better off with what you're already familiar with. After all, what
> > good is the "best" OS if you're more familiar with the "good enough" OS?
> > You'll be more productive with what you are comfortable managing. I'm
> > familiar with many distros (certified in Red Hat & Solaris, and long time
> > Gentoo user), but I go with Ubuntu on EC2 every time.
>
> > Hope this helped.
>
> > --
> > Joey "JoeLinux" Espinosa
> > Software Developer
> >http://about.me/joelinux
> > On Nov 13, 2011 7:10 PM, "Casey Greene"  wrote:
>
> >> I would suggest that you use whatever your sysadmin (or if no sysadmin,
> >> developer (or if it's just you, you)) are most familiar with.  I assume the
> >> packages that you are using (at least the ones you've listed) will be in
> >> the package management systems for any of the distros that you have listed.
>
> >> I'm also pretty sure that gentoo is not a variant of debian.
>
> >> Casey
>
> >> On 11/13/2011 03:58 PM, Charles Cossé wrote:
>
> >>> The main difference with Ubuntu is that it's a binary distribution
> >>> (pre-compiled binaries for a standardized platform).  I use Gentoo,
> >>> personally, which is a variant of Debian with "portage" rather than
> >>> "apt".   LAMP server stuff is readily available on all distros of Linux.
> >>>  If you're hardcore then use Gentoo.  If you're medium-core then use
> >>> Debian.  If you're softcore then use Ubuntu.  If you like RedHat style
> >>> more than Debian, then go CentOS.  Whichever you choose, you'll
> >>> immediately need to familiarize yourself with it's package manager and
> >>> how things are done on that platform.  good luck :-)
>
> >>> On Sun, Nov 13, 2011 at 12:56 PM, ydjango  >>> > wrote:
>
> >>>    I am setting up nginex, apache, python django, mysql based application
> >>>    on EC2. I expect high web traffic and high mysql query usage. Mysql
> >>>    and web server will on seperate servers.
>
> >>>    Which linux distro should I use for heavy production use - Ubuntu,
> >>>    Centos or Debian?
>
> >>>    Does it matter?
>
> >>>    I see most instructions on web is using Ubuntu and it seems it is
> >>>    considered easiest to set up. But I read somewhere that Ubuntu is not
> >>>    for server use. What is the downside if I chose ubuntu?
>
> >>>    --
> >>>    You received this message because you are subscribed to the Google
> >>>    Groups "Django users" group.
> >>>    To post to this group, send email to django-users@googlegroups.com
> >>>     >>> >.
> >>>    To unsubscribe from this group, send email to
> >>>    
> >>> django-users+unsubscribe@**googlegroups.com
> >>>    
> >>>  >>> **>.
> >>>    For more options, visit this group at
> >>>    
> >>> http://groups.google.com/**group/django-users?hl=en
> >>> .
>
> >>> --
> >>> AsymptopiaSoftware|Software@**theLimit
> >>>http://www.asymptopia.org
>
> >>> --
> >>> You received this message because you are subscribed to the Google
> >>> Groups "Django users" group.
> >>> To post to this group, send email to django-users@googlegroups.com.
> >>> To unsubscribe from this group, send email to
> >>> django-users+unsubscribe@**googlegroups.com
> >>> .
> >>> For more options, visit this group at
> >>>http:/

Re: Which Linux distro to use on EC2?

2011-11-13 Thread Mengu
if i had to choose a linux distro, i'd go with debian. however if i
can choose whatever i want then i'd go with freebsd. we are using
freebsd on 6 web servers and debian on 2 with the same hardware
configuration freebsd is outperforming debian.

On Nov 13, 9:56 pm, ydjango  wrote:
> I am setting up nginex, apache, python django, mysql based application
> on EC2. I expect high web traffic and high mysql query usage. Mysql
> and web server will on seperate servers.
>
> Which linux distro should I use for heavy production use - Ubuntu,
> Centos or Debian?
>
> Does it matter?
>
> I see most instructions on web is using Ubuntu and it seems it is
> considered easiest to set up. But I read somewhere that Ubuntu is not
> for server use. What is the downside if I chose ubuntu?

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



Maturity of e-commerce modules in DJango when compared with Catalyst

2011-11-13 Thread Alec Taylor
Good afternoon,

After trialling ~20 CMSs, I have decided that none are extensible
enough for my project, and that a web-framework is best.

Of the various web-frameworks, Catalyst and DJango seem to be the most
powerful, and also have the most pre-built extensions.

My question to both users-groups is, how mature are your e-commerce modules?

I am building a meta e-commerce store (so an e-commerce store of
e-commerce stores), so it's very important that the e-commerce modules
we extend are already quite mature.

The kind of feature we will be adding in (or using, if already implemented):
- Multiple payment gateways
- Order lifecycle (i.e. keep client in-the-know of how close there
order is to delivered)
- Ability for store to allows client to pick between "pay on pickup",
"pay on delivery" "pay online", but to also limit these choices to
just, i.e. "pay online"
- Multiple stores linked to the 1 shopping-cart (even across multiple
payment gateways)
- Pre-built modules to assist in building mobile apps

Which framework should I go with, and which modules would you
recommend I install?

Thanks for all suggestions,

Alec Taylor

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



Re: Admin Change List: Display Foreign Keys as Links to Related Change Form

2011-11-13 Thread Sumii L
Perhaps you have a foreignkey, Assumption is that person
just like this:( in your models)
def go_person(self):
return mark_safe(u'%s' %
(self.person.get_absoulte_url(), label))
go_person.allow_tags = True
go_person.short_description = 'GO_PERSON'

--and in your admin.py:
   list_dispaly = ('go_person', 'other attributes')

I hope this is what you want!

2011/11/14 Lee 

> This has gotta be easy but I'm not finding a solution in this list or
> snippets: how do I make Admin display foreign keys on change lists as
> links to the related record's change form? The displayed value is
> correct I just need it to be a hyperlink.
>
> Thanks for any help-
>
> Lee
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: Which Linux distro to use on EC2?

2011-11-13 Thread Javier Guerra Giraldez
On Sun, Nov 13, 2011 at 8:52 PM, ydjango  wrote:
> I was concerned that Ubuntu being a desktop OS might have some
> limitations which CENTOS or Debian being Server OS might not have.

AFAICT, there are very few differences between 'server' and 'desktop' distros:

- server distros don't have desktop environments (X, Gnome, KDE, etc).
 or rather, they shouldn't have.  that's what i don't like about RHEL,
they not only use Gnome tools for everything, but many of the docs
only include the GUI way to configure, not the CLI way.

- server distros are supported for longer times without version
upgrades of most components.  that makes for safe and 'no suprises'
updates, that include only bugfixes but no new features.

- small priority differences in optimizations and kernel
configuration.  like using different schedulers, swappinnes, LVS,
bigmem (now rendered moot by 64-bit)

For the first one, you could simply start in runlevel 3 for most
distros, and X wouldn't be started, avoiding the desktop overhead.
Ubuntu Server simply lets you install without X by default.  Roughly
every fourth release is called 'LTS', meaning that it will get long
term support via apt.  The last one is simply configurations, so it's
doable on any Linux out there; but it's nicer to have a good enough
default.

In short, Ubuntu server is just as 'server-like' as CentOS, or even
more if you (like me) want it to be free of X. (yes, i know you can
install RHEL and CentOS without X, but it's not the default)


-- 
Javier

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



help_text line continuation

2011-11-13 Thread Mike Dewhirst
I have been using the Python line continuation symbol +\ in my models 
help_text when my text goes beyond column 80 in my editor.


I just accidentally omitted it for a continued line and discovered it 
doesn't seem to be needed!!!


Is that a feature of Django's admin app or a trap for the unwary?

Thanks

Mike

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



Re: The name of my User

2011-11-13 Thread Nikhil Verma
Hi

you need to keep the object in memory not in the database i think that what
you are asking .If that

you need to something like this

variablename = Tablename.objects(fieldname = whatever )

do not write after variablename.save() after making this .Don't use create.



On Mon, Nov 14, 2011 at 5:10 AM, chronosx7  wrote:

> Hi, I am new to dJango an now I need to get the name of the user that
> authenticated before the execution of the Save method but I can't seem
> to find any way to accomplish this.
>
> Does anyone know how to do this?
>
> Thanks for your help
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Regards
Nikhil Verma
+91-958-273-3156

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