Saturday, December 31, 2011

"syncdb --database=xxx" not working

Hello,

I've tried to setup a project that supports two different databases, a
postgres-db and a mysql-db. The DATABASES-setting is configured
properly with a 'default' key for the mysql-db and 'pg' for the
postgres. However, if I try to syncdb the postgres-db, manage.py
accesses the 'default' mysql-db.
This is what I enter in the commandline: "python manage.py syncdb --
database=pg", like documented here: <https://docs.djangoproject.com/en/
1.3/topics/db/multi-db/>
It seems that the --database option is ignored. Why?

Regards,
Andreas

--
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: django-admin.py startproject will NOT work.

On Fri, 30 Dec 2011 16:36:32 -0800 (PST), Chris Kavanagh
<ckava3@gmail.com> wrote:

>> I'm not sure you'll be able to see the screenshot at the link, it's very small. So, here's a copy/paste of it from my command prompt:
>
>
>
>
>C:\Documents and Settings\mysite>django-admin.py startproject mysite

Have you tried that while explicitly specifying the Python
interpreter on the line?

I seem to recall that Windows has some problem passing command line
arguments when the first item (the "program") isn't directly executable.

http://stackoverflow.com/questions/2640971/windows-is-not-passing-command-line-arguments-to-python-programs-executed-from-t
http://stackoverflow.com/questions/7860872/run-python-scripts-from-windows-command-line-argument-not-passed

(or for the full google list;
http://www.google.com/search?q=windows%20python%20command%20line%20argument%20passing&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a&source=hp&channel=np
)
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Django app for IP address lookup

Thanks.

Do you have an API for it yet? so we can do something like http://dazzlepod.com/ip/api/json/1x7.x37.8.xx and get the data in JSON?


On Sat, Dec 31, 2011 at 4:09 PM, yati sagade <yati.sagade@gmail.com> wrote:
Nice app :) can you share the sources? And happy new year to you, too!


On Sat, Dec 31, 2011 at 5:20 PM, Addy Yeow <ayeowch@gmail.com> wrote:
Hi guys,

Just sharing a simple Django app that allows you to do IP address lookup:

Happy new year!

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Django app for IP address lookup

Nice app :) can you share the sources? And happy new year to you, too!

On Sat, Dec 31, 2011 at 5:20 PM, Addy Yeow <ayeowch@gmail.com> wrote:
Hi guys,

Just sharing a simple Django app that allows you to do IP address lookup:

Happy new year!

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

Django app for IP address lookup

Hi guys,

Just sharing a simple Django app that allows you to do IP address lookup:

Happy new year!

--
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: Managers of related fields

On Fri, 30 Dec 2011 19:37:54 -0800 (PST)
Daniel Kaplun <min@dvir.us> wrote:

> I have Articles that refer to Authors using
> ForeignKey(related_name='articles'). Given an Author author, I'd like
> to be able to use the default manager for author.articles, but I'd
> also like to have author.published_articles, using a custom manager.
> Is this possible?

At the moment, this is not possible, as Django always uses the default
manager when doing the reverse lookup on foreign keys (as well as when
doing lookups in many-to-many relations).

However, there is a patch currently pending review in ticket #3871 [1]
which makes it possible to select which manager instead of the default
manager is used in these lookups.


As I wrote the last iteration of this patch myself, I cannot review it
myself. If you feel confident, please have a look at it and mark it as
"ready for check-in" if you think it is.

Otherwise please head over to <django-developers@googlegroups.com> and
present your use-case there, hopefully finding somebody who can take a
look at the latest progress in ticket #3871.

Regards,
Sebastian.

[1] https://code.djangoproject.com/ticket/3871

--
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: Unable to display static content.

use {{STATIC_URL}} in place of {{MEDIA_URL}} and keep STATIC_ROOT =' ' in settings page.

refer : https://docs.djangoproject.com/en/dev/howto/static-files/

On Sat, Dec 31, 2011 at 7:42 AM, Chirdeep <chirdeep.tomar@gmail.com> wrote:
Hi All,

I am just learning Python and Django. I am able to see the webpage but
css and images are not picked up.

Configuration as below:

Linux Ubuntu 11.04
Python 2.7.2
Django 1.3.1

I have setup Django using VirtualEnv. I am using PyCharm and my Django
project is pointing to the VirtualEnv Django installation.

In firebug, I am getting 404 for css and images.

Project Structure.

ProjectRoot
-media
  -images
  -stylesheets
-templates
-webapp

urls.py
------------------------------------------------------------------------------------------
from django.conf.urls.defaults import patterns, include, url
import settings
from talenthunt.web import views

urlpatterns = patterns('',
   url(r'^search-form/$', views.search_form),
   url(r'^search/$', views.search),
)

if settings.DEBUG:
   urlpatterns += patterns('',
       (r'^media/(?P<path>.*)$', 'django.views.static.serve', {
           'document_root': settings.MEDIA_ROOT}))


settings.py
---------------------------------------------------------------------------------------
def rel(*x):
   return os.path.join(os.path.abspath(os.path.dirname(__file__)),
*x )

MEDIA_ROOT = rel('media')
MEDIA_URL = '/media/'

STATIC_ROOT = rel('static')
STATIC_URL = '/static/'

ADMIN_MEDIA_PREFIX = '/media/admin/'

Only pasting relevant code from settings.py

Base.html
------------------------------------------------------------------------------------------
<head>
   <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
   <title>Organic Web Design</title>
   <link href="{{ MEDIA_URL }}stylesheets/common.css"
rel="stylesheet" type="text/css" />
</head>

Any help will be much appreciated.

Thanks
Chirdeep



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