Re: apache

2009-08-05 Thread alexarsh

If you want to see your app from another computer in local network,
you can run:
python manage.py runserver 0.0.0.0:8000

Regards, Alex A.

On Aug 5, 11:13 am, Salvatore Leone 
wrote:
> Graham Dumpleton ha scritto:> You must recompile mod_python to use a 
> different Python version.
> > Changing the symlink like that will not make a difference and you
> > could break other stuff on your system which assumed default Python is
> > a specific version.
>
> I know, and I didn't do it(I'm on Ubuntu a most application are in
> python and they expect 2.6 which is installed by default)> You should also 
> not go blindly changing permissions to 777 as that
> > makes it world writable which is bad practice and disastrous on a
> > shared host as other users can then change stuff in your directories.
> > Please go read documentation on file permissions on UNIX systems.
>
> I know that too. But I just want something for others than me to see the
> site. The "manage.py  runserver" isn't visible by other pc than mine
> (http://myhost:8000doesn't work).
>
> If I could use that server would not need apache at all.
>
> -Salvatore
--~--~-~--~~~---~--~~
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: apache

2009-08-04 Thread alexarsh

I think your default python is 2.6. What you can try is:
"ls -a /usr/bin/python"
You will see that it's a link to python2.6. You can change the link to
point to python2.5.
(ln -sf  /usr/bin/python)
Then you will have to install mod_python with python2.5.
If you install mod_python from source (by running configure, make,
sudo make install), there is an option to tell mod_python your python
version:

--with-python=PATH  Path to specific Python binary

So just run:
configure --with-python  (from mod_python source
directory)
make
sudo make install

and it should work.

Regards, Alex A.

On Aug 4, 3:48 pm, Salvatore Leone 
wrote:
> > chmod -R 777 /home/testpec/public_html/pecwizard
>
> I think you were right!
>
> but now I've got an error due to mod_python using python2.6 insteal fo 2.5:
>
> ImproperlyConfigured: Error loading MySQLdb module: No module named sets
>
> I've always had this error with the manage.py until I run it with
> "python2.5 manage.py .
>
> Is there a way to tell mod_python to user python2.5 instead of 2.6??
>
> -Salvatore
--~--~-~--~~~---~--~~
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: apache

2009-08-04 Thread alexarsh

Hi,

I had the same problem and what helped me was:
Changing the permissions of my project directory to 777 (The directory
where settings.py located)
Try to run:
chmod -R 777 /home/testpec/public_html/pecwizard

Regards, Alex A.

On Aug 4, 3:28 pm, Salvatore Leone 
wrote:
> Graham Dumpleton ha scritto:
>
>
>
>
>
> > On Aug 4, 8:42 pm, Salvatore Leone 
> > wrote:
>
> >> Hi,
>
> >> I'm trying to move my site from the developemente server to Apache but I
> >> always obtain this error:
>
> >> ImportError: Could not import settings 'pecwizard.settings' (Is it on 
> >> sys.path? Does it have syntax errors?): No module named pecwizard.settings
>
> >> and here is my apache configuration:
>
> >> 
>
> >>     SetHandler python-program
>
> >>     PythonHandler django.core.handlers.modpython
>
> >>     SetEnv DJANGO_SETTINGS_MODULE pecwizard.settings
>
> >>     PythonPath "['/home/testpec/public_html/pecwizard/'] + sys.path"
>
> > PythonPath "[''/home/testpec/public_html', '/home/testpec/public_html/
> > pecwizard/'] + sys.path"
>
> I've tried this and even what Spajderix says, but still having the problem.
>
> This is the errore page I obtain:
>
> MOD_PYTHON ERROR
>
> ProcessId:      25805
> Interpreter:    '127.0.0.1'
>
> ServerName:     '127.0.0.1'
> DocumentRoot:   '/var/www'
>
> URI:            '/pecwizard/'
> Location:       '/pecwizard/'
> Directory:      None
> Filename:       '/var/www/pecwizard'
> PathInfo:       '/'
>
> Phase:          'PythonHandler'
> Handler:        'django.core.handlers.modpython'
>
> Traceback (most recent call last):
>
>  [... cut... I'll post if needed ]
>
> ImportError: Could not import settings 'pecwizard.settings' (Is it on 
> sys.path? Does it have syntax errors?): No module named pecwizard.settings
>
> I think the issue is related to the following line:
>
> DocumentRoot:   '/var/www'
>
> this is the Apache's root. But not the django one... I can copy my
> project to /var/www but it's borious for editing files (must be root...)
>
> any idea?> BTW, putting Django source code in public_html is really bad.
> > Depending on Apache configuration, people could download your source
> > code via '/~testpec/pecwizard/settings.py'.
>
> Oh, I know, but it's just for training myself before doing the same on a
> rack server.
--~--~-~--~~~---~--~~
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: encoding question

2009-06-25 Thread alexarsh

Hi,

Thanks for the reply. I tried both but still got the same result.
Maybe you have other ideas?

Thanks, Alex A.

On Jun 24, 7:51 pm, Gustavo Henrique  wrote:
> try:
>
> from unicodedata import normalize
> mytext = '%u05D9%u05D2'
> newtext = normalize('NFKD', mytext).encode('ASCII','ignore')
>
> or:
>
> import sys
> reload(sys)
> sys.setdefaultencoding('latin-1')
--~--~-~--~~~---~--~~
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: python version

2009-04-05 Thread alexarsh

Thanks for the fast reply.
And how can I find all python versions installed on a machine?

On Apr 5, 7:21 pm, Alex Gaynor  wrote:
> On Sun, Apr 5, 2009 at 12:16 PM, knight  wrote:
>
> > Hi,
>
> > I have 2 servers with my django app:
> > The first one has python2.5 as default python and the second don't (It
> > has python2.5 installed together with the older version).
> > I want to run dumpdata from my application and I have the following
> > problem:
> > If I call: "python manage.py dumpdata" the second server won't work.
> > If I call: "python2.5 manage.py dumpdata" the first server won't
> > work.
> > I mean, I will get the following error:
>
> > Traceback (most recent call last):
> >  File "manage.py", line 2, in 
> >    from django.core.management import execute_manager
> > ImportError: No module named django.core.management
>
> > How can I find the right python version to call? Maybe I can take it
> > from PYTHONPATH? If yes, where can I find it?
>
> > Thanks, Alex A.
>
> Getting errors like that means you have Django installed to the
> site-packages dir of that python version, to figure out which python version
> to run all you should need to do is go to each python interpretter and do
> import django, and whichever one doesn't give an error is the right one to
> use.
>
> Alex
>
> --
> "I disapprove of what you say, but I will defend to the death your right to
> say it." --Voltaire
> "The people's good is the highest law."--Cicero
--~--~-~--~~~---~--~~
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: Languages problem

2009-03-25 Thread alexarsh

Thanks for the replies.
I found my problem. It's the slugify method. It doesn't work with non-
english letters.
Do you have an idea what can be my best alternative, so I can do
slugify with Russian or Arabic letters?

Thanks, Alex A.

On Mar 25, 2:24 am, Malcolm Tredinnick <malc...@pointy-stick.com>
wrote:
> On Tue, 2009-03-24 at 07:33 -0700, alexarsh wrote:
> > Hi,
>
> > No, I don't have any errors. I just get my title empty.
>
> So is the data not being stored in the database? Use psql and have a
> look at the table directly to see what's there.
>
> Django quite happily handles non-ASCII text in the admin
> (http://www.flickr.com/photos/malcolmtredinnick/494663115/), so I agree
> with Muslu: reduce your example to something simpler, particularly by
> removing the custom save() handling in your test case for now. Once you
> have it working in the simple case, that's the right time to add back
> the missing pieces.
>
> 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
-~--~~~~--~~--~--~---



Re: Languages problem

2009-03-24 Thread alexarsh

Hi,

No, I don't have any errors. I just get my title empty.

Regards, Alex A.

On Mar 24, 3:56 pm, Muslu Yüksektepe 
wrote:
> if u have a error pls write all error code.
>
> 2009/3/24 knight 
>
>
>
>
>
> > Hi,
>
> > I have the following class in my models.py:
>
> > class MainCategory(models.Model):
> >    title = models.CharField(max_length=50)
> >    value = models.DecimalField(default=0, max_digits=5,
> > decimal_places=3)
> >    secid = models.SlugField(max_length=1000, editable=False)
> >    def save(self):
> >        if not self.pk:
> >            self.secid = slugify(self.title).replace("-", "_")
> >            if MainCategory.objects.filter(secid = self.secid):
> >                super(MainCategory, self).save()
> >                self.secid = "%s__%s" %(self.secid, self.pk)
> >        return super(MainCategory, self).save()
> >    def __unicode__(self):
> >        return self.title
>
> > I have the following problem:
> > If I create new object with title on Russian or Arabic or any other
> > language, I see it in admin with the empty string instead of it's
> > title.
> > My database is postgres and its utf-8.
> > I guess it's something to do with unicode but I can't understand what
> > exactly.
> > Do you have any ideas?
>
> > Thanks, Arshavski Alexander.
>
> --
> Muslu YÜKSEKTEPE
--~--~-~--~~~---~--~~
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 templates problem

2009-03-01 Thread alexarsh

I can't see the blue admin template. I can't see it only on the page I
overrided - (contrib/admin/templates/admin/index.html)

Regards, Alex A.

On Mar 2, 7:39 am, Malcolm Tredinnick 
wrote:
> On Sun, 2009-03-01 at 21:06 -0800, knight wrote:
> > Hi,
>
> > I have a django application where I override the main admin page
> > (index.html in template/admin)
> > I use apache, I have a link to admin media folder and I have a
> > following problem:
>
> > In my admin pages I see the admin templates on all the pages except
> > the one I overrided (index.html).
>
> What do you mean when you say you don't see the admin template? Do you
> not see your custom version? Or you don't see anything?
>
> 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
-~--~~~~--~~--~--~---