Search Results

Search found 17 results on 1 pages for 'zayatzz'.

Page 1/1 | 1 

  • How to install python modules for specific python version

    - by Zayatzz
    I needed to install UCS2 python next to UCS4 python. So I went to comp.lang.python and asked them about it. Probably not the best place to ask it, but they answered https://groups.google.com/forum/?fromgroups#!topic/comp.lang.python/bGuAfqa76W8 and now i have brand new python 2.7.3 ucs2 installed in /opt/bin/python What I need now is - how can I install all other python modules that I have installed for that python version also. Basically stuff like PIL and postgresql and mod_wsgi - basically everything needed to run Django for that python version. Is this the right the place to ask for it?

    Read the article

  • FCGI & recompiling python code without restarting apache.

    - by Zayatzz
    Hello At one hosting company, they used to run python projects with fcgi. They had set it up so that when i changed django.fcgi file, which put django & my project on pythonpath, my project code was instantly recompiled. Because of that a friend set up hosting for our shared project in his server using fastcgi. It has been set up and the python scripts execute as they should, but what we do not know is, how to set it up so that my project would be recompiled when my setup file has been changed. Alan

    Read the article

  • model not showing up in django admin.

    - by Zayatzz
    Hi. I have ceated several django apps and stuffs for my own fund and so far everything has been working fine. Now i just created new project (django 1.2.1) and have run into trouble from 1st moments. I created new app - game and new model Game. i created admin.py and put related stuff into it. Ran syncdb and went to check into admin. Model did not show up there. I proceeded to check and doublecheck and read through previous similar threads: http://stackoverflow.com/questions/1839927/registered-models-do-not-show-up-in-admin http://stackoverflow.com/questions/1694259/django-app-not-showing-up-in-admin-interface But as far as i can tell, they dont help me either. Perhaps someone else can point this out for me. models.py in game app: # -*- coding: utf-8 -*- from django.db import models class Game(models.Model): type = models.IntegerField(blank=False, null=False, default=1) teamone = models.CharField(max_length=100, blank=False, null=False) teamtwo = models.CharField(max_length=100, blank=False, null=False) gametime = models.DateTimeField(blank=False, null=False) admin.py in game app: # -*- coding: utf-8 -*- from jalka.game.models import Game from django.contrib import admin class GameAdmin(admin.ModelAdmin): list_display = ['type', 'teamone', 'teamtwo', 'gametime'] admin.site.register(Game, GameAdmin) project settings.py: MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', ) ROOT_URLCONF = 'jalka.urls' TEMPLATE_DIRS = ( "/home/projects/jalka/templates/" ) INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.admin', 'game', ) urls.py: from django.conf.urls.defaults import * # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Example: # (r'^jalka/', include('jalka.foo.urls')), (r'^admin/', include(admin.site.urls)), ) Alan.

    Read the article

  • Django ImageField validation & PIL

    - by Zayatzz
    Hello On sunday, I had problems with python modules, when I installed stackless python. Now I have compiled and installed : setuptools & python-mysqldb and i got my django project up and running again. (i also reinstalled django-1.1), Then I compiled and installed, jpeg, freetype2 and PIL. I also started using mod_wsgi instead of mod_python. But when uploading imagefield in form I get validationerror: Upload a valid image. The file you uploaded was either not an image or a corrupted image. Searchmonkey shows that it comes from field.py imagefield validation. before raising this error it imports Image from PIL, opens file and verfies it. I tried importing PIL from python prompt manually - it worked just fine. Same with Image.open and Image.verify. So what could be causing this problem? Alan

    Read the article

  • django urlconf or .htaccess trouble

    - by Zayatzz
    Hello I am running my django project from subfolder of a website. Lets say the address where my project is meant to open from is. http://example.com/myproject/ the myproject folder is root folder for my user account. In that folder i have fcgi script that starts my project. The .htaccess file in the folder contains this: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ mysite.fcgi/$1 [QSA,L] The trouble is, that at some cases, instead of redireting user to page like http://example.com/myproject/social/someurl/ it redirects to http://example.com/social/someurl/ which does not work. What i want to know is how to fix this problem. Is this django problem and i should change it with urconf and add myproject to all urls, or should i do this with .htaccess? I found similar question, which, sadly, remains unanswered: http://stackoverflow.com/questions/2321154/how-to-write-htaccess-if-django-project-is-in-subfolder-and-subdomain Alan.

    Read the article

  • Django & google openid authentication with socialauth

    - by Zayatzz
    Hello I am trying to use django-socialauth (http://github.com/uswaretech/Django-Socialauth) for authenticating users for my django project. This is firs time working with openid and i've had to figure out how exactly this open id works. I have more or less understood it, by now, but there are few things that elude me. The authentication process starts when the request is put together in in django-socialauth.openid_consumer.views.begin. I can see that the outgoing authentication request is more or less something like this: https://www.google.com/accounts/o8/ud?openid.assoc_handle=AOQobUckRThPUj3K1byG280Aze-dnfc9Iu6AEYaBwvHE11G0zy8kY8GZ& openid.ax.if_available=fname& openid.ax.mode=fetch_request& openid.ax.required=email& openid.ax.type.email=http://axschema.org/contact/email& openid.ax.type.fname=http://example.com/schema/fullname& openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select& openid.identity=http://specs.openid.net/auth/2.0/identifier_select& openid.mode=checkid_setup&openid.ns=http://specs.openid.net/auth/2.0& openid.ns.ax=http://openid.net/srv/ax/1.0& openid.ns.sreg=http://openid.net/extensions/sreg/1.1& openid.realm=http://localhost/& openid.return_to=http://localhost/social/gmail_login/complete/?janrain_nonce=2010-03-20T11%3A19%3A44ZPZCjNc&openid.sreg.optional=postcode,country,nickname,email This is lot like 2nd example here: http://code.google.com/apis/accounts/docs/OpenID.html#Samples The problem is, that the request, i get back, is nothing like the corresponding example from code.google.com (look at the 3rd example in example responses. Response dict i get is like this: { 'openid.op_endpoint': 'https://www.google.com/accounts/o8/ud', 'openid.sig': 'QWMa4x4ruMUvSCfLwKV6CZRuo0E=', 'openid.ext1.type.email': 'http://axschema.org/contact/email', 'openid.return_to': 'http://localhost/social/gmail_login/complete/?janrain_nonce=2010-03-20T17%3A54%3A06ZHV4cqh', 'janrain_nonce': '2010-03-20T17:54:06ZHV4cqh', 'openid.response_nonce': '2010-03-20T17:54:06ZdC5mMu9M_6O4pw', 'openid.claimed_id': 'https://www.google.com/accounts/o8/id?id=AItOghawkFz0aNzk91vaQWhD-DxRJo6sS09RwM3SE', 'openid.mode': 'id_res', 'openid.ns.ext1': 'http://openid.net/srv/ax/1.0', 'openid.signed': 'op_endpoint,claimed_id,identity,return_to,response_nonce,assoc_handle,ns.ext1,ext1.mode,ext1.type.email,ext1.value.email', 'openid.ext1.value.email': '[email protected]', 'openid.assoc_handle': 'AOQobUfssTJ2IxRlxrIvU4Xg8HHQKKTEuqwGxvwwuPR5rNvag0elGlYL', 'openid.ns': 'http://specs.openid.net/auth/2.0', 'openid.identity': 'https://www.google.com/accounts/o8/id?id=AItOawkghgfhf1FkvaQWhD-DxRJo6sS09RwMKjASE', 'openid.ext1.mode': 'fetch_response'} The socialauth itself has been built to accept my email address this way: elif request.openid and request.openid.ax: email = request.openid.ax.get('email') And obviously this fails. Why i am asking all this is, that perhaps i am doing something wrong and my outgoing request is wrong? Or am i doing all correctly and should change the socialaouth module to accept info in a new way and then commit the change? Alan

    Read the article

  • Django & google openid authentication (openid.ax) with socialauth

    - by Zayatzz
    Hello I am trying to use django-socialauth (http://github.com/uswaretech/Django-Socialauth) for authenticating users for my django project. This is firs time working with openid and i've had to figure out how exactly this open id works. I have more or less understood it, by now, but there are few things that elude me. The authentication process starts when the request is put together in in django-socialauth.openid_consumer.views.begin. I can see that the outgoing authentication request is more or less something like this: https://www.google.com/accounts/o8/ud?openid.assoc_handle=AOQobUckRThPUj3K1byG280Aze-dnfc9Iu6AEYaBwvHE11G0zy8kY8GZ& openid.ax.if_available=fname& openid.ax.mode=fetch_request& openid.ax.required=email& openid.ax.type.email=http://axschema.org/contact/email& openid.ax.type.fname=http://example.com/schema/fullname& openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select& openid.identity=http://specs.openid.net/auth/2.0/identifier_select& openid.mode=checkid_setup&openid.ns=http://specs.openid.net/auth/2.0& openid.ns.ax=http://openid.net/srv/ax/1.0& openid.ns.sreg=http://openid.net/extensions/sreg/1.1& openid.realm=http://localhost/& openid.return_to=http://localhost/social/gmail_login/complete/?janrain_nonce=2010-03-20T11%3A19%3A44ZPZCjNc&openid.sreg.optional=postcode,country,nickname,email This is lot like 2nd example here: http://code.google.com/apis/accounts/docs/OpenID.html#Samples The problem is, that the request, i get back, is nothing like the corresponding example from code.google.com (look at the 3rd example in example responses. Response dict i get is like this: { 'openid.op_endpoint': 'https://www.google.com/accounts/o8/ud', 'openid.sig': 'QWMa4x4ruMUvSCfLwKV6CZRuo0E=', 'openid.ext1.type.email': 'http://axschema.org/contact/email', 'openid.return_to': 'http://localhost/social/gmail_login/complete/?janrain_nonce=2010-03-20T17%3A54%3A06ZHV4cqh', 'janrain_nonce': '2010-03-20T17:54:06ZHV4cqh', 'openid.response_nonce': '2010-03-20T17:54:06ZdC5mMu9M_6O4pw', 'openid.claimed_id': 'https://www.google.com/accounts/o8/id?id=AItOghawkFz0aNzk91vaQWhD-DxRJo6sS09RwM3SE', 'openid.mode': 'id_res', 'openid.ns.ext1': 'http://openid.net/srv/ax/1.0', 'openid.signed': 'op_endpoint,claimed_id,identity,return_to,response_nonce,assoc_handle,ns.ext1,ext1.mode,ext1.type.email,ext1.value.email', 'openid.ext1.value.email': '[email protected]', 'openid.assoc_handle': 'AOQobUfssTJ2IxRlxrIvU4Xg8HHQKKTEuqwGxvwwuPR5rNvag0elGlYL', 'openid.ns': 'http://specs.openid.net/auth/2.0', 'openid.identity': 'https://www.google.com/accounts/o8/id?id=AItOawkghgfhf1FkvaQWhD-DxRJo6sS09RwMKjASE', 'openid.ext1.mode': 'fetch_response'} The socialauth itself has been built to accept my email address this way: elif request.openid and request.openid.ax: email = request.openid.ax.get('email') And obviously this fails. Why i am asking all this is, that perhaps i am doing something wrong and my outgoing request is wrong? Or am i doing all correctly and should change the socialaouth module to accept info in a new way and then commit the change? Alan

    Read the article

  • django auth_views.login and redirects

    - by Zayatzz
    Hello I could not understand why after logging in from address: http://localhost/en/accounts/login/?next=/en/test/ I get refirected to http://localhost/accounts/profile/ So i ran search in django files and found that this address is the default LOGIN_REDIRECT_URL for django. What i did not understand is why it gets redirected to there. I guessed, that my login form's post address should be : /accounts/login/?next=/en/test/ instead of /accounts/login/ I wrote it into template and it worked. But since the redirect url changes dynamically, how can i make this login post forms address change dynamically too? is there a templatetag for that or something? Alan

    Read the article

  • django 'if' statement improperly formatted

    - by Zayatzz
    Im getting strangest error in django so far: 'if' statement improperly formatted Template that raises the error is this: {% if diff >= 0 %} <span class="pos">+{{ diff }} {% else %} <span class="neg">-{{ diff }} {% endif %} </span> <span>{{ a }}</span> view that has a and diff in context is this: def add(request, kaart_id): if request.is_ajax() and request.method == 'POST': x = Kaart.objects.get(id=kaart_id) x.pos += 1 x.save x = Kaart.objects.get(id=kaart_id) from django.utils import simplejson diff = x.pos - x.neg a = "(+1)" context = { 'diff':diff, 'a':a } return render_to_response('sum.html', context, context_instance=RequestContext(request)) It does not matter what equation i use in if, , =, ==.. they all raise the same error. and as far as i can tell its all by the book: http://docs.djangoproject.com/en/dev/ref/templates/builtins/#id5 Alan.

    Read the article

  • django manual login and redirect

    - by Zayatzz
    Hello I have such view that handles user registration. After creating new user i want to manually authenticate it and log it in.: def register(request): ... ... if form.is_valid(): username = form.cleaned_data['username'] password = form.cleaned_data['password1'] email = '' newuser = User.objects.create_user(username, email, password) user = authenticate(username=username, password=password) login (request, user) I have set LOGIN_REDIRECT_URL to '/profile/', but after authenticating and logging user in, it redirects me back to the same view not to /profile/, why? And how can i specify where to redirect after logging in? If i add HttpResponseRedirect('/profile/') After login line - nothing happens. The script never ends up there. Alan.

    Read the article

  • django i18n and translations problem

    - by Zayatzz
    Hello I have a problem with django translations. Problem 1 - i updated string in django.po file, but the change does not appear on the webpage. Problem 2 - i have created my own locale file with django-admin.py makemessages -l et, added the translation string into file, but they too do not appear on the page. I do not think this is setting problem, because the translations from django.po file do appear on the website, its just the changes and the translations from my own generated file that do not appear. Alan

    Read the article

  • Django openid authentication with google

    - by Zayatzz
    Hello I am looking into authenticating via google. I dont understand how it works:http://code.google.com/apis/accounts/docs/OpenID.html#Samples If i do that 2nd request by entering the data as one url with params into browser i get back XML file. Should i not get back sample response nr3? Can somebody explain this to me? The problem is, that im trying to sort through some third party app that uses google openid authentication and its not recieving authenticated users e-mail back, like in sample response 3. Alan PS i have read through similar questions and their responses and gone through pages like: http://stackoverflow.com/questions/353880/how-does-openid-authentication-works http://www.windley.com/archives/2006/04/how_does_openid.shtml http://tinisles.blogspot.com/2008/02/how-does-openid-work.html http://openid.net/pres/protocolflow-1.1.png etc..

    Read the article

  • django inner redirects

    - by Zayatzz
    Hello I have one project that in my own development computer (uses mod_wsgi to serve the project) caused no problems. In live server (uses mod_fastcgi) it generates 500 though. my url conf is like this: # -*- coding: utf-8 -*- from django.conf.urls.defaults import * # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), url(r'^', include('jalka.game.urls')), ) and # -*- coding: utf-8 -*- from django.conf.urls.defaults import * from django.contrib.auth import views as auth_views urlpatterns = patterns('jalka.game.views', url(r'^$', view = 'front', name = 'front',), url(r'^ennusta/(?P<game_id>\d+)/$', view = 'ennusta', name = 'ennusta',), url(r'^login/$', auth_views.login, {'template_name': 'game/login.html'}, name='auth_login'), url(r'^logout/$', auth_views.logout, {'template_name': 'game/logout.html'}, name='auth_logout'), url(r'^arvuta/$', view = 'arvuta', name = 'arvuta',), ) and .htaccess is like that: Options +FollowSymLinks RewriteEngine on RewriteOptions MaxRedirects=10 # RewriteCond %{HTTP_HOST} . RewriteCond %{HTTP_HOST} ^www\.domain\.com RewriteRule (.*) http://domain.com/$1 [R=301,L] AddHandler fastcgi-script .fcgi RewriteCond %{HTTP_HOST} ^jalka\.domain\.com$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*) cgi-bin/fifa2010.fcgi/$1 [QSA,L] RewriteCond %{HTTP_HOST} ^subdomain\.otherdomain\.eu$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*) cgi-bin/django.fcgi/$1 [QSA,L] Notice, that i have also other project set up with same .htaccess and that one is running just fine with more complex urls and views fifa2010.fcgi: #!/usr/local/bin/python # -*- coding: utf-8 -*- import sys, os DOMAIN = "domain.com" APPNAME = "jalka" PREFIX = "/www/apache/domains/www.%s" % (DOMAIN,) # Add a custom Python path. sys.path.insert(0, os.path.join(PREFIX, "htdocs/django/Django-1.2.1")) sys.path.insert(0, os.path.join(PREFIX, "htdocs")) sys.path.insert(0, os.path.join(PREFIX, "htdocs/jalka")) # Switch to the directory of your project. (Optional.) os.chdir(os.path.join(PREFIX, "htdocs", APPNAME)) # Set the DJANGO_SETTINGS_MODULE environment variable. os.environ['DJANGO_SETTINGS_MODULE'] = "%s.settings" % (APPNAME,) from django.core.servers.fastcgi import runfastcgi runfastcgi(method="threaded", daemonize="false") Alan

    Read the article

  • django internationalization and translations problem

    - by Zayatzz
    I have a problem with django translations. Problem 1 - i updated string in django.po file, but the change does not appear on the webpage. Problem 2 - i have created my own locale file with django-admin.py makemessages -l et, added the translation string into file, but they too do not appear on the page. I do not think this is setting problem, because the translations from django.po file do appear on the website, its just the changes and the translations from my own generated file that do not appear. Edit: My settings.py contains this: gettext = lambda s: s LANGUAGE_CODE = 'et' LANGUAGES = ( ('et', gettext('Estonian')), ) my own locale files are in /path/to/project/locale/et/LC_MESSAGES/ and the files are django.mo and django.po the file i refer to in problem 1 is django own et transaltion, which i changed.

    Read the article

  • javascript: problem with function

    - by Zayatzz
    hi I have this simple function: <script type="text/javascript"> //<![CDATA[ jQuery(function($){ function here(b){alert(b);} ; here(6); }); //]]> </script> and i have this button on page: <button onclick="here(7);">TEST</button> The alert fires on page load, but not on button click. If i replace the here(7) with alert, it works fine. Why doesnt it work with function though? Alan

    Read the article

  • jquery script that used to work is not working with jquery 1.4.2

    - by Zayatzz
    ... and i cant figure out why. The script is following: <script type="text/javascript" src="http://path/to/js/jquery-1.4.2.min.js"></script> <script type="text/javascript"> function openMediaPlayer() { $('#flashMovie').animate({'height':'333px'}); } function closeMediaPlayer() { $('#flashMovie').animate({'height':'80px'}); } jQuery(function($){ $('#videoholder').bind('mouseenter', function(){ openMediaPlayer(); }); $('#videoholder').bind('mouseleave', function(){ closeMediaPlayer(); }); }); </script> <div id="videoholder" style="height:80px;width:412px;"> <object width="412" height="80" type="application/x-shockwave-flash" id="flashMovie" name="flashMovie" style="height: 80px;" data="http://path/to/Player.swf"><param name="menu" value="false"><param name="bgcolor" value="#666666"><param name="allowFullscreen" value="true"><param name="flashvars" value="playlistURL=http://path/to/Player/data/playlist.xml"></object> </div> pure and simple resizing flash object. It worked with older(1.3.2) jquery verision. The animate just does not work. Can anyone tell me what i should change to get it working again? Alan.

    Read the article

  • jquery script that used to work is not working with jquery 1.4.2

    - by Zayatzz
    ... and i cant figure out why. The script is following: <script type="text/javascript" src="http://path/to/js/jquery-1.4.2.min.js"></script> <script type="text/javascript"> function openMediaPlayer() { $('#flashMovie').animate({'height':'333px'}); } function closeMediaPlayer() { $('#flashMovie').animate({'height':'80px'}); } jQuery(function($){ $('#videoholder').bind('mouseenter', function(){ openMediaPlayer(); }); $('#videoholder').bind('mouseleave', function(){ closeMediaPlayer(); }); }); </script> <div id="videoholder" style="height:80px;width:412px;"> <object width="412" height="80" type="application/x-shockwave-flash" id="flashMovie" name="flashMovie" style="height: 80px;" data="http://path/to/Player.swf"><param name="menu" value="false"><param name="bgcolor" value="#666666"><param name="allowFullscreen" value="true"><param name="flashvars" value="playlistURL=http://path/to/Player/data/playlist.xml"></object> </div> pure and simple resizing flash object. It worked with older(1.3.2) jquery verision. The animate just does not work. Can anyone tell me what i should change to get it working again? Alan.

    Read the article

1