Все вопросы: [pylons]

77 вопросов

похожие теги:
0
голосов
1ответов
406 просмотров

Install custom modules in a python virtual enviroment

I am doing some pylons work in a virtual python enviorment, I want to use MySQL with SQLalchemy but I can't install the MySQLdb module on my virtual enviorment, I can't use easyinstall because I am using a version that was compiled for python 2.6 in a .exe format, I tried running the install fro...

1
голосов
2ответов
129 просмотров

call pylons controller from vb.net

i have a application thats writen with the pylons framework. Now i want to call some controllers from a vb.net application. How should i do this? I've tried it like this: Dim webclient As New WebClient Dim dataStream As IO.Stream = webclient.OpenRead("http://192.168.0.20:5000/controller/default...

1
голосов
1ответов
1386 просмотров

redirect() Not Actually Redirecting (Routes for Pylons)

I am constructing a table of routes in my Pylons app. I can't get redirect() to work the way that it should work. I'm not sure what I'm doing wrong. Here is an example of redirect() usage from the Routes documentation: map.redirect("/home/index", "/", _redirect_code="301 Moved Permanently")...

6
голосов
3ответов
2838 просмотров

Random ids in sqlalchemy (pylons)

I'm using pylons and sqlalchemy and I was wondering how I could have some randoms ids as primary_key.

2
голосов
4ответов
5001 просмотров

Snow Leopard Python 2.6 problems getting PIL to work

I installed libjpeg and PIL, but when I try to save a JPG image, I always get this error: ImportError: The _imaging C module is not installed Any help much appreciated! I tried to import _imaging w/ Python interpreter to see what's wrong and got this: >>> import _imaging Tracebac...

2
голосов
3ответов
1125 просмотров

How to keep query parameters during pagination with webhelpers.paginate

I look an example of paginating from http://rapidprototype.ch/bg2docs/tg2pagination.html for my Turbogears 2 project and it works great but, I have a problem regarding my query parameters when I change the page I'm looking. This is what I have in my controller when listing. def list(self, page=...

4
голосов
3ответов
2490 просмотров

Python Image Uploading with AjaxUpload

I'm trying to use AjaxUpload with Python: http://valums.com/ajax-upload/ I would like to know how to access the uploaded file with Python. On the web site, it says: * PHP: $_FILES['userfile'] * Rails: params[:userfile] What is the Syntax for Python? request.params['userfile'] doesn't seem ...

3
голосов
1ответов
1517 просмотров

Paster cannot stop daemon

I'm using the following command in my pylons app in an attempt to stop the daemon on the server: paster serve --daemon dev.ini stop This is the error I get: No PID file exists in paster.pid Could not stop daemon; aborting Wondering how I can stop this daemon so I can reload dev.ini. Thanks!

3
голосов
3ответов
1142 просмотров

Creating tables with pylons and SQLAlchemy

I'm using SQLAlchemy and I can create tables that I have defined in /model/__init__.py but I have defined my classes, tables and their mappings in other files found in the /model directory. For example I have a profile class and a profile table which are defined and mapped in /model/profile.py ...

1
голосов
1ответов
162 просмотров

set URL when enter site - pylons

My problem is that when a user enter my website like: www.mywebsite.com I use pylonshq I want the URL to be change to /#home if its possible via. map.connect. I have no idéa how to fix it via. python, so therefore a guide or maybe some samples would be a help. Right now it looks like this: ...

2
голосов
1ответов
3313 просмотров

Sqlalchemy : association table for many-to-many relationship between groups and members. How can I delete a relationship?

I have those tables setup : http://pastie.org/627764 ... # This is the association table for the many-to-many relationship between # groups and members - this is, the memberships. user_group_table = Table('user_group', metadata, Column('user_name', Integer, ForeignKey('us...

3
голосов
4ответов
2368 просмотров

Do not require non-NULL field (allow empty strings) in FormAlchemy

I'm fairly novice to FormAlchemy and it seems that I don't get something. I have a SQLAlchemy model defined like this: ... class Device(meta.Base): __tablename__ = 'devices' id = sa.Column('id_device', sa.types.Integer, primary_key=True) serial_number = sa.Column('sn', sa.types.Unic...

1
голосов
1ответов
75 просмотров

refer to map via. maps() action in python/ pylonshq

I just started to learn python, and i'm totally new and n00b. Normally i work with php. I choose to use this framework: http://pylonshq.com/ I have created an map called ajax in my controller map. now i just need my "htaccees" file to find the ajax map. I want the file to go into the map /aj...

0
голосов
1ответов
469 просмотров

Unit testing Couchdb model in Pylons

Given a default pylons installation are there any examples available on the best practices for unit testing a CouchDB model?

3
голосов
2ответов
675 просмотров

What's the equivalent of Rails' Migrations or Django's South in Pylons and TG2?

Does anyone know how Pylons and TG2 projects handle database migrations? I'm looking for something similar to Rails' Migrations and Django's South.

1
голосов
1ответов
267 просмотров

Check whether debug is enabled in a Pylons application

I'm working on a fairly simple Pylons 0.9.7 application. How do I tell, in code, whether or not debugging is enabled? That is, I'm interested in the value of the debug setting under [app:main] in my INI file. More generally, how do I access the other values from there in my code?

18
голосов
4ответов
10978 просмотров

Django vs. Pylons

I've recently become a little frustrated with Django as a whole. It seems like I can't get full control over anything. I love Python to death, but I want to be able (and free) to do something as simple as adding a css class to an auto-generated form. One MVC framework that I have really been en...

1
голосов
1ответов
739 просмотров

nose tests of Pylons app with models in init_model?

I have a stock Pylons app created using paster create -t pylons with one controller and matched functional test, added using paster controller, and a SQLAlchemy table and mapped ORM class. The SQLAlchemy stuff is defined in the init_model() function rather than in module scope (and needs to be th...

4
голосов
1ответов
594 просмотров

Default route doesn't work

I'm using the standard routing module with pylons to try and setup a default route for the home page of my website. I've followed the instructions in the docs and here http://routes.groovie.org/recipes.html but when I try http://127.0.0.1:5000/ I just get the 'Welcome to Pylons' default page. ...

1
голосов
1ответов
417 просмотров

Importing Model / Lib Class and calling from controller

I'm new to python and pylons although experienced in PHP. I'm trying to write a model class which will act as a my data access to my database (couchdb). My problem is simple My model looks like this and is called models/BlogModel.py from couchdb import * class BlogModel: def getTitles(...

2
голосов
4ответов
251 просмотров

What is the best method to get a number from an user?

I was wondering for a small list of numbers [1..20], what kind of control will you advise to prompt the user for his selection. I was thinking of a NumericUpDown control but it does not exist for WebForm and to make matters worse, I am deploying on a Pylons application (Python Framework) Do you...

2
голосов
1ответов
836 просмотров

How to make authkit session cookie HttpOnly in pylons?

I use authkit module with Pylons and I see that session cookie it sets (aptly named authkit) is not set to be HttpOnly. Is there a simple way to make it HttpOnly? (By "simple" I mean the one that does not involve hacking authkit's code.)

1
голосов
2ответов
680 просмотров

How do I link relative to a Pylons application root?

In Pylons I have a mako template linking to /static/resource.css. How do I automatically link to /pylons/static/resource.css when I decide to map the application to a subdirectory on my web server?

1
голосов
1ответов
1757 просмотров

FormEncode, pylons, and mako example

I'm working in pylons with mako, and I'd like to create forms and validations with FormEncode for several parts of my application. I can't seem to find any good examples of the whole process. My question is twofold: Technical FancyValidators and Schemas - Their relationship and syntax Py...

3
голосов
2ответов
1061 просмотров

How can I launch a background process in Pylons?

I am trying to write an application that will allow a user to launch a fairly long-running process (5-30 seconds). It should then allow the user to check the output of the process as it is generated. The output will only be needed for the user's current session so nothing needs to be stored long-...

0
голосов
3ответов
355 просмотров

How can I display updating output of a slow script using Pylons?

I am writing an application in Pylons that relies on the output of some system commands such as traceroute. I would like to display the output of the command as it is generated rather than wait for it to complete and then display all at once. I found how to access the output of the command in P...

3
голосов
2ответов
905 просмотров

Middleware for both Django and Pylons

It appears to me that Django and Pylons have different ideas on how middleware should work. I like that Pylons follows the standardized PEP 333, but Django seems to have more widespread adoption. Is it possible to write middleware to be used in both? The project that involves said middleware is ...

2
голосов
2ответов
462 просмотров

What can I attach to pylons.request in Pylons?

I want keep track of a unique identifier for each browser that connects to my web application (that is written in Pylons.) I keep a cookie on the client to keep track of this, but if the cookie isn't present, then I want to generate a new unique identifier that will be sent back to the client wi...

4
голосов
3ответов
2642 просмотров

Пилоны против Turbogears

Я раздумываю, следует ли мне использовать Turbogears или Pylons для моего проекта. Я знаю, что Turbogears2 основан на Pylons. Что предлагает Turbogears, чего нет в Pylon? Спасибо.

4
голосов
3ответов
1152 просмотров

Использование Parallels для тестирования веб-приложений в IE

Я разрабатываю веб-приложение в Pylons для Mac. Мой сервер разработки обслуживает страницы на http://127.0.0.1:5000/ . Есть ли способ получить доступ к этой странице из Parallels для тестирования с IE без необходимости настраивать среду разработки в Windows?