Django SECRET KEY

2020-11-04 Thread Kegan Ronholt
What is the best practice for hiding SECRET key in settings.py in 
production. I am finding all sorts of different ways to do it, but none 
seem to work.


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6660766c-6ed4-4500-9006-c8289158f749n%40googlegroups.com.


Django 1.7 Final Status?

2014-06-15 Thread Kegan Gan
Hi,

I realise that Django 1.7 is still in beta as of today. I have not been 
following very closely on the development. The roadmap indicate it should 
be final sometime in May 2014. 

What is the current status? Any updated release date?

Thank you.

-- 
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/e1e1023e-10e7-4f7e-a4fa-adecc700e505%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Root url returning 302 FOUND

2009-12-20 Thread Kegan Gan
Anyone can shed some light to the matter?

* Bring this post to the front.

On Dec 18, 1:21 am, Kegan Gan  wrote:
> In myrooturls.py I have the following:
>
> urlpatterns = patterns('',
>     (r'^', include('story.urls')),
> )
>
> In my story app, I have the following urls.py:
>
> urlpatterns = patterns('',
>    url(r'^$', home_view, name='story-home'),
>    url(r'^create/$', home_view, name='story-create'),
> )
>
> Running on the localhost:8000, the 'story-create'urlcorrectly return
> 200 OK.
>
> But the 'story-home'urlreturn a302FOUND. For example, using curl:
>
> $ curl -Ihttp://localhost:8000/
> HTTP/1.0302FOUND
> Date: Thu, 17 Dec 2009 15:52:54 GMT
> Server: WSGIServer/0.1 Python/2.6.4
> Content-Type: text/html; charset=utf-8
> Location:http://localhost:8000/
>
> Why is it returning302FOUND? How can I fix this?

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.




Root url returning 302 FOUND

2009-12-17 Thread Kegan Gan
In my root urls.py I have the following:

urlpatterns = patterns('',
(r'^', include('story.urls')),
)

In my story app, I have the following urls.py:

urlpatterns = patterns('',
url(r'^$', home_view, name='story-home'),
url(r'^create/$', home_view, name='story-create'),
)

Running on the localhost:8000, the 'story-create' url correctly return
200 OK.

But the 'story-home' url return a 302 FOUND. For example, using curl:

$ curl -I http://localhost:8000/
HTTP/1.0 302 FOUND
Date: Thu, 17 Dec 2009 15:52:54 GMT
Server: WSGIServer/0.1 Python/2.6.4
Content-Type: text/html; charset=utf-8
Location: http://localhost:8000/

Why is it returning 302 FOUND? How can I fix this?

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Performance monitoring

2009-12-09 Thread Kegan Gan
Thanks for reply, Andy.

I am aware of django-debug-toolbar. I am looking something to run with
production.

How do people monitor Django application performance in production
environment today?

Thanks.

On Dec 10, 12:28 pm, Andy McKay  wrote:
> On 09-12-09 6:43 PM, Kegan Gan wrote:
>
> > Google App Engine provides a rather extensive set of tools to monitor
> > the performance of your applications running in App Engine. Is there
> > something similar for Django?
>
> Not that I know of. There's django-debug-toolbar and a quick hack I
> wrote to track the time of each sql query. But I would classify both as
> debugging tools. Is there anything specific you are looking for?
> --
>    Andy McKay, @clearwind
>    Training:http://clearwind.ca/training/
>    Whistler conference:http://clearwind.ca/djangoski/

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.




Performance monitoring

2009-12-09 Thread Kegan Gan
Hi,

Google App Engine provides a rather extensive set of tools to monitor
the performance of your applications running in App Engine. Is there
something similar for Django?

Thanks.

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Full-text search: what to use

2009-07-29 Thread Kegan

Any thoughts on using PostgreSQL built-in full text search ?


On Jul 29, 5:49 pm, "dlvosse...@gmail.com" 
wrote:
> I've recently adopted the use of xapian for full text search, via the
> djapian django app which works like a charm. Xapian is written in C++
> with python bindings, and with the djapian app u can stay within the
> django realm; e.g. updating the index can be done with manage.py
> index..
>
> When using django, djapian seems to be the best option to integrate
> full text search (i'm using it with a postgresql db).
>
> I'm interested in what you think, as i haven't seen anyone mention
> xapian/djapian so far. I looked a bit into sphinx as well, but it
> seems djapian is far more easily set up, but i have no idea
> performancewise.
>
> Anyone any thoughts/experience with xapian/djapian?
>
> thanks,
> Domenic
>
> On Jul 28, 6:10 pm, alex finn  wrote:
>
>
>
> > Thanks for your replies, it is useful.
>
> > Has anyone used whoosh in production so far? Any ideas about it's
> > performance?
>
> > Alex.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django deployment

2009-06-03 Thread Kegan Gan

This is how I did it. You have have a settings_default.py, which
contains all the commons settings.

In your development environment, you use settings.py that has this on
the top ...

from settings_defaults import *

... then you overwrite whatever setting variables that are needed for
your development environment.

For you production (server) environment, you use another settings.py
again import from settings_default, and overwrite whatever setting
variables that are needed for the server.

Also, you can use the following to get the path on where your django
project is:

import os.path
PROJECT_DIR = os.path.dirname(__file__)

Hope this helps.


On Jun 3, 4:16 pm, vishy  wrote:
> Hi,
>
> I am developing an application on windows. I decided to upload it on
> webfaction n see how deployment goes. The issues I faced was with
> paths given -
> for templates - I had given absolute path of directory on windows,
> for database(using sqlite) - just the name.But, for deployment I had
> to change both the paths. Is there any way which I can avoid this?
>
> thanks
--~--~-~--~~~---~--~~
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: dumpdata and loaddata as simple DB migration tool?

2009-06-03 Thread Kegan Gan

Hi Russell,

On the first issue: Good point. I have not the opportunity to work
with such a huge database.

On the second issue: Yes, what I am doing now is really about writing
conversion code to fit the old json to match the new schema. I find
this to be quite straight forward for my use cases, it's only
modifying a list of hash objects. But I probably haven't encounter the
more complicated use cases out there.

I feel the fact that Django ORM works, dumpdata+loaddata works, ...
makes it compelling as the foundation for a migration tool. Developers
can work with 100% Python code, not needing to learn migration tools
specific APIs, and maybe easier to provide some logic in the migration
process (for example, calculating default values for new fields, based
on some existing database data).

Also, independent Django app (as in INSTALLED_APP) developers can all
rely on the serialized JSON format, and provide their own migration
code, when they release new version of their app. (How is this
currently done anyway? Lets say if django-tagging changes the model
class in the next release.)


Thank you for the reply.


PS: As for this three points ...

>>> * If you add a new non-null field, the fixture won't load because it won't 
>>> provide data for that field.
>>> * If you change the name of a field, the fixture will contain data for the 
>>> old name, but no data for the new name. Any existing data in that field 
>>> will be lost.
>>> * If you change the type of a field, there is no guarantee that the old 
>>> data will be format-compatible with the new field.

... the old fixtures are loaded with old model class. The serialized
json is modified to fit the new model class, and then loaded using the
new model class with "manage loaddata". This is done on a per app
basis (only for the app that needs the migration).



On Jun 3, 2:57 pm, Russell Keith-Magee  wrote:
> On Wed, Jun 3, 2009 at 12:06 PM, Kegan  wrote:
>
> > Hi,
>
> > About Django database migration. I know there's a couple of tools
> > available (South, evolution, dmigration, etc), but I am pondering an
> > alternative here. Hope good discussion entails.
>
> > This is what I am doing manually now for my database migration needs.
>
> > 1. Use Django's management command "dumpdata" to get the JSON
> > representative of an app. Save the JSON into a file (oldmodel.json).
> > 2. Git pull the latest code. And do a reset to the app. So the
> > database will have the new model schema now.
> > 3. Use the python shell to migrate the JSON file to match the new
> > model representation. Save the new JSON into a file (newmodel.json).
> > 4. Use management command "loaddata" to populate the new model with
> > the newmodel.json.
>
> > This has work well so far for my use with PostgreSQL, albeit very
> > manual. It's all Python code.
>
> > So I guess what I want to ask Django experts/developers here is that:
>
> > 1. Is there any reason this shouldn't be done?
> > 2. Any technical challenge that prevent this method from being
> > realized into a more automate tool?
>
> The answer to these two questions is essentially the same - there are
> 2 technical challenges that provides reasons why you might not want to
> commit to this path.
>
> Firstly, there is a simple matter of time and space. If you have a
> small database, deserializing then reserializing won't take too long,
> and won't result in huge files. However, I routinely work with a
> database that contains 5GB of data (and growing) - and that's when
> it's neatly packed into a database binary format. Spooled out into a
> relatively space-inefficient serialized form will consume much more
> disk space. On top of that, the time required to produce and reload a
> fixture in this format would be prohibitive.
>
> Secondly, there is the limitations of the approach itself. The
> fixture-based migration tool will really only help with simple
> migrations where the schema isn't really changing that much - for
> example, increasing the size of a CharField. However, for any
> non-trivial change, you will hit problems. For example:
>
>  * If you add a new non-null field, the fixture won't load because it
> won't provide data for that field.
>
>  * If you change the name of a field, the fixture will contain data
> for the old name, but no data for the new name. Any existing data in
> that field will be lost.
>
>  * If you change the type of a field, there is no guarantee that the
> old data will be format-compatible with the new field.
>
> So while the dump+load approach will work for simple cases, in
> practice, it doesn'

dumpdata and loaddata as simple DB migration tool?

2009-06-02 Thread Kegan

Hi,

About Django database migration. I know there's a couple of tools
available (South, evolution, dmigration, etc), but I am pondering an
alternative here. Hope good discussion entails.

This is what I am doing manually now for my database migration needs.

1. Use Django's management command "dumpdata" to get the JSON
representative of an app. Save the JSON into a file (oldmodel.json).
2. Git pull the latest code. And do a reset to the app. So the
database will have the new model schema now.
3. Use the python shell to migrate the JSON file to match the new
model representation. Save the new JSON into a file (newmodel.json).
4. Use management command "loaddata" to populate the new model with
the newmodel.json.

This has work well so far for my use with PostgreSQL, albeit very
manual. It's all Python code.

So I guess what I want to ask Django experts/developers here is that:

1. Is there any reason this shouldn't be done?
2. Any technical challenge that prevent this method from being
realized into a more automate tool? (I read somewhere that dumpdata
doesn't always work?)
3. What do you think about having migration code be more part of the
deployment tool, rather than couple into the source code ?

Thanks.

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



Django 1.1 to be in future Google App Engine release

2009-06-02 Thread Kegan

Just for everyone information, I believe Guido just said that Django
1.1 will be in future Google App Engine release once it (Django 1.1)
is out of beta.

Looking forward to this Django 1.1 final!

Link here:

http://code.google.com/p/googleappengine/issues/detail?id=872&colspec=ID%20Type%20Status%20Priority%20Stars%20Owner%20Summary%20Log%20Component
--~--~-~--~~~---~--~~
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: Expert

2009-05-24 Thread Kegan Gan

Dr.Attas,

I have done this approximately 1 year ago. Took about 3-4 weeks to
pick up enough Python, and another 3-4 weeks to be able to write a
straight forward Django app.

Follow the online tutorial and the Django Book. They are very very
good to get started.

You *can* write bad Django app, if you are not careful. It's important
to know the best practices. Watch all the videos from the DjangoCon
2008 at Youtube. Especially Reusable Apps (James Bennett).

Hope this helps.

On May 25, 2:10 am, Michael  wrote:
> On Sun, May 24, 2009 at 1:17 PM, hankie  wrote:
>
> > Michael,
>
> > can you point out some of the 3rd party apps you're referring to?
>
> > Thank you!
>
> No problem. James Bennet's apps are very well written, documented and tested
> and are a great place to look for best 
> practices:http://bitbucket.org/ubernostrum/He goes by the handle ubernostrum 
> and has
> projects on other sites as well. You can read his blog at b-list.org . He
> also gave talks at Pycon and DjangoCon last year about writing reusable apps
> that were very cool to 
> see:http://www.youtube.com/watch?v=A-S0tqpPga4&feature=PlayList&p=D415FAF...
>
> Another good place to check things out at is the Pinax projects. They are
> trying to get a group of regularly used applications all under one simple
> project. It is a lot of fun to play with and they are helping to define what
> makes a Django app useful.http://pinaxproject.com/
>
> Those are just a few examples, just going through django-code and google,
> you should be able to find a lot more.
>
> I hope that helps,
>
> Michael
--~--~-~--~~~---~--~~
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: Revisit Django trunk and Python 2.6

2009-05-24 Thread Kegan Gan

Thanks! Time for the switch.

On May 25, 2:09 am, Skylar Saveland  wrote:
> On May 24, 3:21 am, Kegan  wrote:
>
> > I am always using Django trunk and Python 2.5.4. And having no
> > problem.
>
> > I am thinking of switching to Python 2.6 (just to use latest python
> > version). Anyone is already doing this in development? production? Any
> > problem?
>
> > Thanks.
>
> 2.6 works for me.
--~--~-~--~~~---~--~~
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: Euro DjangoCon Videos

2009-05-24 Thread Kegan Gan

+1 for the videos to be uploaded :)

On May 24, 10:31 pm, Joshua Partogi  wrote:
> On May 24, 8:22 pm, giorgos  wrote:> Hello to all, > > 
> Does anybody know if and where will Euro DjangoCon
>
> videos be > uploaded ?? > > There are many people out there interested in
> Django and presentations > like these are a great way to get them in...
> I would be interested too. :-)
>
> --
> Join Scrum8.com.
>
> http://scrum8.com/jpartogi/http://twitter.com/scrum8
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Revisit Django trunk and Python 2.6

2009-05-24 Thread Kegan

I am always using Django trunk and Python 2.5.4. And having no
problem.

I am thinking of switching to Python 2.6 (just to use latest python
version). Anyone is already doing this in development? production? Any
problem?

Thanks.
--~--~-~--~~~---~--~~
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: Fwd: Best Django host

2009-05-20 Thread Kegan Gan

+1 for WebFaction.

The control panel look+feel may looks weird, but the simplicity is
just great and you get everything you need. The structure in your home
directory is also sensible.

Another plus for great technical support when you needed it.


On May 20, 7:41 pm, Sam Kuper  wrote:
> 2009/5/20 LeonTheCleaner :
>
> > I currently use dreamhost, but the installation process is very slow.
> > Is it me or this process is overly complicated? All I want is to
> > install an already written django project but to do that it's like I
> > have to write the app myself.
>
> If you've already paid in advance for Dreamhost hosting for a long-ish
> term (say, 6 months or more), then it might be economical to run
> Django on Dreamhost rather than switching. Ditto if you don't want the
> restrictions of a fixed memory quota, etc.
>
> It's definitely possible to run Django on Dreamhost; but it's also
> fiddly to set up.* My approach would be to set up a new user in the
> Dreamhost panel, and set up Django under that user's shell account.
> Then assign the domains you want to use Django for to that user, and
> Bob's your uncle.
>
> Sam
>
> * If you're having difficulty with this part and the Dreamhost wiki
> hasn't sufficed (and nor has searching the web), then get back in
> touch with the list, mentioning the specific trouble you are having,
> and you'll probably find the help you need.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: django.contrib.auth tests fail

2009-05-14 Thread Kegan Gan

This could be related to ticket #10521 
http://code.djangoproject.com/ticket/10521,
which has been fixed. It's currently in the trunk already, since
changeset http://code.djangoproject.com/changeset/10674 .

~KEGan

On May 14, 12:36 am, Sean Brant  wrote:
> I am also having a issue with contrib.auth test errors. They errors
> seem to be caused by url tags in my base.html template. When I comment
> out all of those tags the tests pass. The url tags seem to work when i
> look at the site im my browser.
>
> ==
> ERROR: test_confirm_complete
> (django.contrib.auth.tests.views.PasswordResetTest)
> --
> Traceback (most recent call last):
>   File "/usr/lib/python2.5/site-packages/django/contrib/auth/tests/
> views.py", line 81, in test_confirm_complete
>     response = self.client.get(path)
>   File "/usr/lib/python2.5/site-packages/django/test/client.py", line
> 278, in get
>     return self.request(**r)
>   File "/usr/lib/python2.5/site-packages/django/test/client.py", line
> 222, in request
>     response = self.handler(environ)
>   File "/usr/lib/python2.5/site-packages/django/test/client.py", line
> 66, in __call__
>     response = self.get_response(request)
>   File "/usr/lib/python2.5/site-packages/django/core/handlers/
> base.py", line 128, in get_response
>     return self.handle_uncaught_exception(request, resolver, exc_info)
>   File "/usr/lib/python2.5/site-packages/django/core/handlers/
> base.py", line 160, in handle_uncaught_exception
>     return callback(request, **param_dict)
>   File "/usr/lib/python2.5/site-packages/django/views/defaults.py",
> line 24, in server_error
>     return http.HttpResponseServerError(t.render(Context({})))
>   File "/usr/lib/python2.5/site-packages/django/test/utils.py", line
> 15, in instrumented_test_render
>     return self.nodelist.render(context)
>   File "/usr/lib/python2.5/site-packages/django/template/__init__.py",
> line 768, in render
>     bits.append(self.render_node(node, context))
>   File "/usr/lib/python2.5/site-packages/django/template/debug.py",
> line 71, in render_node
>     result = node.render(context)
>   File "/usr/lib/python2.5/site-packages/django/template/
> loader_tags.py", line 97, in render
>     return compiled_parent.render(context)
>   File "/usr/lib/python2.5/site-packages/django/test/utils.py", line
> 15, in instrumented_test_render
>     return self.nodelist.render(context)
>   File "/usr/lib/python2.5/site-packages/django/template/__init__.py",
> line 768, in render
>     bits.append(self.render_node(node, context))
>   File "/usr/lib/python2.5/site-packages/django/template/debug.py",
> line 71, in render_node
>     result = node.render(context)
>   File "/usr/lib/python2.5/site-packages/django/template/
> loader_tags.py", line 24, in render
>     result = self.nodelist.render(context)
>   File "/usr/lib/python2.5/site-packages/django/template/__init__.py",
> line 768, in render
>     bits.append(self.render_node(node, context))
>   File "/usr/lib/python2.5/site-packages/django/template/debug.py",
> line 81, in render_node
>     raise wrapped
> TemplateSyntaxError: Caught an exception while rendering: Reverse for
> 'crowdSPRING.contact_us' with arguments '()' and keyword arguments
> '{}' not found.
>
> Original Traceback (most recent call last):
>   File "/usr/lib/python2.5/site-packages/django/template/debug.py",
> line 71, in render_node
>     result = node.render(context)
>   File "/usr/lib/python2.5/site-packages/django/template/
> defaulttags.py", line 387, in render
>     args=args, kwargs=kwargs)
>   File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py",
> line 262, in reverse
>     *args, **kwargs)))
>   File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py",
> line 251, in reverse
>     "arguments '%s' not found." % (lookup_view, args, kwargs))
> NoReverseMatch: Reverse for 'MySite.contact_us' with arguments '()'
> and keyword arguments '{}' not found.
>
> On May 13, 10:55 am, Michael  wrote:
>
>
>
> > On Wed, May 13, 2009 at 9:42 AM, Luc Saffre  wrote:
>
> > > Hello,
>
> > > when I run ``manage.py test`` to test my Django applications, then I
> > > also get a lot of test failures for django.contrib.auth.
>
> > > Is that normal? What can I do to get rid of th

Does fixtures loading invoke custom save method?

2009-04-13 Thread Kegan

I have a model with custom save() method. Does loading fixtures invoke
this method?

class MyModel(models.Model):
 def save(self, *args, **kwargs):
 doStuffs()

>From my testing, doStuffs() is not called when loading fixtures. It is
called when I do:

instance = MyModel()
instance.save()

Is this right? Thanks.
--~--~-~--~~~---~--~~
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: FormSet max_num and extra

2009-03-15 Thread Kegan Gan

Ah, got it! Many thanks Malcolm.


On Mar 16, 5:58 am, Malcolm Tredinnick 
wrote:
> On Sun, 2009-03-15 at 04:25 -0700, Kegan wrote:
> > I am dealing with formset, and finding the lack of documentation in
> > understanding it. Hope anyone experienced with formset could help.
>
> At some point just opening up the relevant source file is always a good
> solution. It's only Python code and not particularly difficult to
> understand.
>
> Or experiment. Create a formset and vary the parameters you are
> interested in and see how it affects the displayed form.
>
>
>
> > What is the reason to have a "max_num" and "extra" argument when
> > instantiating a form set (using formset_factory)? Can't you just use
> > "max_num" to determine the number of forms in the form set?
>
> The max_num parameter is the number of forms that are populated with
> initial data to display. It means you can pass in, say,  a queryset (for
> modelformsets) without having to make sure it only contains the right
> number of records.
>
> If there are more records in the queryset than max_num, the first
> records are used and the latter ones discarded.
>
> The "extra" parameter is the number of blank forms to display (extra
> forms with no data populated).
>
>
>
> > Also, management_form render "form-TOTAL_FORM", and 'form-
> > INITIAL_FORMS', ... how is this correspond to "max_num" or "extra", or
> > they don't?
>
> The total form count is the total number of forms and the initial form
> count is the number of "initial" forms -- forms populated with initial
> data -- in the form set.
>
> Those values' upper-bounds can be computed from max_num and extra (since
> initial forms won't be greater than max_num) and, thus, total forms
> won't be greater than max_num + extra. But they are only upper bounds.
>
> Regards,
> Malcolm
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



FormSet max_num and extra

2009-03-15 Thread Kegan

I am dealing with formset, and finding the lack of documentation in
understanding it. Hope anyone experienced with formset could help.

What is the reason to have a "max_num" and "extra" argument when
instantiating a form set (using formset_factory)? Can't you just use
"max_num" to determine the number of forms in the form set?

Also, management_form render "form-TOTAL_FORM", and 'form-
INITIAL_FORMS', ... how is this correspond to "max_num" or "extra", or
they don't?

Thanks.
--~--~-~--~~~---~--~~
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 to create bigint ?

2009-03-12 Thread Kegan Gan

I was just facing this 'requirement' a couple of days ago. I needed an
Integer field that stores up to a hundred billion. Django's
IntegerField get mapped as 32 bit field in PostgreSql, and just can
represent integer over 2++ billion. (It worked on my development
environment using sqlite though).

My solution is just to ALTER table manually after syncdb. I believe
you can easily automated that using signal on post-syncdb.


On Mar 13, 2:26 am, xankya  wrote:
> I created an integer field for a mobile number as
> mobile = models.IntegerField(max_length=20)
>
> In MySQL interface, it created an integer field with length 11.
>
> So my question is how to create bigint in mysql for storing big
> numbers such as mobile number.
>
> And my another mysql newbie question is why int(length=20) in mysql
> can't store 10 digit number? and is bigint(length=5) different that int
> (length=5)?
--~--~-~--~~~---~--~~
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: Translation of type from urls to view

2009-02-17 Thread Kegan

Thanks!

On Feb 18, 12:28 pm, Malcolm Tredinnick 
wrote:
> On Tue, 2009-02-17 at 20:06 -0800, Kegan wrote:
> > I have the following urls:
>
> >      url(r'/id/(?P\d+)/$', process_view)
>
> > and view:
>
> >      def process_view(request, id):
>
> > Does the "id" in the view is automatic translated to int type?
>
> > I seems to recall that was the case, with older version of Django
> > (maybe I recall wrongly??).
>
> Your recollection is incorrect.
>
> The reason this doesn't happen is because /id/00/ and /id/0/ are
> different URLs, on the most basic level, yet both match your
> regular-expression. If they were automatically converted to an int, they
> would end up being the same thing, which might not be want is wanted (it
> might be what *you* want in this particular case, but there would be
> situations where that behaviour would be bad).
>
> Regards,
> Malcolm
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Translation of type from urls to view

2009-02-17 Thread Kegan

I have the following urls:

 url(r'/id/(?P\d+)/$', process_view)

and view:

 def process_view(request, id):

Does the "id" in the view is automatic translated to int type?

I seems to recall that was the case, with older version of Django
(maybe I recall wrongly??). But not so with the trunk (9845).


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



Re: Django and Python 2.6

2008-11-10 Thread Kegan

I am planning to host at WebFaction. Anyone using Django + Python2.6
at WebFaction ? Care to share ?

On Nov 10, 4:42 pm, m0nonoke <[EMAIL PROTECTED]> wrote:
> I am using Win32 and there are still quite a few Python 2.6 libs /
> binaries that are unavailable, such as mod_python. If you are on linux
> though, you should have no problems.
>
> On Nov 10, 8:08 am, Kegan <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > If I start a new Django project today. Should I not be using Python
> > 2.6 ?
>
> > I have read some threads here that ensure Django 1.0+ have no problem
> > with Python 2.6. However, is there any other reason you would
> > discourage using of Python 2.6 (if you 'do' discourage) ? Example,
> > inadequate 3rd party libraries, etc?
>
> > Thanks.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Django and Python 2.6

2008-11-10 Thread Kegan

Hi,

If I start a new Django project today. Should I not be using Python
2.6 ?

I have read some threads here that ensure Django 1.0+ have no problem
with Python 2.6. However, is there any other reason you would
discourage using of Python 2.6 (if you 'do' discourage) ? Example,
inadequate 3rd party libraries, etc?

Thanks.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django GridContainers at Media Temple

2008-11-06 Thread Kegan

Anyone?

On Oct 7, 5:04 pm, Kegan <[EMAIL PROTECTED]> wrote:
> Wonder if anyone have had experience with the new Media Template
> Django GridContainer?
>
> http://mediatemple.net/webhosting/gs/django.html
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Django GridContainers at Media Temple

2008-10-07 Thread Kegan

Wonder if anyone have had experience with the new Media Template
Django GridContainer?

http://mediatemple.net/webhosting/gs/django.html

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---