Re: DB: working with databases

2011-09-27 Thread Uros Trebec
You can upgrade the "inspectdb" result with Django Autoadmin (
https://github.com/bancek/django-autoadmin ) which generates necessary
basic AdminModel classes on the fly, without the need for manual
definition and/or Django-specific DB tables (auth, for example).

This way you can be up and running even faster.

Regards,
UT

On Sep 25, 6:13 pm, Xavier Ordoquy  wrote:
> Hi,
>
> Database will be better designed if you let django orm create them first and 
> you add your tuning after.
>
> However, you can still work with non Django generated database. 
> django-extensions application even provides an inspectdb that will guess most 
> of your models from the database schema.
>
> Regards,
> Xavier,
> Linovia.
>
> Le 25 sept. 2011 à 18:02, Tanuja a écrit :
>
>
>
>
>
>
>
> > Is it possible to work with databases in the "traditional" way? I mean:
> > Design, create, manage the database natively
> > Have batch processes to insert and mange data
> > Connect this data to a django-based website
> > What tools are there to do this? Is this an inefficient approach in the 
> > django world?
>
> > Alternatively, if I create the database using model.py:
> > Then need to make changes to the database as we go along, without deleting 
> > data, how can this be done?
> > How do I define triggers, indexes, etc in model.py?
>
> > Thanks much. I am a newbie. Clearly.
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To view this discussion on the web 
> > visithttps://groups.google.com/d/msg/django-users/-/AvAVd3SH0JsJ.
> > 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 
> > athttp://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: Admin TabularInline Edit Parent Record?

2011-09-06 Thread Uros Trebec
I would like this very much, if someone has any ideas on how to
achieve it.

--
Uros

On Sep 6, 4:35 am, Lee  wrote:
> I use TabularInlines for Many-to-Many join tables, with the foreign
> keys appearing in select lists. The Admin interface automatically
> provides the stellar "Add-Another" icon (a plus sign) with the select
> list, to add a new parent record on the fly. It would be extremely
> useful to also have an edit icon (often a pencil) that would edit the
> related parent record. Any easy way to to do that?
>
> Thanks for any help or ideas.
>
> 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: logging django errors also on the server

2011-09-05 Thread Uros Trebec
Take a look at Sentry: http://readthedocs.org/docs/sentry/

It works pretty well, uses polling to update the log view, can track
multiple sites with separate Sentry Server, etc.

Good luck,
Uros

On Sep 5, 12:58 am, Gelonida N  wrote:
> Hi,
>
> Im am debugging a django application.
>
> If I set  DEBUG=True
> then I can see error messages on the browser.
>
> Is there any way to see the same error messages in the server log file?
> Occasionally (especially for rpc client or Ajax requests I would prefer
> looking at the log file instead of looking at the browser error messages)
>
> Thanks for any 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.



Re: Media files not served automatically anymore in 1.3?

2011-08-25 Thread Uros Trebec
Somehow (I don't remember setting this up) I use 
https://github.com/divio/django-appmedia

with

urlpatterns = patterns('',
(r'^' + settings.MEDIA_URL.lstrip('/'), include('appmedia.urls')),
) + urlpatterns

in urls.py

Good luck,
Uros

On Aug 25, 1:21 pm, Reinout van Rees  wrote:
> On 25-08-11 13:10, Landy Chapman wrote:
>
> > Hope this helps:  
> > fromhttps://docs.djangoproject.com/en/dev/releases/1.3-beta-1/
>
> > The staticfiles app ships with the ability to automatically serve
> > static files during development (if the DEBUG setting is True) when
> > using the runserver management command. Based on feedback from the
> > community this release adds two new options to the runserver command
> > to modify this behavior:
> > --nostatic: prevents the runserver command from serving files
> > completely.
> > --insecure: enables serving of static files even if running with DEBUG
> > set to False. (This is not recommended!)
>
> Nope, that's not it. Staticfiles works fine with runserver and serves
> the static_url stuff just fine.
>
> Only, with this 1.3 change django's 1.2's automatic serving of the
> media_url stuff has gone the way of the dodo.
>
> Reinout
>
> --
> Reinout van Rees                    http://reinout.vanrees.org/
> rein...@vanrees.org            http://www.nelen-schuurmans.nl/
> "If you're not sure what to do, make something. -- Paul Graham"

-- 
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 ForeignKey display text

2011-07-28 Thread Uros Trebec
You should take a look at the Django documentation once more,
somewhere around this area:
https://docs.djangoproject.com/en/1.3/ref/models/instances/#django.db.models.Model.__unicode__

--
Uros

On Jul 27, 10:59 pm, galgal  wrote:
> How can I change the display text in select while selecting a field which is
> as ForeignKey? I need to display not only the name of FK, but also name of
> it's parent.
>
> Anybody can give a clue?

-- 
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: any recipes for 'live' updating a site with model changes

2011-07-27 Thread Uros Trebec
Hi,

for your DB migration problem you should take a look at South[0].
As for your 'under maintenance' step you will have to do that manually
or use some kind of a tool to automate it, as well as other steps for
the upgrade. There are many such tools, Fabric[1] and Chef[2] being
two of the most popular.

[0] http://south.aeracode.org/docs/
[1] http://docs.fabfile.org/en/1.2.0/index.html
[2] http://www.opscode.com/chef/

Good luck,
Uros


On Jul 27, 12:04 am, Gelonida N  wrote:
> Hi,
>
> Let's imagine I have a web server running with a Django application.
>
> Now I want to install an update (with a modified model)
>
> Is there any recommended way to upgrade such a server?
> Are there any tools helping with such upgrades or with creating upgrade
> scripts?
>
> If I had to do it 'manually' this is roughly what I'd do:
> - reconfigure the web server to redirect to an 'under maintenance' site
> - Before unistalling any new code:
>         dump all tables
> - install the new version
> - start an upgrade function, which deletes all tables and repopulates
> them from the dumps with some potential conversions.
>
> Thanks in advance for suggestions or examples of projects which handle
> updates more or less on the fly.

-- 
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: Doubt : Redirect after registration

2011-07-26 Thread Uros Trebec
I'm using django-registration and I solved the same problem by using
this:

http://djangosnippets.org/snippets/1960/

Works like a charm :)

Regards,
Uros

On Jul 26, 8:41 am, Lior Sion  wrote:
> Are you using anything not defaulted, like django-registration? In the
> database - is the user created and the active flag is true?
>
> On Jul 24, 2:16 pm, vaibhav agarwal  wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > I am using Django 1.3. I have started building my first site in django
> > and it seems real fun . I am learning a lot from it . But I have a
> > small problem . I want to login a user after he registers and then
> > redirect him to the home page of the site . For this I tried , the
> > stuff given in the 
> > linkhttp://stackoverflow.com/questions/3222549/how-to-automatically-login...
> > but it does not work for me . When I tried this , the user is directed
> > to the home page but since that has the login_required function , it
> > asks the user to manually login which I dont want . How do I rectify
> > this ?
>
> > Thanks in advance for the help .
>
> > Cheers
>
> > Vaibhav

-- 
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: Multiple Databases || External Databases

2011-07-18 Thread Uros Trebec


On Jul 17, 10:36 pm, Lycan  wrote:
> I am building a Django User profile management portal. In one of the
> sections of the website i need pull data from an external database(Its
> managed by someone else, i have access to it).
>
> How can i achieve this and also can someone please point me to a
> working example.

You should probably take a look at:
* manage.py inspectdb command
https://docs.djangoproject.com/en/1.3/ref/django-admin/#inspectdb

* Multiple DB:
https://docs.djangoproject.com/en/1.3/topics/db/multi-db/


If that fails, ask away.

Regards,
Uros

-- 
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: Model translation

2011-07-11 Thread Uros Trebec
Did anyone try "django-nani"?

https://github.com/ojii/django-nani

I'm giving it a go with my multilingual project and it kind of works.
The translating part works nicely, the biggest issue I have is the
limited AdminModel functionality (
http://django-nani.readthedocs.org/en/latest/public/admin.html#modeladmin-apis-not-available-on-translatableadmin
).

But other than that, looks promissing.

-- UT

-- 
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/python performance vs play/java

2011-07-06 Thread Uros Trebec
Hi,

Have you tried any kind of DB connection pooling with Django?

I find Jacob's Deployment Workshop [0] to be a treasure chest of tips
and tricks for Django deployment.
Also take a look at the code/config he uses [1].

[0] http://ontwik.com/python/django-deployment-workshop-by-jacob-kaplan-moss/
[1] https://github.com/jacobian/django-deployment-workshop/

Best of luck,
Uros

-- 
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: Decimal fields have landed on trunk: rename your FloatFields

2007-05-21 Thread Uros Trebec

Hi guys!

I can't believe how fast are you developing Django! I had a 2 days old
checkout and was looking at current model documentation... and the
validation kept saying "'module' object has no attribute
'DecimalField'".
I was ready to give up and take a nap to clear my mind when I thought
I should check the Groups... and here it is, a change one day old!

Congrats on to all developers for progress this fast and to all users
that can keep up with all the changes :)

Best regards,
Uros Trebec
FullHistory Branch

On May 21, 11:39 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Mon, 2007-05-21 at 13:22 +, waylan wrote:
> > Mmm, good things come to those who wait. It's nice to see this finally
> > come through. Thanks for all the hard work.
>
> > Btw, it looks like there is a small bug in the docs [1]. Just add a
> > couple tildes to theDecimalFieldsection header (line 188??).
>
> Damn. We always screw that one up. It's an easy mistake to make when
> editing titles and it's an error that rst2html doesn't warn about for
> some reason. Difficult to even catch it in proof reading.
>
> Looks like Adrian's fixed it whilst I've been asleep anyway.
>
> Thanks,
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: High Load

2006-12-06 Thread Uros Trebec


[EMAIL PROTECTED] je napisal:

> We may test postgreSQL to see if this fixes our latest problem, as our
> SQL cluster isnt setup yet as the hoster didnt have it ready, and this
> is a peak traffic day.

That might be a good idea. It seams that PgSQL scales 200% percent
better than MySQL (when using multiple processors/cores/machines.

Take a look at this test ( http://tweakers.net/reviews/646/1 ). It's
basically a CPU comparison but using DB performance on real live
example as tests. Here's the scaling properties (
http://tweakers.net/reviews/646/15 ), but I recommend reading the whole
article.

regards,
Uros


--~--~-~--~~~---~--~~
 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: Re: Django + FastCGI Problems

2006-12-05 Thread Uros Trebec
I am sorry to report that this method does NOT work on my
machine/account. I've tried different users (on the same machine) and
it does not work. Symptoms are the same.

I guess it's just my machine the one that is F00! And they refuse to
move my account to another one. :(

Anyone knows about any concrete alternative hosting that is production
stable for Django and offers reasonable prices (sub $10/month), disk
space (5-10GB) and bandwidth (250GB+) with multiple domain/site
hosting?
(I tried site5.com, but they would not accept my Visa Electron or
PayPal payment :( )

Best regards,
Uros


On 12/1/06, Maciej Bliziński <[EMAIL PROTECTED]> wrote:
>
> Mike,
>
> I was experiencing the same problems: incomplete headers and timeouts.
> I did a simple trick that made my Django application run smoothly.
> Perhaps you can try the same thing (it requires simple changes). I
> described it on my blog:
>
> http://automatthias.wordpress.com/2006/12/01/django-on-dreamhost-incomplete-headers/
>
> I haven't thoroughly verified it, it's an ongoing investigation. Maybe
> you could try the same thing. I'd like to know if it works for other
> people as well.
>
> Cheers,
> Maciej
>
>
> >
>

--~--~-~--~~~---~--~~
 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 + FastCGI Problems

2006-11-27 Thread Uros Trebec

On Nov 27, 6:55 pm, "Uros Trebec" <[EMAIL PROTECTED]> wrote:

> ATM, if I go to "http://localhost:8484/django.fcgi; I only get "403
> Forbidden" response.

OK, nevermind... I had to run "django-fcgi.py" too.
http://manuals.textdrive.com/read/book/15

> Now, how do I get Apache to redirect all requests to my lighttpd server?

On the other hand, this seams to be impossible without mod_proxy. Or is
it?

Best regards,
Uros


--~--~-~--~~~---~--~~
 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: Re: Django + FastCGI Problems

2006-11-27 Thread Uros Trebec
On 11/27/06, Gábor Farkas <[EMAIL PROTECTED]> wrote:
> >> If anyone has questions about how to do this let me know.
> >
> >
> > I for one, would VERY MUCH like to know how to do that.
> >
> > My django app has a downtime of 2 weeks now, because of the "incomplete
> > headers" :(
>
> and btw. are you sure that Dreamhost allows running long-running
> processes like lighttpd?

Lets hope so! :)

OK, I've built lighttpd and got it running with the basic
configuration + the lines from
http://www.djangoproject.com/documentation/fastcgi/#lighttpd-setup

Now, how do I get Apache to redirect all requests to my lighttpd server?

ATM, if I go to "http://localhost:8484/django.fcgi; I only get "403
Forbidden" response.

Any suggestions?

Best regards,
Uros

PS: This is my lighttpd.conf (with sensitive data omitted):

server.document-root = "/home/username/mydomain/"

fastcgi.server = (
"/django.fcgi" => (
"main" => (
"socket" => "/home/hostname/my.sock",
"check-local" => "disable",
)
),
)

alias.url = (
"/amedia/" =>
"/home/username/django/django_src/django/contrib/admin/media/",
"/media/" => "/home/username/mydomain/media/",
)

url.rewrite-once = (
"^(/amedia.*)$" => "$1",
"^/favicon\.ico$" => "/media/favico.ico",
"^(/.*)" => "/django.fcgi$1",
)

server.port = 8484

server.username = "username"
server.groupname = "group"

mimetype.assign = (
  ".html" => "text/html",
  ".txt" => "text/plain",
  ".jpg" => "image/jpeg",
  ".png" => "image/png"
)

static-file.exclude-extensions = ( ".fcgi", ".php", ".rb", "~", ".inc" )
dir-listing.activate = "enable"

--~--~-~--~~~---~--~~
 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: FullHistory Branch

2006-09-16 Thread Uros Trebec

[EMAIL PROTECTED] wrote:
> Tried doing it on a fresh db and all and nothing.

Hi, I'm sorry for not noticing your post as I'm rather busy with exams
etc.

Anyway, I think I know where's the problem. I noticed that I forgot to
mention that you need to add 'django.contrib.history' to INSTALLED_APPS
in your application's "settings.py" file.

After this I believe everything should work as described on the Wiki
page. Please note, there is no automatic compare/merge/revert mechanism
at the moment, so you need to do that on your own.

If you have any specific question about the usage, bug report or
feature request please feel free to post in this group or to me
directly to urosDOTtrebecATgmailDOTcom.

Best regards,
Uros Trebec


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



Re: ContentTypes usage

2006-07-20 Thread Uros Trebec


Jacob Kaplan-Moss wrote:
> On Jul 19, 2006, at 7:49 AM, Uros Trebec wrote:
> > Does anyone know how to use this thing?
>
> I do :)

That's good to hear! :)


> But you're really going to need to give me more information about
> what you're trying to do in order for me to help.  Remember: specific
> questions get the best answers.

So, what I'm trying to do is to modify contrib.history.models.ChangeLog
(full-history branch) so its "parent" can link to different models, not
just one (current version). This way I can use only one table to store
any object (I need to know to which model and row does it belong).

I'll keep you posted if I can't make it work, ok?

Regards,
Uros


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



Re: ContentTypes usage

2006-07-20 Thread Uros Trebec


Aidas Bendoraitis wrote:
> You can learn about ContentTypes from
> http://www.djangoproject.com/documentation/models/generic_relations/
> and also from the code of django.contrib.comments

Thank you very much for this one! I'll try to figure it out.

regards,
Uros


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



ContentTypes usage

2006-07-19 Thread Uros Trebec

Hi everyone!

I'm trying to figure out how to use django.contrib.contenttypes. There
is no official documentation, code is not documented enough and I could
only find this [0] blog post from which I can't get anything useful
from.

Does anyone know how to use this thing?

[0] http://feh.holsman.net/articles/2006/06/03/django-contenttype


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