Search Results

Search found 4109 results on 165 pages for 'django paypal'.

Page 51/165 | < Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >

  • django development IDE

    - by Adam Carr
    I have done a little django development but it has all been in a text editor. I was curious what more advanced development tools others are using in their django development. I am used to using Visual Studio for development and really like the intellisense, code completion, and file organization it provides and would like to find something (or a combination of tools) that would provide some of this in the django/python environment.

    Read the article

  • Django: Paginator + raw SQL query

    - by Silver Light
    Hello! I'm using Django Paginator everywhere on my website and even wrote a special template tag, to make it more convenient. But now I got to a state, where I need to make a complex custom raw SQL query, that without a LIMIT will return about 100K records. How can I use Django Pagintor with custom query? Simplified example of my problem: My model: class PersonManager(models.Manager): def complicated_list(self): from django.db import connection #Real query is much more complex cursor.execute("""SELECT * FROM `myapp_person`"""); result_list = [] for row in cursor.fetchall(): result_list.append(row[0]); return result_list class Person(models.Model): name = models.CharField(max_length=255); surname = models.CharField(max_length=255); age = models.IntegerField(); objects = PersonManager(); The way I use pagintation with Django ORM: all_objects = Person.objects.all(); paginator = Paginator(all_objects, 10); try: page = int(request.GET.get('page', '1')) except ValueError: page = 1 try: persons = paginator.page(page) except (EmptyPage, InvalidPage): persons = paginator.page(paginator.num_pages) This way, Django get very smart, and adds LIMIT to a query when executing it. But when I use custom manager: all_objects = Person.objects.complicated_list(); all data is selected, and only then python list is sliced, which is VERY slow. How can I make my custom manager behave similar like built in one?

    Read the article

  • How to set up django-admin.py on windows vista?

    - by shin
    I manage to install Django after some struggles by using setup.py install on Windows Vista Now I tried to use django-admin.py but it is not working. According to this document, http://docs.djangoproject.com/en/dev/ref/django-admin/ The django-admin.py script should be on your system path if you installed Django via its setup.py utility. If it’s not on your path, ... For Windows users, who do not have symlinking functionality available, you can copy django-admin.py to a location on your existing path or edit the PATH settings (under Settings - Control Panel - System - Advanced - Environment...) to point to its installed location. I checked ComputerpropertiesEnvironment Variables, but path to django-admin.py is not in anywhere. So I added C:\Python25\Lib\site-packages\django\bin which is the folder of django-admin.py in User variables for shin Variable PATH, Value C:\Program Files\Google\google_appengine\;C:\Python25\Lib\site-packages\django\bin\ Am I supposed to add to System variables?? But it still does not work. Could anyone tell me how to add the Path in Environment Variables please? Thanks in advance.

    Read the article

  • wsgi django not working

    - by MaKo
    im installing django, the test for wsgi is ok, but when i point my default file to the django test, it doesnt work, this is the test that works fine: default: /etc/apache2/sites-available/default <VirtualHost *:80> ServerName www.example.com ServerAlias example.com ServerAdmin [email protected] DocumentRoot /var/www <Directory /var/www/documents> Order allow,deny Allow from all </Directory> WSGIScriptAlias / /home/ubuntu/djangoProj/micopiloto/application.wsgi <Directory /home/ubuntu/djangoProj/mysitio/wsgi_handler.py> Order allow,deny Allow from all </Directory> </VirtualHost> application.wsgi:: ~/djangoProj/micopiloto import os import sys sys.path.append('/srv/www/cucus/application') os.environ['PYTHON_EGG_CACHE'] = '/srv/www/cucus/.python-egg' def application(environ, start_response): status = '200 OK' output = 'Hello World!MK SS9 tkt kkk' response_headers = [('Content-type', 'text/plain'), ('Content-Length', str(len(output)))] start_response(status, response_headers) return [output] but if I change the default to point to application_sa.wsgi the django test, it doesnt work :( application_sa.wsgi import os, sys sys.path.append('/home/ubuntu/djangoProj/micopiloto') os.environ['DJANGO_SETTINGS_MODULE'] = 'micopiloto.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() I restart the apache server every time i change the wsgi to test, so what im i missing? thanks a lot!

    Read the article

  • Azure SDK + Django + Visual Studio 2012 - Publish to Azure succeeds, but I get 500 error

    - by hume
    I followed the instructions here: https://www.windowsazure.com/en-us/develop/python/tutorials/django-with-visual-studio/ However, whenever I try to open the url to my web app in the cloud I get a 500 error. The tutorial doesn't mention setting up the TEMPLATE_DIRS setting in the django application or doing any work on the cloud service machine to install python/django. Could these be the problem?

    Read the article

  • Django 1.2 crash course needed

    - by delusionalweekendwarrior
    I know Python but I've never used Django. What do I need to know about Django 1.2 to port my typical PHP CRUD web application in one weekend? (Yes I've read Joel Spolsky's Netscape article :-)) I'm reading this tutorial right now and it's excellent. I'm already playing around with inspectdb to generate my models from the existing schema. I'm planning to use the following features of Django this weekend: Fragment caching Static asset versioning (for far future expires) Schema migrations (or whatever they're called in Django) Auto-admin (and customize it later) The test framework ...other stuff I probably don't know about yet I'm familiar with all these concepts in other languages/frameworks, except for the ORM which I've never used. I know SQL pretty well though. Any links, sage bits of advice, gotchas, stuff not mentioned in the (excellent) tutorial/docs, or stuff that is mentioned but warrants repeating == very welcome. Thanks!

    Read the article

  • Get the path to Django itself

    - by andybak
    I've got some code that runs on every (nearly) every admin request but doesn't have access to the 'request' object. I need to find the path to Django installation. I could do: import django django_path = django.__file__ but that seems rather wasteful in the middle of a request. Does putting the import at the start of the module waste memory? I'm fairly sure I'm missing an obvious trick here.

    Read the article

  • FastCGI has to be restarted for new content to be displayed on my Django site

    - by vorpyg
    I'm currently testing serving my Django site with Nginx, FastCGI and Flup. The server is configured roughly as described in the Django Advent article. I had to do some minor modifications in order to make it work in Ubuntu 9.10. The problem is that when I add new content it doesn't show up on the page before I restart the FastCGI process. I haven't enabled any caching functionality in Django, and when I query the DB from the Django shell it works as expected. Anybody got ideas to what's causing this?

    Read the article

  • Django-admin.py not being recognized suddenly

    - by Jen Camara
    I tried starting a new Django project yesterday but when I did "django-admin.py startproject projectname" I got an error stating: "django-admin.py is not recognized as an internal or external command." The strange thing is, when I first installed Django, I made a few projects and everything worked fine. But now after going back a few months later it has suddenly stopped working. I've tried looking around for an answer and all I could find is that this typically has to do with the system path settings, however, I know that I have the proper paths set up so I don't understand what's happening. Does anybody have any idea what's going on?

    Read the article

  • Problems with i18n using django translation on App-Engine with Korean and Hindi

    - by Greg
    I've got a setup based on the post here, and it works perfectly. Adding more languages to the mix, it recognises them fine, except for Korean (ko) and Hindi (hi). Chinese/Japanese/Hebrew are all fine, so nothing to do with encodings/charsets I don't think. Taking a look into the django code inside the app-engine SDK, I notice that all the languages that I'm using except for ko and hi are ones that ship with django - in the default settings.py and inside the locale folder they are missing. If I copy one of the locale folders inside the /usr/local/google_appengine/lib/django[...]/conf/locale and rename it to be 'ko', then it starts working in my app, but I won't be able to replicate this modification when I deploy to app-engine, so need a bit of help understanding what I might be doing wrong. my settings.py is definitely being taken into account, as if I remove languages from there then they stop working (as they should). If I copied the django modules into my app, under 'lib' there say, could I use those instead of the ones app-engine tries to use, maybe? I'm brand new to python/django/app-engine, and developing on a Mac with Leopard, if that makes any difference. I have the latest app-engine SDK as of tuesday.

    Read the article

  • Django tutorial says I haven't set DATABASE_ENGINE setting yet... but I have

    - by Joe
    I'm working through the Django tutorial and receiving the following error when I run the initial python manage.py syncdb: Traceback (most recent call last): File "manage.py", line 11, in <module> execute_manager(settings) File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 362 in execute_manager utility.execute() File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 303, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 195, in run_from_argv self.execute(*args, **options.__dict__) File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 222, in execute output = self.handle(*args, **options) File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 351, in handle return self.handle_noargs(**options) File "/Library/Python/2.6/site-packages/django/core/management/commands/syncdb.py", line 49, in handle_noargs cursor = connection.cursor() File "/Library/Python/2.6/site-packages/django/db/backends/dummy/base.py", line 15, in complain raise ImproperlyConfigured, "You haven't set the DATABASE_ENGINE setting yet." django.core.exceptions.ImproperlyConfigured: You haven't set the DATABASE_ENGINE setting yet. My settings.py looks like: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'dj_tut', # Or path to database file if using sqlite3. 'USER': '', # Not used with sqlite3. 'PASSWORD': '', # Not used with sqlite3. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. 'PORT': '', # Set to empty string for default. Not used with sqlite3. } } I'm guessing this is something simple, but why isn't it seeing the ENGINE setting?

    Read the article

  • Session handling in python / django

    - by Gaurav
    I am creating an application that lets users login using Google, Facebook and the website's native login. The site is being built in Python / Django. What would be the best way to handle login, session management and user authentication? I do not want to use the in-built Django user management. I am using Django very sparingly(URLs, templates)

    Read the article

  • Getting a random element in Django

    - by Sarah
    I just finished the Django tutorial and started work on my own project, however, I seem to have missed something completely. I wanted to get a random slogan from this model: from django.db import models class Slogan(models.Model): slogan = models.CharField(max_length=200) And return it in this view: from django.http import HttpResponse from swarm.sloganrotator.models import Slogan def index(request): return HttpResponse(Slogan.objects.order_by('?')[:1]) However, the view just returns 'Slogan object'. Then I thought, maybe I can access the slogan string itself by simply appending .slogan to the slice, but that gives me an error indicating that the object I have is actually a QuerySet and has no attribute slogan. I've obviously misunderstood something about Django here, but it just doesn't fall into place for me. Any help?

    Read the article

  • Django : looking for a good LDAP manipulation library

    - by sebpiq
    Hi ! I am looking for a good ldap library on Django, that would allow me to manage my ldap server : adding, modifying, deleting entries for groups, users, and all kind of objects The library django-ldapdb looked promising, it offers a Model base class that can be used to declare ldap objects in a Django fashion (which is what we ideally want), however we've had some bugs with it, and furthermore it seems like it is not maintained any more. Does somebody know a good library that could do the trick ? Otherwise I guess I'll just try to improve and debug django-ldapdb ... Thanks !

    Read the article

  • Multiple database support in django.

    - by codebreak
    From some forum I came to know that Multiple database support is added in Django at lower level, but the higher level apis are not added yet. Can anyone please tell me how one can achieve multiple database connections in Django. Does anyone have any idea by when Django will fully/officially support Multiple database connections.

    Read the article

  • HTML5 video element non-seekable when using Django development server

    - by Ory Band
    Hey everyone. I've got a Django app serving a webpage with an HTML5 element. There's a wierd "feature", turning the video element to be non-seekable: video.seekable returns a timeRanges object with length=0, whereas it should be length=1. This means I can't edit the video. JavaScript can't do anything either. The thing is, when I upload the problematic webpage, statically - no Django, just plain HTML/JS/CSS - to my website for testing, it works fine - length=1. However, if I try to serve the same static page on my Django dev server still gives the same problem. I am using Django's static serving for dev/debug purposes - Do you have any idea what is causing this, or how can I fix it? Thanks.

    Read the article

  • Django template Path

    - by user74283
    Hi I m following the tutorial on http://docs.djangoproject.com/en/dev/intro/tutorial02/#intro-tutorial02 in windows 7 envoirement. my settings file is TEMPLATE_DIRS = ( 'C:/django-project/myapp/mytemplates/admin' ) i got the base_template from the template admin/base_site.html from within the default Django admin template directory in the source code of Django itself (django/contrib/admin/templates) into an admin subdirectory of myapp directory as the tutorial instructed. It doesn't seem to take affect for some reason. Any clue of what might be the problem? Do i have to do a sync db ?

    Read the article

  • inheritance from the django user model results in error when changing password

    - by Jerome
    I inherited form the django user model like so: from django.db import models from django.contrib.auth.models import User, UserManager from django.utils.translation import ugettext_lazy as _ class NewUserModel(User): custom_field_1 = models.CharField(_('custom field 1'), max_length=250, null=True, blank=True) custom_field_2 = models.CharField(_('custom field 2'), max_length=250, null=True, blank=True) objects = UserManager() When i go to the admin and add an entry into this model, it saves fine, but below the "Password" field where it has this text "Use '[algo]$[salt]$[hexdigest]' or use the change password form.", if i click on the "change password form' link, it produces this error Truncated incorrect DOUBLE value: '7/password' What can i do to fix this?

    Read the article

  • django, mod_wsgi, MySQL High CPU - Problems

    - by Red Rover
    Good Evening, and thank you for reading this post. I am having a problem with Django after migrating the dB from SQLlite to MySQL. Initially, for the first 48hours, all ran well. But now we are experiencing high cpu about every 30 minutes. This is a production ESX4i VM host, with 2 x 2.8 ghz CPUs and 12 GB ram. I have allocated 4 cpu's to this VM and 4 GB memory. Any insight into this configuration and help with the spikes in CPU would be appreciated. IT is configured to use the prefork MPM. Outlined are the config's for the different services: MySQL Server version: 5.1.61 Source distribution Django 1.3 mod_wsgi Apache/2.2.15 httpd.conf Timeout 120 KeepAlive Off MaxKeepAliveRequests 400 KeepAliveTimeout 3 prefork MPM StartServers 8 MinSpareServers 8 MaxSpareServers 16 ServerLimit 40 MaxClients 40 MaxRequestsPerChild 0 worker MPM StartServers 16 MaxClients 1024 MinSpareThreads 64 MaxSpareThreads 256 ThreadsPerChild 64 MaxRequestsPerChild 10240 MySQL my.conf [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql symbolic-links=0 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid my.cnf wsgi.conf LoadModule wsgi_module modules/mod_wsgi.so /etc/httpd/conf.d/wsgi.conf WSGISocketPrefix /var/run/wsgi WSGIPythonEggs /var/tmp WSGIDaemonProcess SITE maximum-requests=10000 WSGIProcessGroup SITE

    Read the article

  • Nginx + uWSGI + Django performance stuck on 100rq/s

    - by dancio
    I have configured Nginx with uWSGI and Django on CentOS 6 x64 (3.06GHz i3 540, 4GB), which should easily handle 2500 rq/s but when I run ab test ( ab -n 1000 -c 100 ) performance stops at 92 - 100 rq/s. Nginx: user nginx; worker_processes 2; events { worker_connections 2048; use epoll; } uWSGI: Emperor /usr/sbin/uwsgi --master --no-orphans --pythonpath /var/python --emperor /var/python/*/uwsgi.ini [uwsgi] socket = 127.0.0.2:3031 master = true processes = 5 env = DJANGO_SETTINGS_MODULE=x.settings env = HTTPS=on module = django.core.handlers.wsgi:WSGIHandler() disable-logging = true catch-exceptions = false post-buffering = 8192 harakiri = 30 harakiri-verbose = true vacuum = true listen = 500 optimize = 2 sysclt changes: # Increase TCP max buffer size setable using setsockopt() net.ipv4.tcp_rmem = 4096 87380 8388608 net.ipv4.tcp_wmem = 4096 87380 8388608 net.core.rmem_max = 8388608 net.core.wmem_max = 8388608 net.core.netdev_max_backlog = 5000 net.ipv4.tcp_max_syn_backlog = 5000 net.ipv4.tcp_window_scaling = 1 net.core.somaxconn = 2048 # Avoid a smurf attack net.ipv4.icmp_echo_ignore_broadcasts = 1 # Optimization for port usefor LBs # Increase system file descriptor limit fs.file-max = 65535 I did sysctl -p to enable changes. Idle server info: top - 13:34:58 up 102 days, 18:35, 1 user, load average: 0.00, 0.00, 0.00 Tasks: 118 total, 1 running, 117 sleeping, 0 stopped, 0 zombie Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 3983068k total, 2125088k used, 1857980k free, 262528k buffers Swap: 2104504k total, 0k used, 2104504k free, 606996k cached free -m total used free shared buffers cached Mem: 3889 2075 1814 0 256 592 -/+ buffers/cache: 1226 2663 Swap: 2055 0 2055 **During the test:** top - 13:45:21 up 102 days, 18:46, 1 user, load average: 3.73, 1.51, 0.58 Tasks: 122 total, 8 running, 114 sleeping, 0 stopped, 0 zombie Cpu(s): 93.5%us, 5.2%sy, 0.0%ni, 0.2%id, 0.0%wa, 0.1%hi, 1.1%si, 0.0%st Mem: 3983068k total, 2127564k used, 1855504k free, 262580k buffers Swap: 2104504k total, 0k used, 2104504k free, 608760k cached free -m total used free shared buffers cached Mem: 3889 2125 1763 0 256 595 -/+ buffers/cache: 1274 2615 Swap: 2055 0 2055 iotop 30141 be/4 nginx 0.00 B/s 7.78 K/s 0.00 % 0.00 % nginx: wo~er process Where is the bottleneck ? Or what am I doing wrong ?

    Read the article

  • ImportError: No module named _socket? WSGI Deployment into Apache

    - by Sxkaur
    I am using WSGI 3.3 for python 2.7.3 (32bit) for Apache 2.2. I got the binary WSGI from http://code.google.com/p/modwsgi/downloads/detail?name=mod_wsgi-win32-ap22py27-3.3.so. I have been trying to deploy an application but keep on receiving the ImportError: no module named _socket. I have included my wsgi and error logs. APACHE config: #LoadModule vhost_alias_module modules/mod_vhost_alias.so LoadModule wsgi_module modules/mod_wsgi.so <Directory C:/Users/xxxxd/Documents/cahd> AllowOverride None Options None Order deny,allow Allow from all </Directory> WSGIScriptAlias / C:/Users/xxxxd/Documents/cahd/cahd/django.wsgi import os, sys sys.path.append('C:/Users/xxxxd/Documents) sys.path.append('C:/Users/xxxxd/Documents/cahd/') os.environ['DJANGO_SETTINGS_MODULE'] = 'cahd.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() The error was: [Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] Traceback (most recent call last): [Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1 ]File "C:/Users/xxxxd/Documents/cahd/django.wsgi", line 10, in <module> [Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] import django.core.handlers.wsgi [Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] File "C:\\django\\Django-1.4.1\\django\\core\\handlers\\wsgi.py", line 8, in <module> [Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] from django import http [Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] File "C:\\django\\Django-1.4.1\\django\\http\\__init__.py", line 11, in <module> [Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] from urllib import urlencode, quote [Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] File "C:\\Python27\\Lib\\urllib.py", line 26, in <module> [Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] import socket [Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] File "C:\\Python27\\Lib\\socket.py", line 47, in <module> [Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] import _socket [Mon Nov 19 09:44:17 2012] [error] [client 127.0.0.1] ImportError: No module named _socket

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >