Title
stringlengths 11
150
| A_Id
int64 518
72.5M
| Users Score
int64 -42
283
| Q_Score
int64 0
1.39k
| ViewCount
int64 17
1.71M
| Database and SQL
int64 0
1
| Tags
stringlengths 6
105
| Answer
stringlengths 14
4.78k
| GUI and Desktop Applications
int64 0
1
| System Administration and DevOps
int64 0
1
| Networking and APIs
int64 0
1
| Other
int64 0
1
| CreationDate
stringlengths 23
23
| AnswerCount
int64 1
55
| Score
float64 -1
1.2
| is_accepted
bool 2
classes | Q_Id
int64 469
42.4M
| Python Basics and Environment
int64 0
1
| Data Science and Machine Learning
int64 0
1
| Web Development
int64 1
1
| Available Count
int64 1
15
| Question
stringlengths 17
21k
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PHP or Python for Image Processing?
| 4,641,248 | 1 | 3 | 2,343 | 0 |
php,python,image,image-processing,image-manipulation
|
Python is more clean and readable.
For image processing there is the imageMagic library available for Python and PHP too.
If you want to do some other complex image processing, which cannot by done using a library and you still want to do it in Python or PHP, then Python is defenitely the answer as Python can be extended with C -- But, wait, you didn't mention programming in C, well, there is Cython! It would allow you to write Python modules which are afterwards compiled to C
| 0 | 0 | 0 | 1 |
2011-01-09T19:19:00.000
| 5 | 0.039979 | false | 4,641,187 | 1 | 0 | 1 | 4 |
I am writing an application for image processing. I am just wondering which programming language would be the best fit. Python or PHP. This process is system based not web based so I am just thinking if Python could be of more help.
Let me know your thoughts!
|
The @login_required decorator of Django redirects people to /accounts/login when they aren't registered. How to change this URL?
| 59,461,520 | 0 | 9 | 4,416 | 0 |
python,django,authentication,configuration,login
|
LOGIN_REDIRECT_URL = '/login' will solve your problem.
LOGIN_URL = '/login' is just for telling django that '/login' is your login URL and LOGIN_REDIRECT_URL will tell django where to redirect user after login.
| 0 | 0 | 0 | 0 |
2011-01-10T05:51:00.000
| 3 | 0 | false | 4,644,049 | 0 | 0 | 1 | 1 |
I want it to redirect to "/login" instead of "/accounts/login"
Is there a setting I can change?
|
django long running process database connection
| 4,644,443 | 1 | 1 | 571 | 1 |
python,django,apache,mod-wsgi
|
The broken pipe mostly mean that one socket in the canal of transmission has been closed without notifying the other one , in your case i think it mean that the database connection that you have establish was closed from the database part, so when you code try to use it, it raise the exception.
Usually the database connection has a time out which "usually" you can configure by making it more bigger to solve this kind of problem , check your database documentation to see how.
N.B: you don't give us much detail so i'm just trying to make assumption here.
Well hope this can help.
| 0 | 0 | 0 | 0 |
2011-01-10T06:42:00.000
| 1 | 1.2 | true | 4,644,317 | 0 | 0 | 1 | 1 |
i have a django project with a long running (~3hour) management command
in my production environment ( apache mod_wsgi ) this process fails with a broken pipe(32) at the end, when trying to update the database.
thank you
|
Add a custom link to hudson project page
| 4,653,469 | 1 | 5 | 1,120 | 0 |
python,continuous-integration,python-sphinx,hudson
|
Get the sidelink plugin. That let's you add a link to the ones that are on the left-hand side of the project page.
| 0 | 0 | 0 | 0 |
2011-01-10T10:06:00.000
| 3 | 0.066568 | false | 4,645,581 | 0 | 0 | 1 | 2 |
I'm using Hudson to generate the documentation for a Python project using Sphinx. This generates HTML documentation in the folder project/_build/html, which I set up to be used as an build artifact. Now after running the job, I can navigate to the documentation by clicking on the "Artifacts" link, then on the folder, and then on the index.html file. That's a bit cumbersome so I would like to customize the project page so I can have a "View Documentation" link that takes me straight to the index.html file. Is there any way to do that with hudson?
|
Add a custom link to hudson project page
| 4,647,033 | 2 | 5 | 1,120 | 0 |
python,continuous-integration,python-sphinx,hudson
|
The Project Description allows HTML, just edit it and place the link to your docs from the last successful build.
| 0 | 0 | 0 | 0 |
2011-01-10T10:06:00.000
| 3 | 1.2 | true | 4,645,581 | 0 | 0 | 1 | 2 |
I'm using Hudson to generate the documentation for a Python project using Sphinx. This generates HTML documentation in the folder project/_build/html, which I set up to be used as an build artifact. Now after running the job, I can navigate to the documentation by clicking on the "Artifacts" link, then on the folder, and then on the index.html file. That's a bit cumbersome so I would like to customize the project page so I can have a "View Documentation" link that takes me straight to the index.html file. Is there any way to do that with hudson?
|
How to convert the django web application into the desktop application
| 4,647,246 | 1 | 3 | 6,009 | 0 |
python,django
|
There are two places you can go to try to decouple the view and put it into a new desktop app. First you can use the existing controller and model and adapt a new view to that. Second, you can use only the existing model and build a new view and controller.
If you haven't adhered closely enough to the MVC principles that you can detach the model from the rest of the application, you can simply rewrite the entire thing. if you are forced to go this route, bail on django and http entirely (as duffymo suggests above).
You have to also evaluate these solutions based upon performance requirements and "heaviness" of the services. If you have stringent performance requirements then relying on the HTTP layer just gets in the way, and providing a simple API into your model is the way to go.
There are clearly a lot of possibly solutions but this is the approach I would take to deciding what the appropriate one is...
| 0 | 0 | 0 | 0 |
2011-01-10T12:11:00.000
| 8 | 0.024995 | false | 4,646,659 | 0 | 0 | 1 | 3 |
How to convert the web site develpoed in django, python into desktop application.
I am new to python and django can you please help me out
Thanks in Advance
|
How to convert the django web application into the desktop application
| 4,646,707 | 2 | 3 | 6,009 | 0 |
python,django
|
For starters, you'll have to replace the web UI with a desktop technology like Tk/Tcl.
If you do that, you may not want to use HTTP as the protocol between the client and the services.
Django is a web framework. If you're switching to a desktop, you'll have to forego Django.
| 0 | 0 | 0 | 0 |
2011-01-10T12:11:00.000
| 8 | 0.049958 | false | 4,646,659 | 0 | 0 | 1 | 3 |
How to convert the web site develpoed in django, python into desktop application.
I am new to python and django can you please help me out
Thanks in Advance
|
How to convert the django web application into the desktop application
| 41,890,316 | 0 | 3 | 6,009 | 0 |
python,django
|
I am thinking about a similar Problem.
Would it be enough to habe a minimal PyQt Gui that enables you to present the djando-website from localhost (get rid of TCP/HTTPS on loop interface somehow) via QtWebkit?
All you seem to need is to have a minimal Python-Broser, that surfs the build in Webserver (and i guess you could even call Django directly for the html-payload without going over the HTTP/TCP layers).
| 0 | 0 | 0 | 0 |
2011-01-10T12:11:00.000
| 8 | 0 | false | 4,646,659 | 0 | 0 | 1 | 3 |
How to convert the web site develpoed in django, python into desktop application.
I am new to python and django can you please help me out
Thanks in Advance
|
Call a url that writes to a file on a server (free)
| 4,650,080 | 2 | 1 | 250 | 0 |
python,html,url
|
You need a script that you can execute on the server. This can be written in any language you want. Python works fine. Unless loads of people call the URL at once you can use CGI (it's a bit slow when using Python).
| 0 | 0 | 1 | 0 |
2011-01-10T17:03:00.000
| 1 | 1.2 | true | 4,649,343 | 0 | 0 | 1 | 1 |
What I'm asking may sound strange, but I really need it..
What I need is a url that I can setup (like a free server with php support, but something reliable) and call that url from python with the arguments I need and it would write the values to a file.
I don't know if what I really need is a server with php (I hope not).
Is there anyway of doing it with google docs? are there any other services you guys came across that where any good?
Ps. I need this for a program that shows the user some thumbnails and lets the user tell what kind of pic it is ( it's done by clicking a button wich I hope will call the URL I'm asking for with the arguments)
Clear enough?
Ps. Not like captcha. I just need to call for example http:/aaa.a/file.xxx?id=1&tag=funny
So that I present my user with the images, and as they click to choose the apropriate tag, that url writes it to file (a file I can later have acces to)
|
Reference list item by index within Django template?
| 4,651,237 | 24 | 137 | 132,262 | 0 |
python,django,django-templates
|
{{ data.0 }} should work.
Let's say you wrote data.obj django tries data.obj and data.obj(). If they don't work it tries data["obj"]. In your case data[0] can be written as {{ data.0 }}. But I recommend you to pull data[0] in the view and send it as separate variable.
| 0 | 0 | 0 | 0 |
2011-01-10T20:27:00.000
| 4 | 1 | false | 4,651,172 | 0 | 0 | 1 | 1 |
This may be simple, but I looked around and couldn't find an answer. What's the best way to reference a single item in a list from a Django template?
In other words, how do I do the equivalent of {{ data[0] }} within the template language?
|
How to: Click button, then do stuff, then show confirmation in Django
| 4,652,188 | 4 | 1 | 864 | 0 |
python,django,post,button,django-forms
|
That's what a Form is for. You can create a small HTML form with just the button.
The form's action is the URI to which a request is sent.
Django parse the URI and calls a view function.
The function does the work and returns the resulting page.
| 0 | 0 | 0 | 0 |
2011-01-10T22:05:00.000
| 1 | 1.2 | true | 4,652,048 | 0 | 0 | 1 | 1 |
Basic question, but I can't find a simple answer anywhere.
What is the best way to do the following in Django:
User pushes button
Some Python code gets crunched server-side
User sees confirmation page
All the user needs to know is that the server did what he told it to. No input other than the button click.
Thanks in advance for your help.
|
Login hook on Google Appengine
| 4,663,607 | 0 | 7 | 345 | 0 |
python,events,google-app-engine,login,hook
|
I'm using Python on GAE (so it may be different for Java) but have seen no documentation about such a hook for a user logging in. If you used one of the session management frameworks you'd probably get some indication for that, but otherwise I do this kind of house keeping on my opening page itself which requires login. (What do you want to do about an already logged in user returning to your site a few days later... that is, do you really want to record logins or the start time of a visit/session??)
If I wanted to do this but with multiple landing pages, and without using a session framework,
I'd use memcache to do a quick check on every page request and then only write to the datastore when a new visit starts.
| 0 | 1 | 0 | 0 |
2011-01-11T11:06:00.000
| 2 | 0 | false | 4,656,923 | 0 | 0 | 1 | 1 |
Every time a user logs in to the application, I want to perform a certain task, say, record the time of login. So I wanted to know if a hook is fired on login by default? If yes, how can I make my module respond to it.
Edit - Assume there are multiple entry points in the application to login.
|
Alternatives to PHP Cron Job for Long Running Jobs
| 4,661,872 | 0 | 1 | 1,341 | 0 |
php,python,cron,web-hosting
|
A different solution might be to use a database, and not bite off so much work at once. Make a table listing the sites you pull, and store when they were last pulled. Then have the cron pull out 1 or 2 that haven't been pulled in a while. Have it run often, then you'll always have fresh data, but the script will have an easier time working as its not trying to do so much at once. This concept will scale well.
| 0 | 0 | 0 | 1 |
2011-01-11T18:45:00.000
| 3 | 1.2 | true | 4,661,377 | 0 | 0 | 1 | 2 |
We have a website that lists links to blogs in realtime. The problem is that the pages are slow to load because they are reading data from the various source sites.
I wrote a PHP script that creates an HTML version of each page. This runs once each hour. The problem is that the PHP script is timing out before it finishes all the pages. I know that I could increase the execute time allowed for PHP scripts, but this does not seem like the most efficient way to handle the issue.
Is there another way to do this? I just don't know what to begin looking for - PERL? JAVA? Python? How do these scripts run on a server? What should I look for from my web host?
|
Alternatives to PHP Cron Job for Long Running Jobs
| 4,661,510 | 1 | 1 | 1,341 | 0 |
php,python,cron,web-hosting
|
Given the fact that your original problem is one of network latency ("pages are slow to load") I see no reason to believe that PHP is the bottleneck here. I doubt changing languages will affect your script run time.
| 0 | 0 | 0 | 1 |
2011-01-11T18:45:00.000
| 3 | 0.066568 | false | 4,661,377 | 0 | 0 | 1 | 2 |
We have a website that lists links to blogs in realtime. The problem is that the pages are slow to load because they are reading data from the various source sites.
I wrote a PHP script that creates an HTML version of each page. This runs once each hour. The problem is that the PHP script is timing out before it finishes all the pages. I know that I could increase the execute time allowed for PHP scripts, but this does not seem like the most efficient way to handle the issue.
Is there another way to do this? I just don't know what to begin looking for - PERL? JAVA? Python? How do these scripts run on a server? What should I look for from my web host?
|
Accepting mobile short code texts (e.g. Twitter) with Django
| 4,666,780 | 0 | 0 | 342 | 0 |
python,django,mobile-phones,mobile-website,sms-gateway
|
First of all you either need to setup your own gateway with a mobile phone and a software that reads incoming text and processes it or find a service provider. If you buy a short code it may be costly but there should be some services around that allows you to use common number with a keyword to receive and process incoming txts.
| 0 | 0 | 0 | 0 |
2011-01-11T21:13:00.000
| 3 | 0 | false | 4,662,738 | 0 | 0 | 1 | 1 |
Ive tried to look up how to accept texts from mobile phones with Django (e.g. like Twitter) to post data to user accounts. All i have ran across is how to make a mobile web app with django as in different layouts etc.. Has anyone any idea where a tutorial on this might be or how in the world to start doing this with django? Thanks!
|
A Read-Only Relational Database on Google App Engine?
| 4,663,353 | 2 | 2 | 803 | 1 |
python,google-app-engine,sqlite,relational-database,non-relational-database
|
I don't think you're likely to find anything like that...surely not over blobstore. Because if all your data is stored in a single blob, you'd have to read the entire database into memory for any operation, and you said you can't do that.
Using the datastore as your backend is more plausible, but not much. The big issue with providing a SQLite driver there would be implementing transaction semantics, and since that's the key thing GAE takes away from you for the sake of high availability, it's hard to imagine somebody going to much trouble to write such a thing.
| 0 | 1 | 0 | 0 |
2011-01-11T21:55:00.000
| 3 | 1.2 | true | 4,663,071 | 0 | 0 | 1 | 2 |
I have a medium size (~100mb) read-only database that I want to put on google app engine. I could put it into the datastore, but the datastore is kind of slow, has no relational features, and has many other frustrating limitations (not going into them here). Another option is loading all the data into memory, but I quickly hit the quota imposed by google. A final option is to use django-nonrel + djangoappengine, but I'm afraid that package is still in its infancy.
Ideally, I'd like to create a read-only sqlite database that uses a blobstore as its data source. Is this possible?
|
A Read-Only Relational Database on Google App Engine?
| 4,663,631 | 2 | 2 | 803 | 1 |
python,google-app-engine,sqlite,relational-database,non-relational-database
|
django-nonrel does not magically provide an SQL database - so it's not really a solution to your problem.
Accessing a blobstore blob like a file is possible, but the SQLite module requires a native C extension, which is not enabled on App Engine.
| 0 | 1 | 0 | 0 |
2011-01-11T21:55:00.000
| 3 | 0.132549 | false | 4,663,071 | 0 | 0 | 1 | 2 |
I have a medium size (~100mb) read-only database that I want to put on google app engine. I could put it into the datastore, but the datastore is kind of slow, has no relational features, and has many other frustrating limitations (not going into them here). Another option is loading all the data into memory, but I quickly hit the quota imposed by google. A final option is to use django-nonrel + djangoappengine, but I'm afraid that package is still in its infancy.
Ideally, I'd like to create a read-only sqlite database that uses a blobstore as its data source. Is this possible?
|
Change default Python interpreter on Windows XP
| 4,664,796 | 9 | 13 | 39,814 | 0 |
python,django,version
|
Change your PATH system environment variable to point to the version of Python you want to use.
| 0 | 0 | 0 | 0 |
2011-01-12T01:44:00.000
| 7 | 1.2 | true | 4,664,646 | 1 | 0 | 1 | 1 |
I have two python versions: Python 2.5 and Python 2.7. When I'm setting up django, I want to use Python 2.7, but django is using Python 2.5 somehow.
How can I make sure that django use Python 2.7? I'm using Windows XP
|
Reverse rendering of Urdu fonts
| 4,669,402 | -1 | 2 | 824 | 0 |
python,linux,fonts,tkinter,right-to-left
|
Use a toolkit that isn't terrible, such as PyQt, PyGTK, or wxPython.
| 1 | 0 | 0 | 0 |
2011-01-12T12:50:00.000
| 2 | -0.099668 | false | 4,668,985 | 1 | 0 | 1 | 1 |
I am working on a project that is based on Urdu language in Ubuntu platform. I'm using Python language and have almost achieved my task.
The problem is that, the Urdu text is rendered in reverse order.
For example, consider the word کام (which means work)
consisting of the three letters:
ک ,
ا , and
م
The output is rendered in reverse order as ماک
consisting of the three letters:
م,
ا, and
ک
When copying this text to Open Office or opening the generated XML file in Firefox,
the generated result is absolutely desired.
I Am using Python 2.6 IDLE, its working perfect with Windows platform, which clearly shows its not the problem of IDLE. Am working on TKINTER GUI library.
How can this problem be solved?
|
Web scraping - how to identify main content on a webpage
| 4,672,098 | 13 | 59 | 24,718 | 0 |
python,web-scraping,html-parsing,webpage
|
There's no way to do this that's guaranteed to work, but one strategy you might use is to try to find the element with the most visible text inside of it.
| 0 | 0 | 1 | 0 |
2011-01-12T17:46:00.000
| 10 | 1.2 | true | 4,672,060 | 0 | 0 | 1 | 2 |
Given a news article webpage (from any major news source such as times or bloomberg), I want to identify the main article content on that page and throw out the other misc elements such as ads, menus, sidebars, user comments.
What's a generic way of doing this that will work on most major news sites?
What are some good tools or libraries for data mining? (preferably python based)
|
Web scraping - how to identify main content on a webpage
| 4,672,151 | 6 | 59 | 24,718 | 0 |
python,web-scraping,html-parsing,webpage
|
It might be more useful to extract the RSS feeds (<link type="application/rss+xml" href="..."/>) on that page and parse the data in the feed to get the main content.
| 0 | 0 | 1 | 0 |
2011-01-12T17:46:00.000
| 10 | 1 | false | 4,672,060 | 0 | 0 | 1 | 2 |
Given a news article webpage (from any major news source such as times or bloomberg), I want to identify the main article content on that page and throw out the other misc elements such as ads, menus, sidebars, user comments.
What's a generic way of doing this that will work on most major news sites?
What are some good tools or libraries for data mining? (preferably python based)
|
Modify system configuration files and use system commands through web interface
| 4,710,807 | 0 | 3 | 474 | 0 |
python,security,apache,root,privileges
|
Hello
You can easily create web applications in Python using WSGI-compliant web frameworks such as CherryPy2 and templating engines such as Genshi. You can use the 'subprocess' module to manadge external commands...
| 0 | 1 | 0 | 0 |
2011-01-13T13:44:00.000
| 2 | 1.2 | true | 4,680,693 | 0 | 0 | 1 | 2 |
I received a project recently and I am wondering how to do something in a correct and secure manner.
The situation is the following:
There are classes to manage linux users, mysql users and databases and apache virtual hosts. They're used to automate the addition of users in a small shared-hosting environnement. These classes are then used in command-line scripts to offer a nice interface for the system administrator.
I am now asked to build a simple web interface to offer a GUI to the administrator and then offer some features directly to the users (change their unix password and other daily procedures).
I don't know how to implement the web application. It will run in Apache (with the apache user) but the classes need to access files and commands that are only usable by the root user to do the necessary changes (e.g useradd and virtual hosts configuration files). When using the command-line scripts, it is not a problem as they are run under the correct user. Giving permissions to the apache user would probably be dangerous.
What would be the best technique to allow this through the web application ? I would like to use the classes directly if possible (it would be handier than calling the command line scripts like external processes and parsing output) but I can't see how to do this in a secure manner.
I saw existing products doing similar things (webmin, eBox, ...) but I don't know how it works.
PS: The classes I received are simple but really badly programmed and barely commented. They are actually in PHP but I'm planning to port them to python. Then I'd like to use the Django framework to build the web admin interface.
Thanks and sorry if the question is not clear enough.
EDIT: I read a little bit about webmin and saw that it uses its own mini web server (called miniserv.pl). It seems like a good solution. The user running this server should then have permissions to modify the files and use the commands. How could I do something similar with Django? Use the development server? Would it be better to use something like CherryPy?
|
Modify system configuration files and use system commands through web interface
| 4,684,335 | 0 | 3 | 474 | 0 |
python,security,apache,root,privileges
|
You can use sudo to give the apache user root permission for only the commands/scripts you need for your web app.
| 0 | 1 | 0 | 0 |
2011-01-13T13:44:00.000
| 2 | 0 | false | 4,680,693 | 0 | 0 | 1 | 2 |
I received a project recently and I am wondering how to do something in a correct and secure manner.
The situation is the following:
There are classes to manage linux users, mysql users and databases and apache virtual hosts. They're used to automate the addition of users in a small shared-hosting environnement. These classes are then used in command-line scripts to offer a nice interface for the system administrator.
I am now asked to build a simple web interface to offer a GUI to the administrator and then offer some features directly to the users (change their unix password and other daily procedures).
I don't know how to implement the web application. It will run in Apache (with the apache user) but the classes need to access files and commands that are only usable by the root user to do the necessary changes (e.g useradd and virtual hosts configuration files). When using the command-line scripts, it is not a problem as they are run under the correct user. Giving permissions to the apache user would probably be dangerous.
What would be the best technique to allow this through the web application ? I would like to use the classes directly if possible (it would be handier than calling the command line scripts like external processes and parsing output) but I can't see how to do this in a secure manner.
I saw existing products doing similar things (webmin, eBox, ...) but I don't know how it works.
PS: The classes I received are simple but really badly programmed and barely commented. They are actually in PHP but I'm planning to port them to python. Then I'd like to use the Django framework to build the web admin interface.
Thanks and sorry if the question is not clear enough.
EDIT: I read a little bit about webmin and saw that it uses its own mini web server (called miniserv.pl). It seems like a good solution. The user running this server should then have permissions to modify the files and use the commands. How could I do something similar with Django? Use the development server? Would it be better to use something like CherryPy?
|
Able to ping but cannot browse after several hours running of my python program
| 4,697,664 | 3 | 0 | 204 | 0 |
python,multithreading,network-programming,urllib2,python-multithreading
|
Are you sure you are closing TCP sessions after each request? Try to check netstat information from time to time and if you'll see that the number of active/established sessions is rising it means that you have some problems in your script.
Yes, usually you can ping even if you are out of free TCP sockets.
| 0 | 0 | 1 | 0 |
2011-01-15T01:55:00.000
| 1 | 1.2 | true | 4,697,623 | 0 | 0 | 1 | 1 |
It's a GUI program I wrote in python checking website/server status running on my XP SP3, multi threads are used to check different site/server. After several hours running, the program starts to get urlopen error timed out all the time, and this always happens right after a POST request from a server(not a certain one, might be A or B or C), and it's also not the first POST request causing the problem, normally after several hours running and it happens to make a POST request at an unknown moment, all you get from then on is urlopen error timed out.
I'm still able to ping but cannot browse any site, once the program closed everything's fine. It's definitely the program causing this problem, well I just don't know how to debug/check what the problem is, also don't know if it's from OS side or my program wasting too many resources/connections(are you still able to ping when too many connections used?), would anybody please help me out?
|
Get the uri of the page in Google App Engine / Django?
| 4,698,277 | 0 | 0 | 98 | 0 |
python,django,google-app-engine,httpwebrequest
|
Should be in self.request.url in your RequestHandler-based class.
| 0 | 1 | 0 | 0 |
2011-01-15T06:02:00.000
| 1 | 1.2 | true | 4,698,265 | 0 | 0 | 1 | 1 |
I'm using Google App Engine with the standard Django templates found in Webapp.
I wanted to display the permalink to the page the user is on. How do I get the uri?
|
Is cherrypy Python3-compatible yet?
| 4,706,295 | 0 | 6 | 3,485 | 0 |
python,cherrypy
|
I've been running a CherryPy website with Python 3 for a few months now and it works well, but you have to use the code from the python3 branch of the repository because CherryPy 3.2 isn't released yet.
| 0 | 0 | 0 | 0 |
2011-01-16T12:30:00.000
| 4 | 0 | false | 4,705,333 | 0 | 0 | 1 | 1 |
Does cherrypy support Python3 yet? What other web frameworks out there support Python 3?
|
django templatetag
| 4,707,169 | 1 | 1 | 737 | 0 |
python,django
|
As far as I am aware there is not built-in tag to do this. Depending on the nature of the words you want (they aren't inside, or part of a for-loop - although even then you could just do this recursively) you could just do what you want in the views.py and pass the output as a variable to the template?
So you'd do your substringing and word-count in the views and pass the answer to the template as a variable/list?
| 0 | 0 | 0 | 0 |
2011-01-16T17:54:00.000
| 3 | 0.066568 | false | 4,707,008 | 0 | 0 | 1 | 1 |
am looking for a django templatetag that will count words and substring a whole paragraph without chopping off words. Is there a built in function? I tried looking into the built-in function list at Django template documentation but couldn't find anything.
Please advice?
|
Django find oldest entry in database
| 4,707,215 | 3 | 2 | 1,478 | 0 |
python,django,datetime,view
|
If you have a created timestamp on your model, then could you sort ascending by this field and grab the first value?
To do the differences between the dates, you may be able to use an aggregate function to find the highest and lowest date, but I am uncertain. Something along the following lines might work:
MyModel.objects.all().aggregate(lowest=Min('created_at'), highest=Max('created_at'))
And then calculate the difference between those two - this all depending of course on Min and Max aggregate functions working correctly with dates...
| 0 | 0 | 0 | 0 |
2011-01-16T18:19:00.000
| 1 | 1.2 | true | 4,707,136 | 0 | 0 | 1 | 1 |
Looking for a way in a Django view to find the oldest entry in the database. Then take that value and to a time since. There has to be a simple way to do this with writing a complicated query.
|
Django: How to build a custom form widget?
| 11,547,550 | 7 | 63 | 51,410 | 0 |
python,django,forms
|
NOTE: There are three questions here. For the first two questions, see the fuller answer by AndiDog. I'm only answering the third question here:
Q. What widget method is responsible for going from the user's input back to the data model?
A. The value_from_datadict method -- it's sort of the inverse of a widget's render method. This method is presumably what the Django docs on widgets are referring to when it says "The widget handles the rendering of the HTML, and the extraction of data from a GET/POST dictionary that corresponds to the widget." There's nothing further on this point in the docs, but you can see how it works from the code for the built-in widgets.
| 0 | 0 | 0 | 0 |
2011-01-16T18:27:00.000
| 5 | 1 | false | 4,707,192 | 0 | 0 | 1 | 1 |
I am having a difficult time finding documentation on how to write a custom widget.
My questions are:
If I build a custom widget, can it be used equivalently for the admin interface or for normal forms?
If I want to allow the user to edit a list of items, what widget should I subclass? What methods of the widget do I need to override/implement?
What widget method is responsible for going from the user's input back to the data model?
Thanks.
|
Scrapy and proxies
| 14,401,562 | 9 | 50 | 69,413 | 0 |
python,scrapy
|
that would be:
export http_proxy=http://user:password@proxy:port
| 0 | 0 | 1 | 0 |
2011-01-17T06:17:00.000
| 9 | 1 | false | 4,710,483 | 0 | 0 | 1 | 1 |
How do you utilize proxy support with the python web-scraping framework Scrapy?
|
PHP part in Python based website
| 4,718,973 | 1 | 1 | 171 | 0 |
php,python,google-app-engine
|
Quercus on App Engine runs on the Java runtime, while Python runs on, er, the Python runtime. While you can run one app with multiple runtimes, they have to be different major versions, which means that communication between them will be awkward - you'd have to make URLFetches between them.
I think you'll find it's far simpler to learn enough Python to make the changes. And trust me, you won't regret learning Python. ;)
| 0 | 0 | 0 | 0 |
2011-01-17T09:15:00.000
| 2 | 0.099668 | false | 4,711,544 | 0 | 0 | 1 | 1 |
I need to write a small addition to a Python+Django based website, hosted on Google Apps. Trouble is that I don't have any experience with Python.
The addition is pretty straight forward, it requires little database access
So thought of 2 possible solution's:
Quickly dive into Python and get it done with Python.
Run PHP on Quercus and write this particular addition in PHP, then somehow combine it into the website as a dingle PHP page.
Edit: There is another option I thought of:
Writing it in PHP and hosting it on an external server, embedding it in an iframe. The addition I am writing has no need to be SEO friendly, so an iframe will have no negative effect on the website.
What do you suggest?
|
Is there an API of Google App Engine provided to better configure the Bigtable besides Datastore?
| 4,718,951 | 2 | 1 | 134 | 1 |
python,google-app-engine
|
The Datastore is the only interface to the underlying storage on App Engine. You should be able to use any valid UTF-8 string as a kind name, key name, or property name, however.
| 0 | 1 | 0 | 0 |
2011-01-17T10:32:00.000
| 1 | 0.379949 | false | 4,712,143 | 0 | 0 | 1 | 1 |
According to the Bigtable original article, a column key of a Bigtable is named using "family:qualifier" syntax where column family names must be printable but qualifiers may be arbitrary strings. In the application I am working on, I would like to specify the qualifiers using Chinese words (or phrase). Is it possible to do this in Google App Engine? Is there a Bigtable API other than provided datastore API? It seems Google is tightly protecting its platform for good reasons.
Thanks in advance.
Marvin
|
Integrating Django and .Net applications using Single Sign On (SSO)
| 4,718,045 | 1 | 2 | 919 | 0 |
.net,python,django,single-sign-on
|
We implement OpenID at our company in a way that the only trusted openid provider is ourself. Because of this, the user doesn't have to use anything special to log into a website. They just click a login button and it pops them over to the main login site. If they've already logged in then it instantly sends them back to the site and they are authenticated. If they haven't logged in yet it asks them to authenticate.
While we don't use .Net we do use multiple languages (Python and PHP are most common) and many open source frameworks (Django, Drupal, Wordpress among others) and we've actually contributed our code back to those communities as open source plugins.
A friend of mine who is a .Net developer uses OpenID in his application so I know that the code to do this is already out there and available.
| 0 | 0 | 0 | 0 |
2011-01-17T12:46:00.000
| 2 | 0.099668 | false | 4,713,293 | 0 | 0 | 1 | 1 |
We have heterogeneous systems consisting of Django and .Net web applications. I primarily work on Django.Is it possible to integrate these heterogeneous systems using Single Sign On ?
Any ideas in this regard would be truly appreciated.
Thank You
|
Serving large generated files using Google App Engine?
| 4,718,754 | 3 | 2 | 793 | 0 |
python,google-app-engine,blob,blobstore
|
I think storing it in the blobstore via a form post is your best currently-available option. We have plans to implement programmatic blobstore writing, but it's not ready quite yet.
| 0 | 1 | 0 | 0 |
2011-01-17T20:31:00.000
| 4 | 1.2 | true | 4,717,568 | 0 | 0 | 1 | 2 |
Presently I have a GAE app that does some offline processing (backs up a user's data), and generates a file that's somewhere in the neighbourhood of 10 - 100 MB. I'm not sure of the best way to serve this file to the user. The two options I'm considering are:
Adding some code to the offline processing code that 'spoofs' it as a form upload to the blob store, and going thru the normal blobstore process to serve the file.
Having the offline processing code store the file somewhere off of GAE, and serving it from there.
Is there a much better approach I'm overlooking? I'm guessing this is functionality that isn't well suited to GAE. I had thought of storing in the datastore as db.Text or Dd.Blob but there I encounter the 1 MB limit.
Any input would be appreciated,
|
Serving large generated files using Google App Engine?
| 4,717,660 | 0 | 2 | 793 | 0 |
python,google-app-engine,blob,blobstore
|
There is some approach you are overlooking, although I'm not sure whether it is that much better:
Split the data into many 1MB chunks, and have individual requests to transfer the chunks.
This would require cooperation from the outside applications to actually retrieve the data in chunks; you might want to use the HTTP Range header to maintain the illusion of a single file. Then have another object that keeps the IDs of all the individual chunks.
| 0 | 1 | 0 | 0 |
2011-01-17T20:31:00.000
| 4 | 0 | false | 4,717,568 | 0 | 0 | 1 | 2 |
Presently I have a GAE app that does some offline processing (backs up a user's data), and generates a file that's somewhere in the neighbourhood of 10 - 100 MB. I'm not sure of the best way to serve this file to the user. The two options I'm considering are:
Adding some code to the offline processing code that 'spoofs' it as a form upload to the blob store, and going thru the normal blobstore process to serve the file.
Having the offline processing code store the file somewhere off of GAE, and serving it from there.
Is there a much better approach I'm overlooking? I'm guessing this is functionality that isn't well suited to GAE. I had thought of storing in the datastore as db.Text or Dd.Blob but there I encounter the 1 MB limit.
Any input would be appreciated,
|
Converting Django project from MySQL to Mongo, any major pitfalls?
| 10,204,815 | 1 | 2 | 2,780 | 1 |
python,django,mongodb,mongoengine
|
I've used mongoengine with django but you need to create a file like mongo_models.py for example. In that file you define your Mongo documents. You then create forms to match each Mongo document. Each form has a save method which inserts or updates whats stored in Mongo. Django forms are designed to plug into any data back end ( with a bit of craft )
BEWARE: If you have very well defined and structured data that can be described in documents or models then don't use Mongo. Its not designed for that and something like PostGreSQL will work much better.
I use PostGreSQL for relational or well structured data because its good for that. Small memory footprint and good response.
I use Redis to cache or operate in memory queues/lists because its very good for that. great performance providing you have the memory to cope with it.
I use Mongo to store large JSON documents and to perform Map and reduce on them ( if needed ) because its very good for that. Be sure to use indexing on certain columns if you can to speed up lookups.
Don't circle to fill a square hole. It won't fill it.
I've seen too many posts where someone wanted to swap a relational DB for Mongo because Mongo is a buzz word. Don't get me wrong, Mongo is really great... when you use it appropriately. I love using Mongo appropriately
| 0 | 0 | 0 | 0 |
2011-01-17T22:22:00.000
| 6 | 0.033321 | false | 4,718,580 | 0 | 0 | 1 | 5 |
I want to try Mongodb w/ mongoengine. I'm new to Django and databases and I'm having a fit with Foreign Keys, Joins, Circular Imports (you name it). I know I could eventually work through these issues but Mongo just seems like a simpler solution for what I am doing. My question is I'm using a lot of pluggable apps (Imagekit, Haystack, Registration, etc) and wanted to know if these apps will continue to work if I make the switch. Are there any known headaches that I will encounter, if so I might just keep banging my head with MySQL.
|
Converting Django project from MySQL to Mongo, any major pitfalls?
| 4,718,924 | 9 | 2 | 2,780 | 1 |
python,django,mongodb,mongoengine
|
There's no reason why you can't use one of the standard RDBMSs for all the standard Django apps, and then Mongo for your app. You'll just have to replace all the standard ways of processing things from the Django ORM with doing it the Mongo way.
So you can keep urls.py and its neat pattern matching, views will still get parameters, and templates can still take objects.
You'll lose querysets because I suspect they are too closely tied to the RDBMS models - but they are just lazily evaluated lists really. Just ignore the Django docs on writing models.py and code up your database business logic in a Mongo paradigm.
Oh, and you won't have the Django Admin interface for easy access to your data.
| 0 | 0 | 0 | 0 |
2011-01-17T22:22:00.000
| 6 | 1.2 | true | 4,718,580 | 0 | 0 | 1 | 5 |
I want to try Mongodb w/ mongoengine. I'm new to Django and databases and I'm having a fit with Foreign Keys, Joins, Circular Imports (you name it). I know I could eventually work through these issues but Mongo just seems like a simpler solution for what I am doing. My question is I'm using a lot of pluggable apps (Imagekit, Haystack, Registration, etc) and wanted to know if these apps will continue to work if I make the switch. Are there any known headaches that I will encounter, if so I might just keep banging my head with MySQL.
|
Converting Django project from MySQL to Mongo, any major pitfalls?
| 4,719,398 | -1 | 2 | 2,780 | 1 |
python,django,mongodb,mongoengine
|
Primary pitfall (for me): no JOINs!
| 0 | 0 | 0 | 0 |
2011-01-17T22:22:00.000
| 6 | -0.033321 | false | 4,718,580 | 0 | 0 | 1 | 5 |
I want to try Mongodb w/ mongoengine. I'm new to Django and databases and I'm having a fit with Foreign Keys, Joins, Circular Imports (you name it). I know I could eventually work through these issues but Mongo just seems like a simpler solution for what I am doing. My question is I'm using a lot of pluggable apps (Imagekit, Haystack, Registration, etc) and wanted to know if these apps will continue to work if I make the switch. Are there any known headaches that I will encounter, if so I might just keep banging my head with MySQL.
|
Converting Django project from MySQL to Mongo, any major pitfalls?
| 4,719,167 | 0 | 2 | 2,780 | 1 |
python,django,mongodb,mongoengine
|
Upfront, it won't work for any existing Django app that ships it's models. There's no backend for storing Django's Model data in mongodb or other NoSQL storages at the moment and, database backends aside, models themselves are somewhat of a moot point, because once you get in to using someones app (django.contrib apps included) that ships model-template-view triads, whenever you require a slightly different model for your purposes you either have to edit the application code (plain wrong), dynamically edit the contents of imported Python modules at runtime (magical), fork the application source altogether (cumbersome) or provide additional settings (good, but it's a rare encounter, with django.contrib.auth probably being the only widely known example of an application that allows you to dynamically specify which model it will use, as is the case with user profile models through the AUTH_PROFILE_MODULE setting).
This might sound bad, but what it really means is that you'll have to deploy SQL and NoSQL databases in parallel and go from an app-to-app basis--like Spacedman suggested--and if mongodb is the best fit for a certain app, hell, just roll your own custom app.
There's a lot of fine Djangonauts with NoSQL storages on their minds. If you followed the streams from the past Djangocon presentations, every year there's been important discussions about how Django should leverage NoSQL storages. I'm pretty sure, in this year or the next, someone will refactor the apps and models API to pave the path to a clean design that can finally unify all the different flavors of NoSQL storages as part of the Django core.
| 0 | 0 | 0 | 0 |
2011-01-17T22:22:00.000
| 6 | 0 | false | 4,718,580 | 0 | 0 | 1 | 5 |
I want to try Mongodb w/ mongoengine. I'm new to Django and databases and I'm having a fit with Foreign Keys, Joins, Circular Imports (you name it). I know I could eventually work through these issues but Mongo just seems like a simpler solution for what I am doing. My question is I'm using a lot of pluggable apps (Imagekit, Haystack, Registration, etc) and wanted to know if these apps will continue to work if I make the switch. Are there any known headaches that I will encounter, if so I might just keep banging my head with MySQL.
|
Converting Django project from MySQL to Mongo, any major pitfalls?
| 4,728,500 | 0 | 2 | 2,780 | 1 |
python,django,mongodb,mongoengine
|
I have recently tried this (although without Mongoengine). There are a huge number of pitfalls, IMHO:
No admin interface.
No Auth django.contrib.auth relies on the DB interface.
Many things rely on django.contrib.auth.User. For example, the RequestContext class. This is a huge hindrance.
No Registration (Relies on the DB interface and django.contrib.auth)
Basically, search through the django interface for references to django.contrib.auth and you'll see how many things will be broken.
That said, it's possible that MongoEngine provides some support to replace/augment django.contrib.auth with something better, but there are so many things that depend on it that it's hard to say how you'd monkey patch something that much.
| 0 | 0 | 0 | 0 |
2011-01-17T22:22:00.000
| 6 | 0 | false | 4,718,580 | 0 | 0 | 1 | 5 |
I want to try Mongodb w/ mongoengine. I'm new to Django and databases and I'm having a fit with Foreign Keys, Joins, Circular Imports (you name it). I know I could eventually work through these issues but Mongo just seems like a simpler solution for what I am doing. My question is I'm using a lot of pluggable apps (Imagekit, Haystack, Registration, etc) and wanted to know if these apps will continue to work if I make the switch. Are there any known headaches that I will encounter, if so I might just keep banging my head with MySQL.
|
List of References in Google App Engine for Python
| 4,719,811 | 6 | 18 | 2,691 | 0 |
python,google-app-engine
|
You're right, there's no built in ReferenceListProperty. It'd be possible to write one yourself - custom Property subclasses are generally fairly easy - but getting it right is harder than you'd think, when it comes to deferencing and caching a list of references.
You can use a db.ListProperty(db.Key), however, which allows you to store a list of keys. Then, you can load them individually or all at once using a batch db.get() operation. This requires you to do the resolution step yourself, but it also gives you more control over when you dereference entities.
| 0 | 1 | 0 | 0 |
2011-01-18T01:29:00.000
| 2 | 1 | false | 4,719,700 | 0 | 0 | 1 | 1 |
In Google App Engine, there is such a thing as a ListProperty that allows you to hold a list (array) of items. You may also specify the type of the item being held, for instance string, integer, or whatever.
Google App Engine also allows you to have a ReferenceProperty. A ReferenceProperty "contains" a reference to another Google App Engine Model entity. If you access a ReferenceProperty, it will automatically retrieve the actual entity that the reference points to. This is convenient, as it beats getting the key, and then getting the entity for said key.
However, I do not see any such thing as a ListReferenceProperty (or ReferenceListProperty). I would like to hold a list of references to other entities, that would automatically be resolved when I attempt to access elements within the list. The closest I can get it seems is to hold a list of db.Key objects. I can use these keys to then manually retrieve their associated entities from the server.
Is there any good solution to this? Basically, I would like the ability to have a collection of (auto-dereferencing) references to other entities. I can almost get there by having a collection of keys to other entities, but I would like it to "know" that these are key items, and that it could dereference them as a service to me.
Thank you
|
Python: Processing Javascript with urllib2?
| 4,721,276 | 2 | 5 | 5,105 | 0 |
javascript,python,urllib2
|
No, you'd need some sort of JS interpreter for that. There might be Python-Browser integrations to help parsing this kind of page.
| 0 | 0 | 1 | 0 |
2011-01-18T03:55:00.000
| 1 | 1.2 | true | 4,720,342 | 0 | 0 | 1 | 1 |
I am coding a HTML scraper which gets values from a table on a website. I also need to grab the URL of an image, but the problem is this image is dynamically generated via javascript - and when i get contents of the website via urllib, the Javascript does not run or show in the resulting HTML.
Is there any way to enable Javascript to run on pages which are accessed via urllib?
|
Django's BooleanField showing incorrect value in edit mode
| 4,733,618 | 0 | 0 | 286 | 0 |
python,mysql,django
|
You haven't provided much details so I'm guessing that you mean that you have a form and it doesn't have required=False set for the BooleanField.
| 0 | 0 | 0 | 0 |
2011-01-18T21:03:00.000
| 1 | 0 | false | 4,728,983 | 0 | 0 | 1 | 1 |
DJango: 1.24
DB: MySQL
Column Type: Bit
Code: models.BooleanField(db_column='InStock')
The checkbox always shows checked no matter what the value is (1 or 0). The value gets saved correctly but when it renders the edit page, it always checked.
Any pointers?
|
XML serialization library interoperability between Java and Python
| 4,730,212 | 1 | 1 | 1,140 | 0 |
java,python,xml,serialization
|
Since Java and Python objects are so different in themselves, it's almost impossible to do this, unless you on both sides restrict the types allowed and such things.
And in that case, I'd recommend you use JSON, which is a nice interoperability format, even though it's not XML.
Otherwise you could easily write a library that takes XStream XML and loads it into Python objects, but it will always be limited to whatever is similar between Java and Python.
| 0 | 0 | 1 | 0 |
2011-01-18T23:06:00.000
| 4 | 1.2 | true | 4,730,082 | 0 | 0 | 1 | 1 |
I have been searching for an xml serialization library that can serialize and deserialize an (Java/Python) object into xml and back. I am using XStream right now for Java. If XStream had a python version to deserialize from xml generated by Xstream that would have done it for me. Thrift or such other libraries is not going to work unless they allow the data format to be xml. I am looking for suggestion for any library that can do it. - Thanks
|
Have different initial_data fixtures for different stages (testing v. production)
| 4,731,825 | 0 | 2 | 490 | 0 |
python,django,django-models,django-settings,django-fixtures
|
The easiest way is to use manage.py testserver [fixture ...]
If this is a staging (rather than dev) deployment, though, you may not want to use django's builtin server. In that case, a quick (if hacky) way of doing what you're after is to have the fixtures in an app (called, for example, "undeployed") that is only installed in your non-production settings.
| 0 | 0 | 0 | 0 |
2011-01-19T03:00:00.000
| 2 | 0 | false | 4,731,352 | 0 | 0 | 1 | 1 |
I have an initial_data fixture that I want to load everytime except for production. I already have different settings file for production and non-production deployments.
Any suggestions on how to accomplish this?
Clarification: I do not want test fixtures. Basically, I just need the fixture to be loaded based on a setting change of some sort. I'll be digging into the Django code to see if I could figure out an elegant way to accomplish this.
|
How can I schedule an email to be sent at some point in the future in django?
| 4,731,583 | 3 | 2 | 5,173 | 0 |
python,django,email,schedule
|
I would set up a cron job which could handle everything you want to do...
| 0 | 0 | 0 | 1 |
2011-01-19T03:16:00.000
| 5 | 0.119427 | false | 4,731,419 | 0 | 0 | 1 | 2 |
I want to schedule an email to be sent to a user upon a specific action.
However, if the user takes another action I want to cancel that email and have it not send.
How would I do that in django or python?
|
How can I schedule an email to be sent at some point in the future in django?
| 4,741,503 | 0 | 2 | 5,173 | 0 |
python,django,email,schedule
|
You said that you want to do it through Python or Django, but it seems as though something else will need to be involved. Considering you are on a shared host, there is a chance installing other packages could also be a problem.
Another possible solution could be something like this:
Use a javascript framework which can setup timed events, start/cancel them etc. I have done timed events using a framework called ExtJS. Although ExtJS is rather large im sure other frameworks such as jQuery or even raw javascript you could do a similar thing.
Set up a task on a user action, that will execute in 5 minutes. The action could be an ajax call to a python script which sends the email... If a user does something where the task needs to be stopped, just cancel the event.
It kind of seems complicated and convoluted, but it really isn't. If this seems like a path you would like to try out, let me know and I'll edit with some code
| 0 | 0 | 0 | 1 |
2011-01-19T03:16:00.000
| 5 | 0 | false | 4,731,419 | 0 | 0 | 1 | 2 |
I want to schedule an email to be sent to a user upon a specific action.
However, if the user takes another action I want to cancel that email and have it not send.
How would I do that in django or python?
|
Getting Java to talk to Python, C, C++, and Ruby
| 4,737,502 | 1 | 2 | 1,579 | 0 |
java,c++,python,c,ruby
|
You should probably use a standard interprocess mechanism like a pipe or socket.
All of these languages have libraries available for both, and this strategy allows communication between any 2 of your processes (Java/Ruby, Ruby/Python, Java/C, etc)
| 0 | 1 | 0 | 0 |
2011-01-19T14:56:00.000
| 3 | 0.066568 | false | 4,736,698 | 0 | 0 | 1 | 2 |
I have succeeded in getting ProcessBuilder to run external scripts, but I still have to get Java to communicate with the external scripts. I figure that I should get the input/output streams from the process, and use those to send and receive data. I'm having a the most trouble with giving input to the scripts. It seems that I can get output from the scripts by using the script's print function, but I can't seem to get the scripts to register input from the main java program.
This question involves four languages, so it's fine if you post only the answer regarding one language.
|
Getting Java to talk to Python, C, C++, and Ruby
| 4,737,732 | 2 | 2 | 1,579 | 0 |
java,c++,python,c,ruby
|
The method getOutputStream() on the Process class returns a stream you can write to in Java that connects to the stdin stream of the process. You should be able to read this as you would normally read stdin for each language (e.g., cin for C++, scanf for C, STDIN.read for Ruby, don't know Python!)
If this is what you're doing and it isn't working (your question sounds like it might be but it's hard to tell) could you post some code to make it easier to see what you might be doing wrong?
| 0 | 1 | 0 | 0 |
2011-01-19T14:56:00.000
| 3 | 1.2 | true | 4,736,698 | 0 | 0 | 1 | 2 |
I have succeeded in getting ProcessBuilder to run external scripts, but I still have to get Java to communicate with the external scripts. I figure that I should get the input/output streams from the process, and use those to send and receive data. I'm having a the most trouble with giving input to the scripts. It seems that I can get output from the scripts by using the script's print function, but I can't seem to get the scripts to register input from the main java program.
This question involves four languages, so it's fine if you post only the answer regarding one language.
|
public private key solution for javascript and python
| 4,738,545 | 0 | 1 | 401 | 0 |
javascript,python,encryption,pgp
|
Use SSL for your connections to the server. Probably the easiest way to do that is to use HTTP for communication and also to run a proxy (say, Apache) on the server that can do HTTPS and forwards requests to the actual server application.
| 0 | 0 | 1 | 1 |
2011-01-19T16:17:00.000
| 1 | 0 | false | 4,737,721 | 0 | 0 | 1 | 1 |
I'm looking for a public private key solution that I can use with a javascript client and python backend. The aim is to send data encrypted from the client to the server... Are the any solutions? Thanks for hints.
|
How much do imports slow down Django?
| 4,742,356 | 4 | 3 | 282 | 0 |
python,django
|
It will slow down startup (actually, whatever loads the file containing those imports the first time will be slowed down).
Assuming django does not do that for every request but only once, it is not an issue at all.
| 0 | 0 | 0 | 0 |
2011-01-20T00:35:00.000
| 2 | 1.2 | true | 4,742,338 | 0 | 0 | 1 | 2 |
What if I'm importing 100 things ?
(In the top of my views.py)
And then inside each of them, I'm importing 30 things.
Will that slow things down?
|
How much do imports slow down Django?
| 4,742,347 | 3 | 3 | 282 | 0 |
python,django
|
Only the first time they're imported in the process. After that, all that happens is that a reference is copied to the local scope.
| 0 | 0 | 0 | 0 |
2011-01-20T00:35:00.000
| 2 | 0.291313 | false | 4,742,338 | 0 | 0 | 1 | 2 |
What if I'm importing 100 things ?
(In the top of my views.py)
And then inside each of them, I'm importing 30 things.
Will that slow things down?
|
How to serve file in webpy?
| 9,408,237 | 1 | 8 | 12,091 | 0 |
python,web.py
|
I don't recommend serving static files with web.py. You'd better have apache or nginx configured for that.
| 0 | 0 | 0 | 0 |
2011-01-20T19:21:00.000
| 4 | 0.049958 | false | 4,751,508 | 0 | 0 | 1 | 1 |
I am using webpy framefork. I want to serve static file on one of requests. Is there special method in webpy framework or I just have to read and return that file?
|
Track small differences in 5 files with Mercurial?
| 4,752,795 | 1 | 2 | 67 | 0 |
python,apache,mercurial,dvcs
|
I don't think you can; that's not a common thing to do in a VCS. If I'm wrong, I'm happy to be corrected.
Perhaps you can make the "master" httpd.conf file a template, and have a build script that generates the five files you want, passing in the appropriate port number for each file. That way you isolate the change points in your file, and keep the common bits, well, common. There are reams of templateing languages out there. Or you can simply use sed. Or do as nmichaels suggested and use Apache's capabilities directly.
There are lots of ways to skin this particular cat, but I don't think Mercurial is going to help you directly.
| 0 | 0 | 1 | 0 |
2011-01-20T21:18:00.000
| 3 | 0.066568 | false | 4,752,695 | 0 | 0 | 1 | 1 |
I have five httpd.conf files which differ only in the port number that they are listening on. All of the other data between the sites is the same. Is there any way to track this as a single file in Mercurial? So that if I make a different change to the httpd.conf file, I could push this to all five, and keep the port numbers separate.
Thanks,
Kevin
|
Django and Python handle changing date format
| 4,754,791 | 1 | 0 | 650 | 0 |
python,django,date,django-models
|
When you convert the date string into a datetime object, you'll likely use datetime.strptime with the format argument. I would ask the user what format they use and/or store it in the database (and by that I mean allow them to choose the format they want).
| 0 | 0 | 0 | 0 |
2011-01-21T01:51:00.000
| 2 | 0.099668 | false | 4,754,682 | 0 | 0 | 1 | 1 |
Im importing records from a CSV file into a django model. The CSV file is uploaded by the user. The problem I'm facing is with the date field.
The date field expects the date to be in YYYY-MM-DDbut different spreadsheet programs default to different types of formats and I dont want the user to have to change their default format.
So I want to find the best method for django to accept dates that could possibly be in various formats.
What I thought could work is to specify a list of allowed date formats and try and match the string to one of them...
thanks
|
What is the best Google App Engine blobstore workflow?
| 4,775,721 | 0 | 3 | 681 | 0 |
python,google-app-engine,forms,file-upload,blobstore
|
The solution I've come up with for this is not the prettiest but it gets the job done. On the upload view (view that is specified in the create_upload_url function) I'm passing the post variables to the same form class from the first page. If the form is valid I'm saving the variables along with the BlobInfo.key to the model. If it is not a valid form I'm saving the errors in memcache and redirecting back to the first page with the variable of error that triggers the view to retrieve the errors from memcache and add them to the form instance.
So again here's the steps.
Create form view
Check POST variables with the same form from the first view
If the form is valid save it along with the BlobInfo.key, if not save errors to memcache with a small lifespan and redirect to first view with the memcache key in the url
Retrieve the form errors from memcache and add them to the new form instance
Resubmit the form with errors fixed and save
| 0 | 1 | 0 | 0 |
2011-01-21T21:46:00.000
| 1 | 0 | false | 4,764,129 | 0 | 0 | 1 | 1 |
What is the best workflow for uploading file to the blobstore while saving information about the blob and other fields to a model record?
For example, should I submit the form to the blobstore upload url (blobstore.create_upload_url), clean the form, redirect if errors and save and redirect if not?
What is the best way to pass the errors back? GET variables? I tried using models to the save the form errors and redirecting based on the form error model instance, but that was messy. Any ideas?
|
Good way to generate GUIDs on app engine?
| 4,764,511 | 0 | 8 | 3,107 | 0 |
python,google-app-engine,guid
|
Any chance they are guid's for things you're storing in the datastore?
If so, I believe object.key is a GUID
| 0 | 1 | 0 | 0 |
2011-01-21T22:26:00.000
| 5 | 0 | false | 4,764,474 | 0 | 0 | 1 | 1 |
I was wondering if anyone knows of a good way to generate GUIDs on python google app engine. I feel like there is a simple way that people are using, what would you suggest.
|
django-uni-form helpers and CSRF tags over POST
| 4,883,410 | 3 | 3 | 753 | 0 |
python,django,uniform
|
Have you checked the source? It should already be there. The uni_form template tag should include it automatically.
| 0 | 0 | 0 | 0 |
2011-01-22T22:55:00.000
| 4 | 1.2 | true | 4,771,169 | 0 | 0 | 1 | 2 |
I'm using django-uni-forms to display my fields, with a rather rudimentary example straight out of their book.
When I render the form fields using <form>{%csrf_tag%} {%form|as_uni_form%}</form>, everything works as expected.
However, django-uni-form Helpers allow you to generate the form tag (and other helper-related content) using the following syntax -- {% with form.helper as helper %}{% uni_form form helper%}{%endwith%} -- This creates the <form> tag for me, so there's nowhere to embed my own CSRF_token. When I try to use this syntax, the form renders perfectly, but without a CSRF token, and so submitting the form fails every time.
Does anyone have experience with this? Is there an established way to add the token? I much prefer the second syntax, for re-use reasons.
Thanks!
|
django-uni-form helpers and CSRF tags over POST
| 8,118,393 | 1 | 3 | 753 | 0 |
python,django,uniform
|
Use the most recent version of django-uni-form. It fixes this and so much more.
| 0 | 0 | 0 | 0 |
2011-01-22T22:55:00.000
| 4 | 0.049958 | false | 4,771,169 | 0 | 0 | 1 | 2 |
I'm using django-uni-forms to display my fields, with a rather rudimentary example straight out of their book.
When I render the form fields using <form>{%csrf_tag%} {%form|as_uni_form%}</form>, everything works as expected.
However, django-uni-form Helpers allow you to generate the form tag (and other helper-related content) using the following syntax -- {% with form.helper as helper %}{% uni_form form helper%}{%endwith%} -- This creates the <form> tag for me, so there's nowhere to embed my own CSRF_token. When I try to use this syntax, the form renders perfectly, but without a CSRF token, and so submitting the form fails every time.
Does anyone have experience with this? Is there an established way to add the token? I much prefer the second syntax, for re-use reasons.
Thanks!
|
Detecting password encryption type --can I import them into Django?
| 4,773,413 | 4 | 0 | 657 | 0 |
java,python,passwords,md5,sha1
|
In general, you will need to know the exact algorithm used by the Java program. Then you would be able to recreate the same results in Python. (You cannot get the plain-text password from the hash, without using brute-force, but you should be able to recreate the same hashing algorithm, so you can verify a user's password against the hash).
It is very possible that the passwords where hashed with something called a salt when they where stored in the Java application. This is a bit of random information added to the password, and the purpose is to defeat dictionary attacks. If this is the case, you will need to know what data was used for salt.
| 0 | 0 | 0 | 0 |
2011-01-23T10:39:00.000
| 1 | 1.2 | true | 4,773,381 | 0 | 0 | 1 | 1 |
I have a legacy system with passwords that look like this 115c28e0578f262bde08e3de39ee9066. Im not quite sure if they were created with md5 or crypt or... It was a java application that created them.
My new system is in Python (Django) and I tried to run a comparison check on a known password using md5(), sha1() and crypt(). None of them came back with an identical result of what this legacy system has given me.
Assuming the passwords were created within java, is is possible for Pythons equivalent modules to read/convert them so I may import that into a Django project? I'd love to not have to bug my users to reset their passwords.
|
Python web framework with CRUD powered by AJAX
| 4,774,688 | 6 | 6 | 7,870 | 0 |
python,ajax,crud,web-frameworks,turbogears
|
Most of the modern frameworks, like TG, Django or Flask support CRUD-style applications. But none of those are that much abstract, that you can give them a model, and there you have your ajaxy db manipulation templates and validations.
Django has django-admin and a great form builder and helper module; Flask can work with WTForms easily. Javascript is just as usable with any of the above frameworks, so that with a little recherche in the jQuery plugin area, you might be able to quickly build your application.
| 0 | 0 | 0 | 0 |
2011-01-23T15:40:00.000
| 2 | 1 | false | 4,774,641 | 0 | 0 | 1 | 1 |
I am looking for a Python web framework which will allow me to rapidly build a CRUD application with automatic AJAX support.
The framework should be able to generate a nice table which is sortable and filterable, which works via AJAX and without JS support at all as well.
I have looked at TurboGears2 and it seems promising, is there any other framework that can do the job for me?
|
View with data from many databases
| 4,775,514 | 1 | 0 | 90 | 0 |
python,database,django,distributed
|
It seems to me that your application has a pretty ugly architecture. Try to refactor it or you will have troubles.
Anyway, you can try to cache your suppliers' data to your own database (single) and save some resources.
| 0 | 0 | 0 | 0 |
2011-01-23T17:55:00.000
| 1 | 0.197375 | false | 4,775,375 | 0 | 0 | 1 | 1 |
I'm building site in django, which lists items of many suppliers. Each supplier has own big database and make changes quite often. I have to be aware of all changes in no more than 60 minutes. There are about 10m items to display. How to implement all that in a efficient way?
|
Easiest way to share work between backend and front end
| 4,777,646 | 1 | 1 | 181 | 0 |
python,django,installation
|
Get him to set up a virtual machine on his Mac, using VMWare Fusion or Parallels, running the same operating system that you currently use for your back end. If he prefers developing using Mac tools he can do still that by sharing his local changes to the virtual machine via a shared directory.
| 0 | 1 | 0 | 0 |
2011-01-23T23:25:00.000
| 3 | 0.066568 | false | 4,777,262 | 0 | 0 | 1 | 2 |
Hey everyone,
I am expanding my team and I have recently added an additional front end engineer on my site. I am currently using django to run my site but my site is using a lot of plugins, namely: django-celery, django-mailer, django-notification, and django-socialregistration.
Let me describe my situation:
He is using Mac OS X, and I have no experience in installing stuff on mac os X or configuration on that platform
I believe that getting my backend to run on his computer might be somewhat troublesome, i.e. I have to install a bunch of plugins (which are not available on pip or easy_install as they are the latest version) and I have also made heavy modification to django-socialregistration which I am currently using by symlinking to the modified code in my repos in my python path
I tried to look into solutions like pip and easy_install but I have not been able to get them to install code from github
I think the easiest way is to get my backend working on his computer and then he just commiting to the repos. Any ideas how I can make this easy?
|
Easiest way to share work between backend and front end
| 4,777,381 | 0 | 1 | 181 | 0 |
python,django,installation
|
An alternative, if that's possible, would be to set up a testing/development environment on a machine with an OS you're familiar with, then install something like Dropbox on his local machine where he can develop the frontend code, and install Dropbox on that other environment with the backend components. Dropbox would sync his local changes to that testing environment for him to run the code on.
That way, he would be able to use that environment to test his code, you wouldn't need to set up a backend on his machine (or keep it up to date) and you'd still be getting the same functionality.
Again, if that's an option.
| 0 | 1 | 0 | 0 |
2011-01-23T23:25:00.000
| 3 | 0 | false | 4,777,262 | 0 | 0 | 1 | 2 |
Hey everyone,
I am expanding my team and I have recently added an additional front end engineer on my site. I am currently using django to run my site but my site is using a lot of plugins, namely: django-celery, django-mailer, django-notification, and django-socialregistration.
Let me describe my situation:
He is using Mac OS X, and I have no experience in installing stuff on mac os X or configuration on that platform
I believe that getting my backend to run on his computer might be somewhat troublesome, i.e. I have to install a bunch of plugins (which are not available on pip or easy_install as they are the latest version) and I have also made heavy modification to django-socialregistration which I am currently using by symlinking to the modified code in my repos in my python path
I tried to look into solutions like pip and easy_install but I have not been able to get them to install code from github
I think the easiest way is to get my backend working on his computer and then he just commiting to the repos. Any ideas how I can make this easy?
|
Django-ratings and Jquery integration?
| 4,777,733 | 0 | 1 | 759 | 0 |
jquery,python,django
|
You are right,its a basic Ajax, but you might have a complex algorithm to figure out the number of stars as
| 0 | 0 | 0 | 0 |
2011-01-24T00:37:00.000
| 3 | 0 | false | 4,777,592 | 0 | 0 | 1 | 1 |
How do I make django-ratings work with Jquery?
What I'm trying to do is allow the user to select how ever many stars they want to give the product, and to have the corresponding rating processed asynchronously. I realize this is probably basic AJAX, and I apologize if this is a stupid question.
Thank you in advanced.
|
SQLAlchemy - difference between mapped orm.relation with backref or two orm.relation from both sides
| 5,594,860 | 1 | 0 | 664 | 1 |
python,database,sqlalchemy,relation
|
I found the answer myself by now:
If you use an orm.relation from each side and no backrefs, you have to use back_populates or if you mess around at one side, it won't be properly updated in the mapping on the other side.
Therefore, an orm.relation from each side instead of an automated backref IS possible but you have to use back_populates accordingly.
| 0 | 0 | 0 | 0 |
2011-01-24T13:10:00.000
| 1 | 0.197375 | false | 4,782,344 | 0 | 0 | 1 | 1 |
In some project I implement user-requested mapping (at runtime) of two tables which are connected by a 1-to-n relation (one table has a ForeignKey field).
From what I get from the documentation, the usual way is to add a orm.relation to the mapped properties with a mapped_collection as collection_class on the non-foreignkey table with a backref, so that in the end both table orm objects have each other mapped on an attribute (one has a collection through the collection_class of the orm.relation used on it, the other has an attribute placed on it by the backref).
I am in a situation where I sometimes do just want the ForeignKey-side to have a mapped attribute to the other table (that one, that is created by the backref), depending on what the user decides (he might just want to have that side mapped).
Now I'm wondering whether I can simply use an orm.relation on the ForeignKey table aswell, so I'd probably end up with an orm.relation on the non-foreignkey table as before with a mapped_collection but no backref, and another orm.relation on the foreignkey table replacing that automagic backref (making two orm.relations on both tables mapping each other from both sides).
Will that get me into trouble? Is the result equivalent (to just one orm.relation on the non-foreignkey table with a backref)? Is there another way how I could map just on the ForeignKey-side without having to map the dictionary on the non-ForeignKey table aswell with that backref?
|
In Django, how do I check if a user is in a certain group?
| 50,211,377 | 0 | 179 | 149,841 | 0 |
python,django,django-authentication
|
User.objects.filter(username='tom', groups__name='admin').exists()
That query will inform you user : "tom" whether belong to group "admin " or not
| 0 | 0 | 0 | 0 |
2011-01-25T01:09:00.000
| 13 | 0 | false | 4,789,021 | 0 | 0 | 1 | 2 |
I created a custom group in Django's admin site.
In my code, I want to check if a user is in this group. How do I do that?
|
In Django, how do I check if a user is in a certain group?
| 32,197,405 | 11 | 179 | 149,841 | 0 |
python,django,django-authentication
|
If a user belongs to a certain group or not, can be checked in django templates using:
{% if group in request.user.groups.all %}
"some action"
{% endif %}
| 0 | 0 | 0 | 0 |
2011-01-25T01:09:00.000
| 13 | 1 | false | 4,789,021 | 0 | 0 | 1 | 2 |
I created a custom group in Django's admin site.
In my code, I want to check if a user is in this group. How do I do that?
|
PyFlakes for Javascript?
| 4,793,157 | 1 | 1 | 439 | 0 |
javascript,python,jslint,pyflakes
|
In JSLInt there is an 'Assume Rhino' option on JSLint which, when set to true assumes that Rhino is present and, therefore, that the global properties it provides have been defined. I believe that this is 'false' by default.
But as for a dependency, no, JSLint not dependent on Rhino.
I've not used PyFlakes or PyLint, but after scanning some of the docs, I would say that JSLint is exactly what you are after.
| 0 | 0 | 0 | 0 |
2011-01-25T11:18:00.000
| 2 | 0.099668 | false | 4,792,847 | 1 | 0 | 1 | 1 |
Is there any such standalone package for Javascript, like PyFlakes for Python? I see there is JsLint, but it looks like it depends on some external things like Rhino.
I prefer something basic&compact like PyFlakes, because it shows me 80% of bugs I make and has only 20% (or even less) of complexity of other tools like PyLint.
Ideally it should also have a working recipe for plugging into Emacs, but I can figure it out myself if the tool itself is promising.
|
Django - decorators and error messages
| 4,800,739 | 0 | 2 | 1,700 | 0 |
python,django
|
You will send the user an automatic error message.. You'd have to look how to over-ride..
| 0 | 0 | 0 | 0 |
2011-01-26T01:30:00.000
| 3 | 0 | false | 4,800,650 | 0 | 0 | 1 | 1 |
This seems like a simple question but I can't seem to find a simple answer. Django seems to give this nifty simple way of limiting access to places using the permission required or login required decorators but I can't see from the Django docs how one would pass an error message (maybe using the messages framework). If I have to roll my own decorator to do this, what is the point of the django decorators? Do they just not show any error messages?
|
can web2py support RESTful api calls? if so any pointers on how to build one?I
| 4,809,129 | 2 | 2 | 990 | 0 |
iphone,python,cocoa,restful-authentication,web2py
|
I think you should post it to web2py group on google groups.
[email protected]
| 0 | 0 | 0 | 0 |
2011-01-26T03:40:00.000
| 2 | 1.2 | true | 4,801,216 | 0 | 0 | 1 | 1 |
I want to configure a simple webapplication to support an iphone app to connect with it in RESTFUL ways. Initially have a user login session enabled from the iphone to the web app. I'd like the iphone app to send a NSURL call to the webapp, with user and password and have the webapp respond if the suer exists or not. Pretty simple. And I want to do it with web2py. Is this possible? Any clues?
|
My settings.py file in Django is getting too long. How do I split it into two?
| 4,801,807 | 0 | 2 | 1,749 | 0 |
python,django
|
Create new_settings.py file to contain part of settings.py, and import that file wherever you need it.
| 0 | 0 | 0 | 0 |
2011-01-26T04:24:00.000
| 4 | 0 | false | 4,801,395 | 0 | 0 | 1 | 1 |
How do I do that? split up 2 files?
|
How do I flush everything from Celery?
| 4,803,074 | 7 | 2 | 724 | 0 |
python,django,celery
|
Have you tried to restart the celery service with --discard parameter ?
| 0 | 1 | 0 | 0 |
2011-01-26T09:09:00.000
| 1 | 1.2 | true | 4,802,807 | 0 | 0 | 1 | 1 |
I accidently added too many things to the queue, and now it froze.
Can't get it to do anything else.
|
What libraries exist for creating raw multipart emails?
| 4,803,954 | 1 | 1 | 220 | 0 |
java,jquery,python,ruby,email
|
Python has modules both for creating and sending emails in the standard library. Don't know about Java or Ruby. For generating HTML I'd use some HTML template language. There are tons of them for Python. Pick one you like.
| 0 | 0 | 0 | 1 |
2011-01-26T10:30:00.000
| 4 | 1.2 | true | 4,803,499 | 0 | 0 | 1 | 1 |
I would like to ideally set up a user interface for designing emails that include text, html, and images, and would like this interface to output the raw encoded email so I can then pipe it to my mail application, save it in a database, etc..
Are there any libraries that I could look at for generating raw emails, and/or the necessary HTML?
For example: You can create a document in MS Word (interface) and merge it with outlook to send. Ideally I'd like a Jquery based library that would let me visually create the mail, and output the result as a long string.
However, even any server-based libraries in any languages would be helpful: Javascript, Ruby, Python, Java, etc..
I think what I'm looking for is a mail generation library (or as mentioned in the answer below, a mime-generation framework
EDIT: I know this question is pretty general.. If it can be rephrased better let me know. If its like asking for a "Facebook", and naive and unrealizable, let me know. Useless comments that don't add anything not needed though
|
Automatic indexes for expando properties in the google app engine for python
| 4,812,503 | 4 | 3 | 663 | 0 |
python,google-app-engine,expando
|
All properties are automatically indexed for simple queries. Simple queries, in this case, are those that either:
Use only equality filters, with no sort orders or inequality filters.
Have an inequality filter or sort order on a single field, with no other filters.
If you want to do more complex queries - such as ones that mix inequality and equality filters, only then do you need to build a custom index.
It's not possible to build custom indexes at runtime. If you want to use expandos, you need to make sure that you restrict the queries you execute to those that are satisfiable under one of the situations above.
| 0 | 1 | 0 | 0 |
2011-01-26T17:46:00.000
| 1 | 1.2 | true | 4,807,957 | 0 | 0 | 1 | 1 |
The google app engine python sdk offers an Expando type object which can be used for adding dynamic properties to an object that can be persisted to the datastore.
The app engine also requires that for any property on which the objects need to be searched or sorted, an index must be created before uploading the app to google's servers. This is really strange because it means that i am supposed to know before hand what properties my users will create on my objects. If i knew that in advance, why would i not define them as static properties in my existing model?
Does anyone know how to automatically create indexes for dynamic properties of Expando models after uploading to the app engine? If not, can anyone tell me why does the gae tout Expando as dynamic construct when it can not let you create new properties that can be searched on or sorted by, only properties that arent searchable or sortable.
|
Reading session/cookies from WSGI
| 4,815,445 | 2 | 2 | 1,810 | 0 |
python,session,wsgi
|
It's created by the session middle ware. There are no such thing as sessions in http itself. It's usually done by setting a cookie, but can be done in other ways too.
So to answer the question of "when" it is created this is typically done by the session middleware, when it gets a request that does not already have a session cookie in it.
| 0 | 0 | 0 | 0 |
2011-01-27T10:53:00.000
| 2 | 0.197375 | false | 4,815,390 | 0 | 0 | 1 | 1 |
Is there any way to retrieve sessions right from the WSGI (using a middleware)?
I know that it depends on your SessionMiddleware but I wonder if there are hints to figure out when a session is created.
|
Will learning Django translates well into other applications?
| 4,819,617 | 0 | 2 | 221 | 0 |
python,django,zend-framework
|
I love python as a language - but it's not the answer to everything. I know this is throwing mud in a python group, but python has one serious limitation - the rigid source code format.
While going through a django tutorial - I noticed that you cannot insert python source code into a template, and that this was presented as a 'feature' for separating programmers and designers.
I later realized that it's a limitation of django - and any other environment where python source code might get accidentally mangled. This also includes HTML WYSIWIG editors and database based 'manglers' (like Drupal).
In my opinion it's a very serious limitation with no easy cure - especially with the need to use other tools to manage the complexity of HTML / CSS / JavaScript.
| 0 | 0 | 0 | 0 |
2011-01-27T13:15:00.000
| 3 | 0 | false | 4,816,766 | 0 | 0 | 1 | 3 |
Does anyone have experience using Python in different variaty of applications?
A little background - I am a 3D artist in an animation studio. I do programming in PHP and use Zend framework for my personal project. Python has always been a language I wanted to learn because it can be used within many applications our studio is using (3D MAX, MAYA to name a few) My supervisor knew about my web background and wanted me to create a web base time line manager for the company. From the requirement I'm expecting quite a simple backend ... so it might be a good opportunity to finally learn Python. The bulk of the work will be on AJAX for the interactive front end.
So if I learn Python with web application and Django in mind, will that limit my Python skill from applying it to other applications?
a little curious about Django features as well. How well does the framework cover in terms of web application compare to Zend? Our application is pretty basic in the back end and I would love to know if Django will be able to cover them.
authenticate against Windows active directory
quick database update via AJAX interaction (drag and drop time line mostly)
Other basic stuff like discussion forum and directory browsing/file manager
|
Will learning Django translates well into other applications?
| 4,818,297 | 0 | 2 | 221 | 0 |
python,django,zend-framework
|
I found Django a really good way to learn python. There's very little that's quirky, magical or un-pythonic in the framework. A bit of setup and you're away, writing standard python code.
| 0 | 0 | 0 | 0 |
2011-01-27T13:15:00.000
| 3 | 0 | false | 4,816,766 | 0 | 0 | 1 | 3 |
Does anyone have experience using Python in different variaty of applications?
A little background - I am a 3D artist in an animation studio. I do programming in PHP and use Zend framework for my personal project. Python has always been a language I wanted to learn because it can be used within many applications our studio is using (3D MAX, MAYA to name a few) My supervisor knew about my web background and wanted me to create a web base time line manager for the company. From the requirement I'm expecting quite a simple backend ... so it might be a good opportunity to finally learn Python. The bulk of the work will be on AJAX for the interactive front end.
So if I learn Python with web application and Django in mind, will that limit my Python skill from applying it to other applications?
a little curious about Django features as well. How well does the framework cover in terms of web application compare to Zend? Our application is pretty basic in the back end and I would love to know if Django will be able to cover them.
authenticate against Windows active directory
quick database update via AJAX interaction (drag and drop time line mostly)
Other basic stuff like discussion forum and directory browsing/file manager
|
Will learning Django translates well into other applications?
| 4,817,767 | 0 | 2 | 221 | 0 |
python,django,zend-framework
|
So if I learn Python with web application and Django in mind, will that limit my Python skill from applying it to other applications?
No
authenticate against Windows active directory
Yes. You may need to customize an Authentication Backend.
quick database update via AJAX interaction (drag and drop time line mostly)
Django has nothing to do with Ajax. Use piston to create pleasant RESTful API that Ajax can use.
Other basic stuff like discussion forum and directory browsing/file manager
There are many, many canned applications for Django that you can plug in and integrate.
| 0 | 0 | 0 | 0 |
2011-01-27T13:15:00.000
| 3 | 0 | false | 4,816,766 | 0 | 0 | 1 | 3 |
Does anyone have experience using Python in different variaty of applications?
A little background - I am a 3D artist in an animation studio. I do programming in PHP and use Zend framework for my personal project. Python has always been a language I wanted to learn because it can be used within many applications our studio is using (3D MAX, MAYA to name a few) My supervisor knew about my web background and wanted me to create a web base time line manager for the company. From the requirement I'm expecting quite a simple backend ... so it might be a good opportunity to finally learn Python. The bulk of the work will be on AJAX for the interactive front end.
So if I learn Python with web application and Django in mind, will that limit my Python skill from applying it to other applications?
a little curious about Django features as well. How well does the framework cover in terms of web application compare to Zend? Our application is pretty basic in the back end and I would love to know if Django will be able to cover them.
authenticate against Windows active directory
quick database update via AJAX interaction (drag and drop time line mostly)
Other basic stuff like discussion forum and directory browsing/file manager
|
dev_appserver.py doesn't recognize my files
| 14,570,507 | 2 | 1 | 2,131 | 0 |
python,google-app-engine
|
I had the same problem.
Adding python.exe in front of dev_appserver.py solved the problem for me.
c:\Programme\Python27\python.exe C:\Programme\Google\AppEngineSDK\google_appengine\dev_appserver.py MoviesBwu\
| 0 | 1 | 0 | 0 |
2011-01-28T00:17:00.000
| 3 | 0.132549 | false | 4,823,466 | 0 | 0 | 1 | 1 |
I'm trying to get a basic GAE tutorial to work with Windows 7.
So far I have:
Installed python 2.5.4
Installed the current GAE SDK
Set my PATH varible to include python and the GAE
Created a "hello, world" app with an app.yaml and main.py file as specified.
When I call dev_appserver.py . in my app's directory or dev_appserver.py DIRECTORY_NAME one directory above my app, I receive the error message:
Invalid arguments
Application root must be the path to
the application to run in this server.
Must contain a valid app.yaml or
app.yml file.
[A bunch of dev_appserver.py option
follow this]
What am I doing wrong? and as far as I can tell, I've correctly configured everything.
|
What is the best method to tranfer data to a server from code
| 4,834,228 | 0 | 0 | 79 | 0 |
python,django,web-services
|
This is what RESTful web services are all about.
Your web server does two things.
"displays the data". Presumably via HTML web pages. But maybe not. The question is too vague.
Collects the data created by your application "that generates a lot of data in time". This is ordinary REST requests, usually using a POST, with authentication and a reasonable level of security.
Your application "that generates a lot of data in time" will do two things.
"generates a lot of data in time". Whatever that means.
Use urllib2 to make RESTful web service requests to your web server to provide that data which is displayed.
This is a really, really standard design pattern. That's how Amazon.com, eBay and just about every web site with RESTful API's works.
| 0 | 0 | 0 | 0 |
2011-01-28T21:38:00.000
| 2 | 0 | false | 4,833,299 | 0 | 0 | 1 | 2 |
I'm writing two Django applications: one that generates a lot of data in time, and another part that displays it. The app that generate it will run on a machine at my home and the one that displays the data will be a machine on the internet.
What do you believe it will be the best way to transfer the data from the application that generates the content (SQL entries + documents) to the application that displays it ?
My fist thoughts are to somehow send it though FTP (from code) as a zip payload, and on the display server to have a cron that will periodically process the new payloads and merge the data to the existing one.
Any other ideas? I would prefer python/django
|
What is the best method to tranfer data to a server from code
| 4,833,366 | 0 | 0 | 79 | 0 |
python,django,web-services
|
Setup two databases - one master and one slave. Write on the master and make the slave to sync with the master. This way you will not need to worry when your connection is down.
| 0 | 0 | 0 | 0 |
2011-01-28T21:38:00.000
| 2 | 1.2 | true | 4,833,299 | 0 | 0 | 1 | 2 |
I'm writing two Django applications: one that generates a lot of data in time, and another part that displays it. The app that generate it will run on a machine at my home and the one that displays the data will be a machine on the internet.
What do you believe it will be the best way to transfer the data from the application that generates the content (SQL entries + documents) to the application that displays it ?
My fist thoughts are to somehow send it though FTP (from code) as a zip payload, and on the display server to have a cron that will periodically process the new payloads and merge the data to the existing one.
Any other ideas? I would prefer python/django
|
Simple way to delete users account?
| 4,837,665 | 0 | 1 | 405 | 0 |
python,django,web
|
Can You Explain What kind of application you Use? If you use some kind of database with your application then simply run delete query with some specific condition
| 0 | 0 | 0 | 1 |
2011-01-29T15:11:00.000
| 2 | 0 | false | 4,837,591 | 0 | 0 | 1 | 1 |
Is there a simple way or code to delete the account from a user? I want to delete the username, email address, first_name, last_name and the profile-data.
I do have two apps
Thanks!
|
Werkzeug without ORM
| 4,838,669 | 0 | 1 | 445 | 1 |
python,orm,werkzeug
|
Is it a problem to use normal DB API, issue regular SQL queries, etc? cx_Oracle even has connection pooling biolt in to help you manage connections.
| 0 | 0 | 0 | 0 |
2011-01-29T18:09:00.000
| 3 | 0 | false | 4,838,528 | 0 | 0 | 1 | 1 |
How do I use the Werkzeug framework without any ORM like SQLAlchemy? In my case, it's a lot of effort to rewrite all the tables and columns in SQLAlchemy from existing tables & data.
How do I query the database and make an object from the database output?
In my case now, I use Oracle with cx_Oracle. If you have a solution for MySQL, too, please mention it.
Thanks.
|
Import error when trying to access sdk datastore admin
| 4,841,024 | 2 | 1 | 769 | 0 |
python,google-app-engine
|
Use from django.utils import simplejson.
dev_appserver mimics the production environment. Nothing you install at the system level will be available for import to your scripts, to avoid imports working fine in your testing and then failing spectacularly when you deploy. However, you don't need to bundle this particular module because it's already available in the django package installed on production (and with the SDK).
In general, you do need to include external libraries in your application directory, although you can symlink them from their installed locations and they'll generally work fine (and will be deployed to production when you deploy).
| 0 | 1 | 0 | 0 |
2011-01-29T22:04:00.000
| 3 | 0.132549 | false | 4,839,749 | 0 | 0 | 1 | 2 |
I'm getting a "ImportError: No module named simplejson" when trying to access datastore admin on the development server.
After the first time I got this error I installed the simplejson package from slackbuilds (i'm on Slackware). It seems to be working normally, I could import the simplejson module with no errors on the python console.
But the import error persists when I try to access datastore admin, even after installing the module. Restarting the development server didn't do anything.
What could be wrong?
Edit: here's the stacktrace:
Traceback (most recent call last):
File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 3245, in _HandleRequest
self._Dispatch(dispatcher, self.rfile, outfile, env_dict) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 3186, in _Dispatch
base_env_dict=env_dict) File "/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 531, in Dispatch
base_env_dict=base_env_dict) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 2410, in Dispatch
self._module_dict) File "/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 2320, in ExecuteCGI
reset_modules = exec_script(handler_path, cgi_path,
hook) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 2216, in ExecuteOrImportScript
exec module_code in script_module.dict File
"/home/lwlun/AppEngine/google_appengine/google/appengine/ext/datastore_admin/main.py",
line 30, in
from google.appengine.ext.datastore_admin
import copy_handler File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1295, in Decorate
return func(self, *args, **kwargs) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1945, in load_module
return self.FindAndLoadModule(submodule,
fullname, search_path) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1295, in Decorate
return func(self, *args, **kwargs) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1847, in FindAndLoadModule
description) File "/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1295, in Decorate
return func(self, *args, **kwargs) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1798, in LoadModuleRestricted
description) File "/home/lwlun/AppEngine/google_appengine/google/appengine/ext/datastore_admin/copy_handler.py",
line 40, in
from google.appengine.ext.datastore_admin
import utils File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1295, in Decorate
return func(self, *args, **kwargs) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1945, in load_module
return self.FindAndLoadModule(submodule,
fullname, search_path) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1295, in Decorate
return func(self, *args, **kwargs) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1847, in FindAndLoadModule
description) File "/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1295, in Decorate
return func(self, *args, **kwargs) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1798, in LoadModuleRestricted
description) File "/home/lwlun/AppEngine/google_appengine/google/appengine/ext/datastore_admin/utils.py",
line 35, in
from google.appengine.ext.mapreduce import
control File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1295, in Decorate
return func(self, *args, **kwargs) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1945, in load_module
return self.FindAndLoadModule(submodule,
fullname, search_path) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1295, in Decorate
return func(self, *args, **kwargs) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1847, in FindAndLoadModule
description) File "/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1295, in Decorate
return func(self, *args, **kwargs) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1798, in LoadModuleRestricted
description) File "/home/lwlun/AppEngine/google_appengine/google/appengine/ext/mapreduce/control.py",
line 26, in
from google.appengine.ext.mapreduce import
handlers File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1295, in Decorate
return func(self, *args, **kwargs) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1945, in load_module
return self.FindAndLoadModule(submodule,
fullname, search_path) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1295, in Decorate
return func(self, *args, **kwargs) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1847, in FindAndLoadModule
description) File "/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1295, in Decorate
return func(self, *args, **kwargs) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1798, in LoadModuleRestricted
description) File "/home/lwlun/AppEngine/google_appengine/google/appengine/ext/mapreduce/handlers.py",
line 26, in
import simplejson ImportError: No module named simplejson
|
Import error when trying to access sdk datastore admin
| 27,462,399 | 0 | 1 | 769 | 0 |
python,google-app-engine
|
If it in app engine SDK's lib, e.g on Mac it's
/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/
Copy it over to app's dir would work. It's better than pip install and then copy over, which may contain c-extension. The modules in SDK's lib path (at least simplejson) seems to have been modified to work with app engine's needs.
| 0 | 1 | 0 | 0 |
2011-01-29T22:04:00.000
| 3 | 0 | false | 4,839,749 | 0 | 0 | 1 | 2 |
I'm getting a "ImportError: No module named simplejson" when trying to access datastore admin on the development server.
After the first time I got this error I installed the simplejson package from slackbuilds (i'm on Slackware). It seems to be working normally, I could import the simplejson module with no errors on the python console.
But the import error persists when I try to access datastore admin, even after installing the module. Restarting the development server didn't do anything.
What could be wrong?
Edit: here's the stacktrace:
Traceback (most recent call last):
File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 3245, in _HandleRequest
self._Dispatch(dispatcher, self.rfile, outfile, env_dict) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 3186, in _Dispatch
base_env_dict=env_dict) File "/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 531, in Dispatch
base_env_dict=base_env_dict) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 2410, in Dispatch
self._module_dict) File "/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 2320, in ExecuteCGI
reset_modules = exec_script(handler_path, cgi_path,
hook) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 2216, in ExecuteOrImportScript
exec module_code in script_module.dict File
"/home/lwlun/AppEngine/google_appengine/google/appengine/ext/datastore_admin/main.py",
line 30, in
from google.appengine.ext.datastore_admin
import copy_handler File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1295, in Decorate
return func(self, *args, **kwargs) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1945, in load_module
return self.FindAndLoadModule(submodule,
fullname, search_path) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1295, in Decorate
return func(self, *args, **kwargs) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1847, in FindAndLoadModule
description) File "/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1295, in Decorate
return func(self, *args, **kwargs) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1798, in LoadModuleRestricted
description) File "/home/lwlun/AppEngine/google_appengine/google/appengine/ext/datastore_admin/copy_handler.py",
line 40, in
from google.appengine.ext.datastore_admin
import utils File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1295, in Decorate
return func(self, *args, **kwargs) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1945, in load_module
return self.FindAndLoadModule(submodule,
fullname, search_path) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1295, in Decorate
return func(self, *args, **kwargs) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1847, in FindAndLoadModule
description) File "/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1295, in Decorate
return func(self, *args, **kwargs) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1798, in LoadModuleRestricted
description) File "/home/lwlun/AppEngine/google_appengine/google/appengine/ext/datastore_admin/utils.py",
line 35, in
from google.appengine.ext.mapreduce import
control File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1295, in Decorate
return func(self, *args, **kwargs) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1945, in load_module
return self.FindAndLoadModule(submodule,
fullname, search_path) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1295, in Decorate
return func(self, *args, **kwargs) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1847, in FindAndLoadModule
description) File "/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1295, in Decorate
return func(self, *args, **kwargs) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1798, in LoadModuleRestricted
description) File "/home/lwlun/AppEngine/google_appengine/google/appengine/ext/mapreduce/control.py",
line 26, in
from google.appengine.ext.mapreduce import
handlers File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1295, in Decorate
return func(self, *args, **kwargs) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1945, in load_module
return self.FindAndLoadModule(submodule,
fullname, search_path) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1295, in Decorate
return func(self, *args, **kwargs) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1847, in FindAndLoadModule
description) File "/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1295, in Decorate
return func(self, *args, **kwargs) File
"/home/lwlun/AppEngine/google_appengine/google/appengine/tools/dev_appserver.py",
line 1798, in LoadModuleRestricted
description) File "/home/lwlun/AppEngine/google_appengine/google/appengine/ext/mapreduce/handlers.py",
line 26, in
import simplejson ImportError: No module named simplejson
|
rich web client vs thin web client
| 4,842,562 | 1 | 2 | 993 | 0 |
python,ajax,web-applications,user-interface,pyjamas
|
The biggest influence is whether you are concerned about initial page load time. If you don't mind having all the UI there at page load, your app can be more responsive by just shuttling data instead of UI. If you want faster load and don't mind larger AJAX requests, sending some UI markup isn't bad. If you have the server power to pre-render UI with data and send the fully-ready marked-up data to the user, their browser will perform more quickly, and initial page-load should be fast.
Which course you choose should depend on the task at hand. Not all requests need be handled the same way.
| 0 | 0 | 1 | 0 |
2011-01-30T10:44:00.000
| 4 | 0.049958 | false | 4,842,449 | 0 | 0 | 1 | 3 |
I have one design decision to make.
In my web(ajax) application we need to decide where should we put user interface logic ?
Should It be completely loaded via javascript ( pure single page ) . and Only data comes and go.
or
Should server send some format (XML) which translated via javascript to dynamically create rich user interface. ( semi-ajax ). so some data and ui comes and go.
Which option is better ? ( speed, ease of development, platform independence )
Thanks.
|
rich web client vs thin web client
| 4,844,422 | 2 | 2 | 993 | 0 |
python,ajax,web-applications,user-interface,pyjamas
|
I faced similar dilemma few months back. As Lennart (above) says it makes sense to go for pyjamas or similar library if your app is more desktopish.
Further one of the biggest advantage of pyjamas provide is logically well separated backend and frontend code. IMO that is very important.
If your app is not like a desktop app (like ours was), then multipage offers more advantages, such as single change wont breaks entire app, easier to maintain etc. You might want to consider can have your app server serve json and other web server serves static content and js. Js would request json app server for data. That way we managed to keep out frontend and backend separate. Further we chose mootools as js lib over pyjamas. Ofcourse it is upto your taste and need of application. We did use python template server side templates but at compile time not at runtime like usual approach. This needed to change our thinking a little but the offered many advantages.
I end up telling you my story but I thought it's relevant and hope that helps.
| 0 | 0 | 1 | 0 |
2011-01-30T10:44:00.000
| 4 | 0.099668 | false | 4,842,449 | 0 | 0 | 1 | 3 |
I have one design decision to make.
In my web(ajax) application we need to decide where should we put user interface logic ?
Should It be completely loaded via javascript ( pure single page ) . and Only data comes and go.
or
Should server send some format (XML) which translated via javascript to dynamically create rich user interface. ( semi-ajax ). so some data and ui comes and go.
Which option is better ? ( speed, ease of development, platform independence )
Thanks.
|
rich web client vs thin web client
| 4,886,016 | 0 | 2 | 993 | 0 |
python,ajax,web-applications,user-interface,pyjamas
|
Which option is better ? ( speed, ease of development, platform independence )
Platform independence, if you mean cross-browser compatibility, is a HUGE reason to use pyjamas because the python code includes a sane override infrastructure which handles everything for you. No more JS compatibility classes.
Anyway Pyjamas is all about loading the client app and then using json-rpc for the data only. That's because it's faster (once the app loaded up), easier to separate server and client, easier to maintain since all the UI code is in widgets in one place.
I've seen stuff like DokuWiki which use a php script to serve up javascript and my first thought was "WHY?" but it works pretty well I guess. It probably makes sense if you mostly have static pages with the occasional bit of JS for decoration.
| 0 | 0 | 1 | 0 |
2011-01-30T10:44:00.000
| 4 | 0 | false | 4,842,449 | 0 | 0 | 1 | 3 |
I have one design decision to make.
In my web(ajax) application we need to decide where should we put user interface logic ?
Should It be completely loaded via javascript ( pure single page ) . and Only data comes and go.
or
Should server send some format (XML) which translated via javascript to dynamically create rich user interface. ( semi-ajax ). so some data and ui comes and go.
Which option is better ? ( speed, ease of development, platform independence )
Thanks.
|
Django does not install correctly on windows machine
| 4,848,949 | 1 | 2 | 469 | 0 |
python,windows,django
|
The default behavior for cmd is to simply "open" the file, which in the case of .py for you is associated with a text editor (me too). Try python django-admin.py startproject.
To make it fool proof, locate your python.exe and type in \path\to\python.exe \path\to\django-admin.py startproject myproject
Actually, you said it worked for setup.py install so it sounds like you have the python working correctly.
| 0 | 0 | 0 | 0 |
2011-01-31T08:35:00.000
| 4 | 0.049958 | false | 4,848,907 | 0 | 0 | 1 | 3 |
In my windows I'm able to install the django by running the python file setup.py install.
But after that, I'm unable to start a project by saying django-admin.py startproject newsite. All it gives me is opening a textfile showing the django-admin.py!
Show me a way out guys
|
Django does not install correctly on windows machine
| 5,925,065 | 0 | 2 | 469 | 0 |
python,windows,django
|
I solved this as follows:
Added this to the end of my User Variable PATH: C:\Python27;C:\Python27\Scripts
Added a new System Variable PYTHONPATH and set to: c:\Python27\Lib;c:\Python27\Scipts
Be sure that you close all cmd windows and open a new cmd prompt window after you've set your new environment variables.
Hope this helps.
| 0 | 0 | 0 | 0 |
2011-01-31T08:35:00.000
| 4 | 0 | false | 4,848,907 | 0 | 0 | 1 | 3 |
In my windows I'm able to install the django by running the python file setup.py install.
But after that, I'm unable to start a project by saying django-admin.py startproject newsite. All it gives me is opening a textfile showing the django-admin.py!
Show me a way out guys
|
Django does not install correctly on windows machine
| 16,140,424 | 0 | 2 | 469 | 0 |
python,windows,django
|
Well well ..I was just having the same problem..and the problem was not related to any path variables.
The Problem was because of the default python viewer wingIDE. I had changed the default opening of python file from IDLE to wing IDE, this was the problem.
To solve this ..
click any python file and open its properties and change the "opens with" to IDLE. This should solve the problem if you had installed django according to the instructions from django site. However, the path setting said above are must and inevitable.
...Cheers and happy coding!!
| 0 | 0 | 0 | 0 |
2011-01-31T08:35:00.000
| 4 | 0 | false | 4,848,907 | 0 | 0 | 1 | 3 |
In my windows I'm able to install the django by running the python file setup.py install.
But after that, I'm unable to start a project by saying django-admin.py startproject newsite. All it gives me is opening a textfile showing the django-admin.py!
Show me a way out guys
|
Authentication using any OpenID with Tipfy
| 4,852,004 | 2 | 9 | 790 | 0 |
python,google-app-engine,openid,tipfy
|
That code is just an example. You just need to allow the user to specify their OpenID provider's endpoint URL via a form, and get the value from the POST. It's just a string.
| 0 | 0 | 0 | 0 |
2011-01-31T13:43:00.000
| 2 | 0.197375 | false | 4,851,536 | 0 | 0 | 1 | 1 |
I am developing the authentication part of my app and I've run into issues with coding authentication using OpenID.
I've looked at the Tipfy example code, but it seems written under the assumption that the OpenID provider is hard-coded to google.
I would like the user to be able to provide any OpenID they desire (isn't that the point?).
Does anyone have any example code that shows a user logging in using a user-supplied OpenID?
|
How can you limit the allowed execution time of specific methods in the python version of Google App Engine?
| 4,862,285 | 0 | 4 | 257 | 0 |
python,google-app-engine
|
In loops, you can store the time the loop started and check how long it's been going on each iteration.
If you're not in a loop, things are a bit trickier. You could add the time-checking bit every few lines of code. This, of course, makes for really ugly code, but without the ability to spawn threads that could run a timer in the background and interrupt the running code, there's not much of a way around it.
| 0 | 1 | 0 | 0 |
2011-02-01T06:46:00.000
| 2 | 0 | false | 4,859,734 | 0 | 0 | 1 | 1 |
Since the signal module is not supported in the python version of Google App Engine, what is the simplest way to call a method and throw/catch an exception if the method does not return in less than 2 seconds?
|
Programmatically add URL Patterns in Django?
| 4,868,840 | 4 | 12 | 4,070 | 0 |
python,django,django-admin,django-urls,django-settings
|
If you use gunicorn without code preloading, just send a HUP to the gunicorn master process, it will spawn new workers which load the new code, and gracefully shut down the old ones, without a single lost request!
| 0 | 0 | 0 | 0 |
2011-02-01T18:56:00.000
| 4 | 0.197375 | false | 4,866,750 | 0 | 0 | 1 | 1 |
Is there a way to programmatically add URL Patterns to Django without having to restart the server?
Or is there a way force Django to reprocess/cache URL patterns ( the URLconf )?
|
Memcache not present in App-Engine-Patch?
| 4,870,311 | 1 | 1 | 1,200 | 0 |
google-app-engine,memcached,app-engine-patch,python-memcached
|
It looks like you're attempting to make a memcache call at import time. Judging from the stacktrace, Django imports your modules before it sets up the App Engine environment, and therefore any calls to App Engine services at the module level will fail on the development server.
Move the call to memcache inside a function that's called from a request handler, and it should resolve your problem.
| 0 | 1 | 0 | 0 |
2011-02-02T02:03:00.000
| 1 | 1.2 | true | 4,870,102 | 0 | 0 | 1 | 1 |
I'm trying to store a date into memcache using the following code:
from datetime import date
from google.appengine.api.memcache import Client
MEMCACHE_DATE_KEY = 'date'
client = Client()
def last_date():
return client.get(MEMCACHE_DATE_KEY)
def new_date():
client.set(MEMCACHE_DATE_KEY, date.today())
I am getting this error:
Traceback (most recent call last):
File "manage.py", line 4, in
setup_env(manage_py_env=True)
File "/Users/benji/Projects/app-engine-patch-sample/common/appenginepatch/aecmd.py", line 67, in setup_env
patch_all()
File "/Users/benji/Projects/app-engine-patch-sample/common/appenginepatch/appenginepatcher/patch.py", line 29, in patch_all
patch_app_engine()
File "/Users/benji/Projects/app-engine-patch-sample/common/appenginepatch/appenginepatcher/patch.py", line 520, in patch_app_engine
db.Model._meta = _meta(db.Model, ())
File "/Users/benji/Projects/app-engine-patch-sample/common/appenginepatch/appenginepatcher/patch.py", line 258, in __init__
settings.INSTALLED_APPS
File "/Users/benji/Projects/share-renting-engine/common/zip-packages/django-1.1.zip/django/utils/functional.py", line 269, in __getattr__
File "/Users/benji/Projects/share-renting-engine/common/zip-packages/django-1.1.zip/django/conf/__init__.py", line 40, in _setup
File "/Users/benji/Projects/share-renting-engine/common/zip-packages/django-1.1.zip/django/conf/__init__.py", line 73, in __init__
File "/Users/benji/Projects/share-renting-engine/common/zip-packages/django-1.1.zip/django/utils/importlib.py", line 35, in import_module
File "/Users/benji/Projects/share-renting-engine/settings.py", line 120, in
from ragendja.settings_post import *
File "/Users/benji/Projects/app-engine-patch-sample/common/appenginepatch/ragendja/settings_post.py", line 98, in
check_app_imports(app)
File "/Users/benji/Projects/app-engine-patch-sample/common/appenginepatch/ragendja/settings_post.py", line 63, in check_app_imports
__import__(app, {}, {}, [''])
File "/Users/benji/Projects/share-renting-engine/engine/__init__.py", line 5, in
if date.today() != last_date():
File "/Users/benji/Projects/share-renting-engine/engine/utils/date.py", line 12, in last_date
return client.get(MEMCACHE_DATE_KEY)
File "/Users/benji/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/memcache/__init__.py", line 428, in get
self._make_sync_call('memcache', 'Get', request, response)
File "/Users/benji/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 86, in MakeSyncCall
return stubmap.MakeSyncCall(service, call, request, response)
File "/Users/benji/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 279, in MakeSyncCall
assert stub, 'No api proxy found for service "%s"' % service
AssertionError: No api proxy found for service "memcache"
How can i use memcache with app-engine-patch?
Thanks for your time.
|
Set Hudson Build Description via Web API
| 32,389,162 | 0 | 5 | 2,645 | 0 |
python,hudson,hudson-api
|
Here is the curl command that worked fine from shell. Replace the text in between and including {}.
curl -X POST -u {user:password} -H 'Content-Type: application/x-www-form-urlencoded' --data-urlencode description={descriptionstring} {hudsonurl}/job/{jobname}/{buildnumber}/submitDescription
| 0 | 0 | 0 | 0 |
2011-02-02T02:23:00.000
| 4 | 0 | false | 4,870,187 | 0 | 0 | 1 | 1 |
I have a Python script that operates on Hudson builds and would love to be able to set the description of a build programmatically.
I can click "Add Description" on a build's page and fill in the form, how can I POST some data to the same URL that form does?
|
Considerations for moving our web app to an appliance
| 4,872,968 | 0 | 3 | 124 | 0 |
python,appliance
|
It depends on what langauge/tecnology application is written.
If it is java, release war file + tomcat/jboss.
If it is python, release eggs.
If it is php... not sure, probably just .tar.bz2.
Linux distro or virtual image mught be advantage, but I dislike using them, because they are usually does not fits to my infra (why do I have to install some custom debian-based distro to my rhel-only infrastructure?).
| 0 | 1 | 0 | 1 |
2011-02-02T09:33:00.000
| 2 | 0 | false | 4,872,722 | 0 | 0 | 1 | 1 |
We have developed a web application running on Linux that is quite popular. We now wish to release it as an appliance so customers can run it internally on their own networks.
We are unsure of the best approach. We are flexible on areas such as: the Linux distro, whether it's a hardware or software only appliance. Does anyone have any advice on the best way to go about this? Links to any good resources on the subject? Questions we should be asking ourselves? Legal considerations for a commercial app? Security considerations?
UPDATE:
It's a Python based web application. We would like the user to be able to do everything via a web interface. No command line stuff etc.
|
Recursive use of Scrapy to scrape webpages from a website
| 4,889,635 | 0 | 1 | 1,171 | 0 |
python,web-scraping,scrapy
|
Why don't you want to add all the links to 50 pages? Are the URLs of the pages consecutive like www.site.com/page=1, www.site.com/page=2 or are they all distinct? Can you show me the code that you have now?
| 0 | 0 | 1 | 0 |
2011-02-02T16:08:00.000
| 2 | 0 | false | 4,876,799 | 0 | 0 | 1 | 2 |
I have recently started to work with Scrapy. I am trying to gather some info from a large list which is divided into several pages(about 50). I can easily extract what I want from the first page including the first page in the start_urls list. However I don't want to add all the links to these 50 pages to this list. I need a more dynamic way. Does anyone know how I can iteratively scrape web pages? Does anyone have any examples of this?
Thanks!
|
Recursive use of Scrapy to scrape webpages from a website
| 4,940,212 | 1 | 1 | 1,171 | 0 |
python,web-scraping,scrapy
|
use urllib2 to download a page. Then use either re (regular expressions) or BeautifulSoup (an HTML parser) to find the link to the next page you need. Download that with urllib2. Rinse and repeat.
Scapy is great, but you dont need it to do what you're trying to do
| 0 | 0 | 1 | 0 |
2011-02-02T16:08:00.000
| 2 | 0.099668 | false | 4,876,799 | 0 | 0 | 1 | 2 |
I have recently started to work with Scrapy. I am trying to gather some info from a large list which is divided into several pages(about 50). I can easily extract what I want from the first page including the first page in the start_urls list. However I don't want to add all the links to these 50 pages to this list. I need a more dynamic way. Does anyone know how I can iteratively scrape web pages? Does anyone have any examples of this?
Thanks!
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.