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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Selecting a Python Web Framework
| 3,783,714 | 1 | 6 | 2,699 | 0 |
python,mysql,django,pylons,cherrypy
|
CherryPy is the only framework I'm aware of that does real HTTP caching out of the box (but look at "beaker" for a WSGI component solution). Many of the others give you tools to store arbitrary objects in Memcached or other storage.
| 0 | 0 | 0 | 0 |
2010-09-23T19:23:00.000
| 5 | 0.039979 | false | 3,781,802 | 0 | 0 | 1 | 1 |
This may seem like a subjective question. But it is not (that's not the idea, at least).
I'm developing an Advertising software (like AdWords, AdBrite, etc) and i've decide to use Python. And would like to use one of those well known web frameworks (Django, Cherrypy, pylons, etc).
The question is:
Given that it will have just a few Models (seven or eight), which has the best cache support? and What is the most efficient retrieving data from a MySQL database?
Thanks!
|
Prepopulating a Django FileField
| 3,787,861 | 2 | 1 | 669 | 0 |
python,django
|
Well I found the answer. It was quite easy actually. you just need to set the FileField value to some string and it will point to that file.
The point is that the path specified should be correct otherwise you get a 404 error when trying to access it.
| 0 | 0 | 0 | 0 |
2010-09-24T08:48:00.000
| 1 | 1.2 | true | 3,785,502 | 0 | 0 | 1 | 1 |
I wanted to know how is it possible in django to bind an already uploaded file (stored in the file system of server) to a Model FileField. This way I want to have my edit page of that model to prepopulate the FileField with this file.
Thanks
|
Java: Equivalent of Python's range(int, int)?
| 3,790,193 | 1 | 115 | 96,489 | 0 |
java,python
|
If you mean to use it like you would in a Python loop, Java loops nicely with the for statement, which renders this structure unnecessary for that purpose.
| 0 | 0 | 0 | 0 |
2010-09-24T19:04:00.000
| 14 | 0.014285 | false | 3,790,142 | 0 | 0 | 1 | 1 |
Does Java have an equivalent to Python's range(int, int) method?
|
Is there any other way besides browser extensions that one could have a GUI bar hover over any website a user visits?
| 3,791,545 | 1 | 1 | 115 | 0 |
python,ajax,user-interface,browser
|
The closest you can get is using (ick) frames, with one frame for your bar and one for the page. That's what Google Image Search does. It can easily get broken by frame-busting scripts though.
| 0 | 0 | 0 | 0 |
2010-09-24T22:39:00.000
| 2 | 1.2 | true | 3,791,527 | 0 | 0 | 1 | 2 |
Goal
I want to create a web app with a horizontal GUI bar that floats with the user as they move from site to site. e.g. A user will sign into the web at the home page and then proceed to say Google to start searching for their topic. Once they are signed in and leave the web app homepage a horizontal GUI bar will appear on each page they visit until they log out. So when a user goes to Google to start searching the GUI bar will be there. When they click on a link and go to that page, the GUI bar will be there too.
Known Ways
I noticed apps like Get Glue and Layers.com work by having the user install browser extensions. I would like to avoid this if possible.
Additionally it can not be like the Digg Bar because it only appears when a user presses the book marklet or places digg.com in front of the site/page URL. It also can't be like the Facebook or Meebo bars because it requires the web developer to already have implemented that code on their site.
Closest Example
The best example of what I am trying to go after is something like Google Image search where if you click an image Google will open up the site (but grayed out) with the picture hovering above it and a left side bar with image info in it. So Google opens a site with in it self. Another example might be Stumble Upon's top GUI bar.
Is my idea possible with technologies like AJAX and Python?
|
Is there any other way besides browser extensions that one could have a GUI bar hover over any website a user visits?
| 3,791,539 | 0 | 1 | 115 | 0 |
python,ajax,user-interface,browser
|
Is my idea possible with technologies
like AJAX and Python?
If the pages you want floating under the bar belong to a different domain than yours (it seems like that's what you want), then the answer is No. This is not possible with client-sided scripting alone (eg: Javascript) because of the same origin policy. What you use on the server side, Python or Ruby or whatever is irrelevant.
| 0 | 0 | 0 | 0 |
2010-09-24T22:39:00.000
| 2 | 0 | false | 3,791,527 | 0 | 0 | 1 | 2 |
Goal
I want to create a web app with a horizontal GUI bar that floats with the user as they move from site to site. e.g. A user will sign into the web at the home page and then proceed to say Google to start searching for their topic. Once they are signed in and leave the web app homepage a horizontal GUI bar will appear on each page they visit until they log out. So when a user goes to Google to start searching the GUI bar will be there. When they click on a link and go to that page, the GUI bar will be there too.
Known Ways
I noticed apps like Get Glue and Layers.com work by having the user install browser extensions. I would like to avoid this if possible.
Additionally it can not be like the Digg Bar because it only appears when a user presses the book marklet or places digg.com in front of the site/page URL. It also can't be like the Facebook or Meebo bars because it requires the web developer to already have implemented that code on their site.
Closest Example
The best example of what I am trying to go after is something like Google Image search where if you click an image Google will open up the site (but grayed out) with the picture hovering above it and a left side bar with image info in it. So Google opens a site with in it self. Another example might be Stumble Upon's top GUI bar.
Is my idea possible with technologies like AJAX and Python?
|
Managing subdomains
| 3,794,000 | 1 | 2 | 347 | 0 |
python,django,subdomain
|
You may be able to do what you need with apache mod_rewrite.
Obviously I didn't read the question clearly enough.
As for how to do it in django: you could have some middleware that looks at the server name, and redirects according to that (or even sets a variable). You can't do it with the bare url routing system, as that only has path information, not hostname info.
| 0 | 0 | 0 | 0 |
2010-09-25T10:34:00.000
| 1 | 1.2 | true | 3,793,424 | 0 | 0 | 1 | 1 |
What are the best practices and solutions for managing dynamic subdomains in different technologies and frameworks? I am searching for something to implement in my Django project but those solutions that I saw, don't work. I also tried to use Apache rewrite mod to send requests from subdomain.domain.com to domain.com/subdomain but couldn't realize how to do it with Django.
UPDATE: What I need is to create virtual subdomains for my main domain using usernames from the site. So, if I have a new registered user that is called jack, when I go to jack.domain.com, it would operate make some operations. Like if I just went to domain.com/users/jack. But I don't want to create an actual subdomain for each user.
|
How to get windows user id in web2py for an intranet application?
| 3,798,630 | 1 | 3 | 996 | 0 |
python,windows,web2py
|
If you mean you need code at the server to know the windows id of the current browser user, web2py isn't going to be able to tell you that. Windows authentication has nothing to do with web protocols.
| 0 | 0 | 1 | 0 |
2010-09-26T16:04:00.000
| 3 | 0.066568 | false | 3,798,606 | 0 | 0 | 1 | 1 |
I'm using web2py for an intranet site and need to get current login windows user id in my controller. Whether any function is available?
|
"Zero Iteration" - end to end acceptance test in simple contact-form feature
| 3,799,733 | 1 | 7 | 479 | 0 |
python,django,unit-testing,tdd,bdd
|
You don't have to contain all possibilities in acceptance tests at all - you will still write unit tests. So I would say that a single tests "user can fill in the form, save it and load it back" is enough to start with. Then you can add more tests if you think that a particular aspect of your system is important enough that it needs an acceptance tests. Don't worry about handling all possibilities here, you will still write tons of unit tests where you will test everything!
The easiest way to start is to grow your acceptance test in parallel with the code: so start with testing that the user can input data, implement it until it stops failing, then add to the test the condition that the user has to load this data back etc. It will take a while to implement the initial infrastructure for the acceptance test, before you even start writing production code, but you can't escape from it anyway, and there are various benefits to have tests upfront.
| 0 | 0 | 0 | 1 |
2010-09-26T16:09:00.000
| 2 | 1.2 | true | 3,798,629 | 0 | 0 | 1 | 2 |
I was reading "Growing Object-Oriented Software, Guided by Tests" lately.
Authors of this book sugested to always start developing a feature with an end-to-end acceptance test (before starting TDD cycle) to not loose a track of progress and to make sure that you're still on the same page while unit-testing.
Ok, so I've start writing a veeeery simple application in python+django just to try this approach out. I want User to be able to ask a question via contact-form, the question should be then stored in a db, and a signal after completion should be send to notify mailer which will send follow-up message.
Question is - how you'd approach this first end-to-end test in this case? Do you have contain all possibilities in this first test, or maybe I'm misunderstanding this whole technique.
Any examples would be most welcome.
|
"Zero Iteration" - end to end acceptance test in simple contact-form feature
| 3,799,623 | 0 | 7 | 479 | 0 |
python,django,unit-testing,tdd,bdd
|
This use-case leads to several test-cases (every tests a dedicated possible path of execution).
When writing tests focus on one possible outcome, after a while test-suite grows. The first tests then also give you safety net as regression tests to not break anything which you already implemented successfully.
My first tests would be:
Happy path 1st part frontend-form + controller layer: User passes correct data, controller take the form and log to console/stdout
Happy path 2nd part: Instead of logging to stdout, things get stored to database
Happy path 3rd part: Follow-up mail gets sent and received by User
Validation error handling (user fills form out incorrectly, e.g. misses mandatory fields, wrong email-pattern)
...
Fill out the rest ;) Depends on the more detailed requirements...
Remember to implement above as simple as possible. When all tests are in place, refactor ruthlessly to make "internal quality" nice.
| 0 | 0 | 0 | 1 |
2010-09-26T16:09:00.000
| 2 | 0 | false | 3,798,629 | 0 | 0 | 1 | 2 |
I was reading "Growing Object-Oriented Software, Guided by Tests" lately.
Authors of this book sugested to always start developing a feature with an end-to-end acceptance test (before starting TDD cycle) to not loose a track of progress and to make sure that you're still on the same page while unit-testing.
Ok, so I've start writing a veeeery simple application in python+django just to try this approach out. I want User to be able to ask a question via contact-form, the question should be then stored in a db, and a signal after completion should be send to notify mailer which will send follow-up message.
Question is - how you'd approach this first end-to-end test in this case? Do you have contain all possibilities in this first test, or maybe I'm misunderstanding this whole technique.
Any examples would be most welcome.
|
MongoDB for realtime ajax stuff?
| 3,799,207 | 0 | 2 | 1,738 | 1 |
php,python,ajax,mongodb,real-time
|
It depends heavily on the server running said NoSQL solution, amount of data etc... I have played around with Mongo a bit and it is very easy to setup multiple servers to run simultaneously and you would most likely be able to accomplish high concurrency by starting multiple instances on the same box and having them act like a cluster. Luckily Mongo, at least, handles all the specifics so servers can be killed and introduced without skipping a beat (depending on version). By default I believe the max connections is 1000 so starting 5 servers with said configuration would suffice (if your server can handle it obviously) but realistically you would most likely never be hitting 5000 users at the exact same time.
I hope for your hardware's sake you would at least come up with a solution that can check to see if new data is available before a full-on fetch. Either via timestamps or Memcache etc...
Overall I would tend to believe NoSQL would be much faster than traditional databases assuming you are fetching data and not running reports etc... and your datastore design is intelligent enough to compensate for the lack of complex joins.
| 0 | 0 | 0 | 0 |
2010-09-26T16:31:00.000
| 2 | 0 | false | 3,798,728 | 0 | 0 | 1 | 2 |
Howdie stackoverflow people!
So I've been doing some digging regarding these NoSQL databases, MongoDB, CouchDB etc. Though I am still not sure about real time-ish stuff therefore I thought i'd ask around to see if someone have any practical experience.
Let's think about web stuff, let's say we've got a very dynamic super ajaxified webapp that asks for various types of data every 5-20 seconds, our backend is python or php or anything other than java really... in cases such as these obviously a MySQL or similar db would be under heavy pressure (with lots of users), would MongoDB / CouchDB run this without breaking a sweat and without the need to create some super ultra complex cluster/caching etc solution?
Yes, that's basically my question, if you think that no.. then yes I know there are several types of solutions for this, nodeJS/websockets/antigravity/worm-hole super tech, but I am just interested in these NoSQL things atm and more specifically if they can handle this type of thing.
Let's say we have 5000 users at the same time, every 5, 10 or 20 seconds ajax requests that updates various interfaces.
Shoot ;]
|
MongoDB for realtime ajax stuff?
| 3,801,074 | 2 | 2 | 1,738 | 1 |
php,python,ajax,mongodb,real-time
|
Let's say we have 5000 users at the
same time, every 5, 10 or 20 seconds
ajax requests that updates various
interfaces.
OK, so to get this right, you're talking about 250 to 1000 writes per second? Yeah, MongoDB can handle that.
The real key on performance is going to be whether or not these are queries, updates or inserts.
For queries, Mongo can probably handle this load. It's really going to be about data size to memory size ratios. If you have a server with 1GB of RAM and 150GB of data, then you're probably not going to get 250 queries / second (with any DB technology). But with reasonable hardware specs, Mongo can hit this speed on a single 64-bit server.
If you have 5,000 active users and you're constantly updating existing records then Mongo will be really fast (on par with updating memcached on a single machine). The reason here is simply that Mongo will likely keep the record in memory. So a user will send updates every 5 seconds and the in-memory object will be updated.
If you are constantly inserting new records, then the limitation is really going to be one of throughput. When you're writing lots of new data, you're also forcing the index to expand. So if you're planning to pump in Gigs of new data, then you risk saturating the disk throughput and you'll need to shard.
So based on your questions, it looks like you're mostly querying/updating. You'll be writing new records, but not 1000 new records / second. If this is the case, then MongoDB is probably right for you. It will definitely get around a lot of caching concerns.
| 0 | 0 | 0 | 0 |
2010-09-26T16:31:00.000
| 2 | 1.2 | true | 3,798,728 | 0 | 0 | 1 | 2 |
Howdie stackoverflow people!
So I've been doing some digging regarding these NoSQL databases, MongoDB, CouchDB etc. Though I am still not sure about real time-ish stuff therefore I thought i'd ask around to see if someone have any practical experience.
Let's think about web stuff, let's say we've got a very dynamic super ajaxified webapp that asks for various types of data every 5-20 seconds, our backend is python or php or anything other than java really... in cases such as these obviously a MySQL or similar db would be under heavy pressure (with lots of users), would MongoDB / CouchDB run this without breaking a sweat and without the need to create some super ultra complex cluster/caching etc solution?
Yes, that's basically my question, if you think that no.. then yes I know there are several types of solutions for this, nodeJS/websockets/antigravity/worm-hole super tech, but I am just interested in these NoSQL things atm and more specifically if they can handle this type of thing.
Let's say we have 5000 users at the same time, every 5, 10 or 20 seconds ajax requests that updates various interfaces.
Shoot ;]
|
How can I use redis with Django?
| 7,722,260 | 61 | 107 | 75,541 | 1 |
python,django,redis
|
Just because Redis stores things in-memory does not mean that it is meant to be a cache. I have seen people using it as a persistent store for data.
That it can be used as a cache is a hint that it is useful as a high-performance storage. If your Redis system goes down though you might loose data that was not been written back onto the disk again. There are some ways to mitigate such dangers, e.g. a hot-standby replica.
If your data is 'mission-critical', like if you run a bank or a shop, Redis might not be the best pick for you. But if you write a high-traffic game with persistent live data or some social-interaction stuff and manage the probability of data-loss to be quite acceptable, then Redis might be worth a look.
Anyway, the point remains, yes, Redis can be used as a database.
| 0 | 0 | 0 | 0 |
2010-09-27T05:48:00.000
| 5 | 1 | false | 3,801,379 | 0 | 0 | 1 | 1 |
I've heard of redis-cache but how exactly does it work? Is it used as a layer between django and my rdbms, by caching the rdbms queries somehow?
Or is it supposed to be used directly as the database? Which I doubt, since that github page doesn't cover any login details, no setup.. just tells you to set some config property.
|
Themes for python e-commerce solutions
| 11,260,331 | 0 | 3 | 299 | 0 |
python,e-commerce
|
well, if that is the case, I think the only reason I can think up of is that this Satchmo is not that popular so that nobody is willing to port or design a theme for it.
I would suggest randomly grab a theme, port it here accordingly
| 0 | 0 | 0 | 1 |
2010-09-27T09:33:00.000
| 1 | 0 | false | 3,802,544 | 0 | 0 | 1 | 1 |
There are two good open source python e-commerce solutions exist: Satchmo and LFS. But I can't find any theme for them. Does at least one open source theme for them exist? There are thousands themes for Magento, osCommerce, OpenCart, but zero themes for Satchmo.
Thanks.
|
New to google app engine ! what to do next?
| 3,805,886 | 1 | 1 | 120 | 0 |
python,google-app-engine
|
Typically when I end up doing something more than a trivial demo I need a reason. Figure out something you want to make and stumble through it, learning as you go until it's working.
I'd use the google app engine community as a place to get questions answered, they're pretty good for that.
As a first app, I'd just have a goal that you're working towards and start asking the community "how do I do this...?"
| 0 | 1 | 0 | 0 |
2010-09-27T16:28:00.000
| 2 | 0.099668 | false | 3,805,802 | 0 | 0 | 1 | 1 |
I want to develop some web apps using Google app engine. I had deployed a guest book application which was their in "gooleappengine" folder by changing its ID.and also was successful.This is simple one.But not getting how to develop complex web apps. Can anyone please suggest me any good Tutarial or example codes Or any books to refer.
|
My facebook authentication is not working?
| 3,806,101 | 0 | 0 | 186 | 0 |
python,facebook
|
You probably need to update the domain in the facebook settings/api key which allow you access.
| 0 | 0 | 1 | 1 |
2010-09-27T17:08:00.000
| 1 | 0 | false | 3,806,082 | 0 | 0 | 1 | 1 |
I changed my domain from abc.com to xyz.com. After that my facebook authentication is not working.
It is throwing a key error KeyError: 'access_token'I am using python as my language.
|
Creating a website to communicate with an embedded device
| 3,811,703 | 0 | 5 | 1,776 | 0 |
python,apache,embedded,beagleboard
|
the device will be mobile and will be moving locations every few days. So, I can't guarantee a static IP address for the device.
Your device can be a client of the web site.
Your web site has two interfaces.
HTML interface to people.
A non-HTML interface to the device. As a client of a web site, the device will need an HTTP client-side library to send a request to the web site. This request will include the device's IP address, plus all the usual malarky buried in an HTTP request. (There are a bunch of standard headers that are sent in a request)
Once the device has made it's initial request, then your web site can save the device's current status and communicate with it through another protocol if you want to do that.
(I'm guessing that "I have all the functional parts written on the server and device side" means you have some other protocol for controlling the device, and this protocol isn't based on HTTP.)
It might be simplest in the long run to have the device poll the web site for commands or updates or things. That way the device is a pure web client using only HTTP, and your web site is a pure web server, using only HTTP. Then you don't need your more specialized second protocol. Using only HTTP means you can use SSL to assure a secure communication.
If your device uses HTTP to get commands and updates, you'll need to work out a usable representation for data that can easily be encoded into HTTP requests and responses. Choices include XML, JSON and YAML. You can always invent your own data format; however, you'll probably be happier debugging a standardized format like JSON.
Building these two interfaces in Django is pretty trivial. You'll simply have some URL's which are for people and some which are for your device. You'll have view functions for people that return HTML pages, and view functions for your device that return JSON or XML messages.
| 0 | 0 | 0 | 1 |
2010-09-27T23:17:00.000
| 4 | 0 | false | 3,808,581 | 0 | 0 | 1 | 1 |
I'm currently working on a project where I'm trying to control an embedded device through an Internet facing website. The idea is is that a user can go to a website and tell this device to preform some kind of action. An action on the website would be translated into a series of CLI commands and then sent to the device. Communication could potentially go both ways in the future, but right now I'm focusing on server-to-device.
The web server is a LAMP stack using Python (Django) and the device I'm trying to communicate with is a Beagle Board running eLinux. There would be only one device existing at any time communicating to the server.
I have all the functional parts written on the server and device side, but I'm having a bit of trouble figuring out how to write the communication layer. One of my big issues is that the device will be mobile and will be moving locations every few days. So, I can't guarantee a static IP address for the device. My networking programming knowledge is pretty minimal so I don't have that great an idea on where to start.
Does anyone have any ideas/resources on how I can start developing this kind of communication?
Thanks!
|
AMQP implementations with Celery
| 4,311,856 | 0 | 0 | 289 | 0 |
python,amqp,celery
|
After reading some docs and trying out a few options, I have found that RabbitMQ suffices for most purposes.
| 0 | 1 | 0 | 0 |
2010-09-28T03:16:00.000
| 1 | 1.2 | true | 3,809,440 | 0 | 0 | 1 | 1 |
I wanted to get your opinions on the merits of different AMQP implementations to be used with celery. I am looking particularly at message prioritization and job queue sizes.
What are your thoughts?
|
Convert URL to screenshot (script)
| 21,106,018 | 0 | 7 | 31,489 | 0 |
php,python,django,url,screenshot
|
If you are family with Python, you can use PyQt4. This library supports to get screenshot from a url.
| 0 | 0 | 1 | 0 |
2010-09-28T10:08:00.000
| 6 | 0 | false | 3,811,674 | 0 | 0 | 1 | 1 |
There is the URL of page on the Internet. I need to get a screenshot of this page (no matter in which browser).
I need a script (PHP, Python (even Django framework)) that receives the URL (string) and output screenshot-file at the exit (file gif, png, jpg).
UPD:
I need dynamically create a page where opposite to URL will be placed screenshot of the page with the same URL.
|
Are there any basic standards and practices for making human readable code?
| 3,812,833 | 2 | 6 | 407 | 0 |
java,python,html,human-readable
|
One piece of advice is not to be lazy with names. For example, if you have a Java class which is an implementation of the Transformer interface, and it transforms String to Date, don't hesitate to name the class StringToDateTransformerImpl.
| 0 | 0 | 0 | 0 |
2010-09-28T12:43:00.000
| 9 | 0.044415 | false | 3,812,778 | 1 | 0 | 1 | 7 |
More specifically making HTML, Java, and python more readable? Does anyone have suggestions for this programming student?
|
Are there any basic standards and practices for making human readable code?
| 3,813,396 | 1 | 6 | 407 | 0 |
java,python,html,human-readable
|
Proper indentation when writing HTML can be a lifesaver, especially when you're interacting with any sort of nested elements. Just be consistent with the indentation and be sure to update surrounding lines when you move or delete an indented element. This makes it much easier to update the page, as the level of indentation will give a clue as to where you are in the page without resorting to some sort of Ctrl+F maneuver.
It's also worth noting that if you're using CSS in conjunction with HTML, proper naming is critical! It will improve your workflow and the readability of your code.
I'm also a big fan of indentation, spacing, and comments when writing "real" (Java, Python, C, etc.) code. I lean towards (x + 1) over (x+1) because I personally think it makes a big difference in readability. I space out casts, increments, etc. and they catch my eye much more easily. Be consistent with your bracket/indentation style, and comment liberally - remember, re-writing a method name is not a comment!
| 0 | 0 | 0 | 0 |
2010-09-28T12:43:00.000
| 9 | 0.022219 | false | 3,812,778 | 1 | 0 | 1 | 7 |
More specifically making HTML, Java, and python more readable? Does anyone have suggestions for this programming student?
|
Are there any basic standards and practices for making human readable code?
| 3,812,887 | 2 | 6 | 407 | 0 |
java,python,html,human-readable
|
Well, you can always use the "ignorant test". Show your code to someone who knows absolutely nothing about programmation. If he can see more or less what a function does, the code is probably readable.
| 0 | 0 | 0 | 0 |
2010-09-28T12:43:00.000
| 9 | 0.044415 | false | 3,812,778 | 1 | 0 | 1 | 7 |
More specifically making HTML, Java, and python more readable? Does anyone have suggestions for this programming student?
|
Are there any basic standards and practices for making human readable code?
| 3,812,844 | 3 | 6 | 407 | 0 |
java,python,html,human-readable
|
Try to read your code out loud (or at least in your head).
| 0 | 0 | 0 | 0 |
2010-09-28T12:43:00.000
| 9 | 0.066568 | false | 3,812,778 | 1 | 0 | 1 | 7 |
More specifically making HTML, Java, and python more readable? Does anyone have suggestions for this programming student?
|
Are there any basic standards and practices for making human readable code?
| 3,812,826 | 5 | 6 | 407 | 0 |
java,python,html,human-readable
|
Use consistent casing and naming.
Use tabs (and brackets where available) to provide a visual flow.
Use comments that explain what's happening conceptually as well as technically. (e.g., //Do we have a valid user? not //Check that user_ID is not -1)
I'm sure some more seasoned developers will have more suggestions, but those are my top 3.
| 0 | 0 | 0 | 0 |
2010-09-28T12:43:00.000
| 9 | 1.2 | true | 3,812,778 | 1 | 0 | 1 | 7 |
More specifically making HTML, Java, and python more readable? Does anyone have suggestions for this programming student?
|
Are there any basic standards and practices for making human readable code?
| 3,812,816 | 5 | 6 | 407 | 0 |
java,python,html,human-readable
|
Proper indention and informative comments.
| 0 | 0 | 0 | 0 |
2010-09-28T12:43:00.000
| 9 | 0.110656 | false | 3,812,778 | 1 | 0 | 1 | 7 |
More specifically making HTML, Java, and python more readable? Does anyone have suggestions for this programming student?
|
Are there any basic standards and practices for making human readable code?
| 3,812,812 | 5 | 6 | 407 | 0 |
java,python,html,human-readable
|
Make sure your code is well structured (proper indentation, blank lines to separate sections of code, etc.) and use standard, consistent, and fully named (rather than incomprehensible abbreviated) variable names.
Others would suggest using proper comments. I would tend to disagree. If your code is well structured and variables well named, then comments would just clutter things up. The exception to the rule being when you must do something counter-intuitive to work around a bug somewhere else (I've had to resort to this in WCF and Entity Framework code in the past).
| 0 | 0 | 0 | 0 |
2010-09-28T12:43:00.000
| 9 | 0.110656 | false | 3,812,778 | 1 | 0 | 1 | 7 |
More specifically making HTML, Java, and python more readable? Does anyone have suggestions for this programming student?
|
does python gives interactivity as javascript?
| 3,821,323 | 5 | 1 | 128 | 0 |
javascript,python
|
When you use Python for web development, you use it server-side (like PHP). It's not for client-side programming in the same way that JavaScript is. The vast majority of browsers only support JavaScript for client-side programming.
If you want client-side code on a site that's using Python on the server, it still has to use JavaScript on the client.
(For completeness, there is (or used to be) a way to use Python on the client side by installing PyWin32, but then your site would only work for people with that software installed and configured. I'd also be very dubious about its security.)
| 0 | 0 | 0 | 0 |
2010-09-29T11:49:00.000
| 1 | 1.2 | true | 3,821,305 | 0 | 0 | 1 | 1 |
I want to add interactivity like clicks, hover, onpage load() to a webpage, if i use python for generating xhtml, will python give essential flavors like javascript??
I'm bit confused and starter in python for web development, so is there need to include old javascript into python or the python only can handle interactivity, events as javascript?
|
Python App Engine: Task Queues
| 3,823,052 | 2 | 1 | 284 | 0 |
python,google-app-engine
|
I've solved this in the past by keeping the status for the tasks in memcached, and polling (via Ajax) to determine when the tasks are finished.
If you go this way, it's best if you can always "manually" determine the status of the tasks without looking in memcached, since there's always the (slim) chance that memcache will go down or will get cleared or something as a task is running.
| 0 | 1 | 0 | 0 |
2010-09-29T12:41:00.000
| 1 | 1.2 | true | 3,821,636 | 0 | 0 | 1 | 1 |
I need to import some data to show it for user but page execution time exceeds 30 second limit. So I decided to split my big code into several tasks and try Task Queues. I add about 10-20 tasks to queue and app engine executes tasks in parallel while user is waiting for data. How can I determine that my tasks are completed to show user data ASAP? Can I somehow iterate over active tasks?
|
Django randomly order users in admin
| 3,831,573 | 1 | 0 | 235 | 0 |
python,django-admin,customization
|
If I were you (and I am), I would stop trying to integrate this functionality with the Django admin site. Speaking from experience, you'll find that what you're trying to do is much easier to implement as regular views. Sure, it isn't be as pretty, but something that works beats something that's pretty but doesn't work, right?
| 0 | 0 | 0 | 0 |
2010-09-29T14:55:00.000
| 2 | 0.099668 | false | 3,822,857 | 0 | 0 | 1 | 1 |
I am trying to create a Django admin filter that will get random groups of users. At this point, I have two problems:
Applying a custom filter to the User model, and
Displaying a random set of users.
On #1, I've tried using User.username.random_filter = True, but it comes back with an AttributeError saying that User has no attribute username.
On #2, I know I can get 50 random users with User.objects.order_by('?')[:50], but I have not been able to figure out how to get the result of such a query to show up in the admin listing. As far as I can tell, the listing is generated by the URL's GET request, but I've not had any luck ordering with it.
Any suggestions?
|
Running Python command-line utility from Java
| 3,824,363 | 0 | 3 | 2,293 | 0 |
java,python,scripting
|
Have you considered jython? You can:
1) use it to run python scripts (allowing it to call Java classes)
2) compile python into class files, making them usable by normal Java code without jython being present at runtime
I've only used it in the first pattern, but I've seen tonnes of docs on the second.
| 0 | 1 | 0 | 0 |
2010-09-29T17:26:00.000
| 3 | 0 | false | 3,824,249 | 0 | 0 | 1 | 1 |
I developed a command-line utility which needs to be called from a Java GUI application. The team in charge on the Java GUI would like to bind my command-line application to a button in the GUI; the Python application is such that at the time we have no time or interest in rewriting it in Java.
I have no experience whatsoever in Java, so I ask you:
What is the best way to bind a command-line based Python application to a button in a Java-based GUI application?
I am very concerned about exception management (how to tell Java that Python failed).
Thanks.
|
How do I write to the apache log files when using mod_wsgi
| 3,825,257 | 13 | 12 | 3,241 | 0 |
python,apache,logging,mod-wsgi
|
Mostly, we use logging and write to sys.stderr. That seems to write to the Apache error_log.
| 0 | 0 | 0 | 0 |
2010-09-29T18:59:00.000
| 1 | 1.2 | true | 3,824,923 | 0 | 0 | 1 | 1 |
I have a Django project where I have been logging to a file using the standard library logging module. For a variety of reasons I would like to change it so that it writes to the Apache log files. I've seen quite a bit of discussion of how to do this with mod_python, but not mod_wsgi. How do I do this for a project running under mod_wsgi?
|
Android.mk debug output
| 9,443,567 | 2 | 3 | 4,399 | 0 |
python,android,debugging,build,trace
|
I've just experienced an odd effect of using $(info) when compiling a java+C++ Android application:
I used $info) to output some informations about conditional compiling in the Android.mk of the main application and when trying to debug the native part of the program, using ndk-gdb, it failed because apparently the output of $(info) is read by the ndk-gdb script (using the get_build_var() and get_build_var_for_abi() functions).
THe result is that the ndk-gdb script is not executed properly.
| 0 | 0 | 0 | 1 |
2010-09-29T23:23:00.000
| 2 | 0.197375 | false | 3,826,604 | 0 | 0 | 1 | 1 |
I am building Froyo, is it possible that during building, make/python can output the file and the command it is calling right now.
For example, in one of the Android.mk, there is a line, says,
echo build success.
On the monitor it will show "build success",
what I want is that in addition, it shows
"Android.mk line 20: echo build success".
Is it possible?
|
Problem with web code generator designer
| 3,829,743 | 0 | 1 | 82 | 0 |
python,code-generation,web-crawler,robot
|
You need to separate out the idea of what code to generate from the events triggering generation.
What code is generated is governed by the combined set of all the checkboxes that are checked.
Triggering code generation occurs each time any of them are changed. You need to regenerate everything at that time.
In detail:
Check box 1 -- triggers generation, just code for snippet 1 included
Check box 2 -- triggers generation, code for snippets 1 & 2 included
Check box 3 -- triggers generation, code for snippets 1, 2 & 3 included
Uncheck box 2 -- triggers generation, code for snippets 1 & 3 included
| 0 | 0 | 0 | 0 |
2010-09-30T09:40:00.000
| 1 | 1.2 | true | 3,829,405 | 0 | 0 | 1 | 1 |
I want to write a web-based code generator for a Python crawler. Its aim is to automatically generate code so a developer doesn't need to write it, but I've run into this problem: in one of my project's webpages, there are some checkboxes, buttons, etc. Each of them generates some Python code and writes it to a common textarea. However, when I uncheck boxes I can't figure out how to remove the corresponding code from the textarea, because it's all been mixed together. For example:
Check box 1 -- it writes code snippet 1 to the textarea
Check box 2 -- it writes code snippet 2 to the textarea
Check box 3 -- it writes code snippet 3 to the textarea
Uncheck box 2 -- it needs to somehow remove code snippet 2 from the text area, but leave behind code snippets 1 and 3
Is there some way to fix this problem, or any better solution for the whole code generator project?
|
ensuring dynamic image urls in a web-app: use a blob store?
| 3,831,317 | 1 | 0 | 291 | 0 |
python,sqlite,web-applications,nginx,blob
|
Why so complicated?
Serve the image under the name which the user supplied (i.e. http://www.mywebapp.com/images/foo1.jpg)
Save the images in a directory using a UUID as name.
Create a map of file names to UUIDs in the session.
In the handler for /images/ look up the real file name in the map. Return 404 if no such entry exists. Otherwise serve the image.
When the session is closed, delete all files from the map.
In a cron job, delete all images that are older than one day.
This way, several users can upload the same image (same name), images get deleted as soon as possible or by the cron job (if the server crashes or something like that).
| 0 | 1 | 0 | 0 |
2010-09-30T11:59:00.000
| 3 | 1.2 | true | 3,830,294 | 0 | 0 | 1 | 2 |
I want to serve images in a web-app using sessions such that the links to the images expire once the session has expired.
If I show the actual links to the filesystem store of the images, say http://www.mywebapp.com/images/foo1.jpg this clearly makes stopping future requests for the image (one the user has signed out of the session) difficult to stop. Which is why I was considering placing the images in a sqlite db, and serving them from there.
It seems that using the db for image storage is considered bad practice (though apparently the GAE blob store seems to provide this functionality), so i was trying to figure out what the alternatives would be.
1)
Perhaps I do somesort of url-re-writing like so:
http://www.mywebapp.com/images/[session_id]/foo1.jpg
Thinking of using nginx, but it seems (on a first look) that this will require some hackin to accomplish?
2)
Copy the files to a physical directory on the filesystem and delete when the session expires. this seems quite messy though?
Are there any standard methods of accomplishing this dynamic image url thing?
I'm using web.py - if that helps.
Many thanks!
|
ensuring dynamic image urls in a web-app: use a blob store?
| 3,830,345 | -1 | 0 | 291 | 0 |
python,sqlite,web-applications,nginx,blob
|
A combination of your two ideas (copy to a dir, expire when session expires) could be generalized to creating a new dir (could be as simple as a symlink) every 15 minutes. When generating the new symlink, also remove the one that's an hour old by now. Always link to the newest name in your code.
| 0 | 1 | 0 | 0 |
2010-09-30T11:59:00.000
| 3 | -0.066568 | false | 3,830,294 | 0 | 0 | 1 | 2 |
I want to serve images in a web-app using sessions such that the links to the images expire once the session has expired.
If I show the actual links to the filesystem store of the images, say http://www.mywebapp.com/images/foo1.jpg this clearly makes stopping future requests for the image (one the user has signed out of the session) difficult to stop. Which is why I was considering placing the images in a sqlite db, and serving them from there.
It seems that using the db for image storage is considered bad practice (though apparently the GAE blob store seems to provide this functionality), so i was trying to figure out what the alternatives would be.
1)
Perhaps I do somesort of url-re-writing like so:
http://www.mywebapp.com/images/[session_id]/foo1.jpg
Thinking of using nginx, but it seems (on a first look) that this will require some hackin to accomplish?
2)
Copy the files to a physical directory on the filesystem and delete when the session expires. this seems quite messy though?
Are there any standard methods of accomplishing this dynamic image url thing?
I'm using web.py - if that helps.
Many thanks!
|
how to write a desktop application which uses HTML and CSS for user interface and python/perl/c++/java for the processing?
| 3,839,449 | 0 | 11 | 4,636 | 0 |
javascript,python,html,css,user-interface
|
update: This is an old answer, nowadays you want to go with an embedded browser in your app (*webkit projects etc.), but at the time of writing, no such technology existed. The answer is still valid if you don't want to add quite a few megabytes to your packaged app though.
Find a lightweight server, or better - embed one in Your application. That's it.
Java has classes for serving http. Python does it well also.
See how mercurial's hg serve works. [python]
I once did a tiny app that served aspell spellcheck via http on localhost in java with the httprequest class. [worked on win and linux]
Create Your application as a server that outputs some html and uses POST to do actions. Do the interface thing in HTML+CSS+JS. Nice and easy.
After running point the user to localhost:somesillyport or trigger opening localhost:somesillyport in a browser.
| 0 | 0 | 0 | 0 |
2010-10-01T12:41:00.000
| 10 | 1.2 | true | 3,839,216 | 0 | 0 | 1 | 1 |
Different languages have different GUI toolkits, but it looks very difficult to achieve attractive user interfaces as good as we can using HTML and CSS with less effort.
I don't do my application in javascript as I doubt if it has all the required libraries and I want to do it in python.
How do I use rendering engines like gecko, webkit etc in python? Which one will be more suited to work with python?.Is there any 'only html/css' rendering engine without javascript?
Will it be easy to write event handlers for DOM events and manipulate DOM in python?
|
Trouble importing BeautifulSoup in python
| 3,840,201 | 2 | 0 | 1,900 | 0 |
python,module,importerror
|
You might have more than one python version installed? Check the version you are running.
Also, I found using easy_install worked well for installing BeautifulSoup.
| 0 | 0 | 0 | 0 |
2010-10-01T14:37:00.000
| 1 | 1.2 | true | 3,840,177 | 0 | 0 | 1 | 1 |
I've unpacked BeautifulSoup into c:\python2.6\lib\site-packages, which is in sys.path, but when I enter import BeautifulSoup I get an import error saying no such module exists. Obviously I'm doing something stupid... what is it?
|
Starting a web app now which will use python that later this need to embed nicely into a Drupal site?
| 3,843,449 | 1 | 1 | 114 | 0 |
python,drupal
|
If you write API calls and utilize Drupal Services module, you can hook into just about anything and send/receive JSON/XML data.
| 0 | 0 | 0 | 0 |
2010-10-01T21:41:00.000
| 1 | 1.2 | true | 3,843,218 | 0 | 0 | 1 | 1 |
This week, I want to start a web mapping and data visualization site for my work.
Unfortunately, I just found out my work place will be using Drupal in a few months down the road. (Most of my web development experience is with App Engine.)
My problem is that I need to make sure my web application embeds nicely into the larger Drupal site that outside consultants plan to make.
I am most comfy with Python, and I was expecting to use the Python-Django combo instead. There are important python libraries and modules I must have that cant be found or re-written in PHP.
I was thinking I will avoid all django on the web pages so things dont get confusing when the Drupal switch is made.
I will have the javascript on the web page make calls to python on the server which then spits out JSON data, and I think this will stay the same even after the Drupal switch.
Does this make sense?
Any general or specific suggestions that may guide me are greatly appreciated!
|
Google App Engine or Django?
| 13,424,917 | 0 | 13 | 5,657 | 0 |
python,django,google-app-engine
|
If you plan to use Django on app engine, then chances are you will want to use Djangos ORM. Which means.. you will probably be looking at Django non-rel. However there are a few things to consider:
Django non-rel runs a few versions behind the latest django release, so some modern features (such as advanced timezone support) are not supported, as of the moment, you will just have to wait.
Django non-rel does not support some features such as Django's transactions API and none of the native app engine transaction modules work ether.
so all in all, fine for a small simple projects, but when things get more complicated, django non-rel falls short.
| 0 | 1 | 0 | 0 |
2010-10-02T19:29:00.000
| 4 | 0 | false | 3,847,202 | 0 | 0 | 1 | 2 |
I've been learning Python and now I'd like to learn a Python-based web framework. I'm considering Google App Engine and Django. Which one should I choose? What are their unique features and learning curves?
|
Google App Engine or Django?
| 14,967,904 | 1 | 13 | 5,657 | 0 |
python,django,google-app-engine
|
I believe that Django is better because it gives more flexibility with features and also with hosts. Djangobook.com has a very good tutorial.
| 0 | 1 | 0 | 0 |
2010-10-02T19:29:00.000
| 4 | 0.049958 | false | 3,847,202 | 0 | 0 | 1 | 2 |
I've been learning Python and now I'd like to learn a Python-based web framework. I'm considering Google App Engine and Django. Which one should I choose? What are their unique features and learning curves?
|
Deciding on RESTful Architecture for my Python code API
| 3,881,996 | 0 | 1 | 643 | 0 |
java,python,rest
|
Hmm, if you're into Python and open to a Java element, you might want to consider using the Java framework Restlet with Python code running in Jython. I'm a big fan of Restlet; its API embodies RESTful principles, so it encourages one to structure one's code and thinking according to those principles. It's also just a really high-quality, easy to use, well supported, and lightweight -- it's a framework, but in practice it can feel like a library.
If you want to stick with pure Python, then I haven't been able to find any libraries or frameworks which directly embrace and encourage RESTful principles. However, there are some very good WSGI microframeworks which make it easy to implement RESTful applications -- you just need to devise your own approach to structuring your code -- not too big a deal. In particular I'd recommend Bottle and web.py, both of which can be used with more or less finagling with the excellent mimerender library for solid content negotiation.
| 0 | 1 | 0 | 0 |
2010-10-02T22:41:00.000
| 1 | 0 | false | 3,847,803 | 0 | 0 | 1 | 1 |
I would like to build something like this
Datastore | mycode.py | RESTful API | mywebapp.py(Django or Tornado)
I checked Piston for Django but it seems that this way I am going to be tied to Django, I would rather have a RESTful API for mycode.py that is consumable by more than one REST client and also can consume it from a REST client api inside my django app.
I checked stuff like Apache CFX, ApacheMQ, RabbitMQ, etc. with no real luck.
Any thoughts? thnx
|
Confusion about django app's name
| 3,848,525 | 0 | 1 | 5,314 | 0 |
python,django
|
When you deploy and app as a standalone package, it is just another Python package, which happens to implement Django views, templates, template tags, etc. Therefore, Django's search path is the Python search path itself. This is why people say "Just make sure the package structure is correct and django can run without problems."
Obviously, if the package name conflicts with someone else's package, you are going to get problems...
| 0 | 0 | 0 | 0 |
2010-10-03T03:45:00.000
| 4 | 0 | false | 3,848,490 | 0 | 0 | 1 | 4 |
I learned Django following django book and the document. In the django book exmaple, the project is called mysite and there's an app called book inside this project. So in this case, the app is called "book". I've no problem with it.
My confusion arises in front of reusable apps. Reusable apps usually reside outside the project. For example, django-registration only has an independent folder "registration". So what's its app name? "Registration", right?
If that's the case, isn't there some inconsistency regarding the app naming? In the first case, app name seems to be a folder name (or sub package name) under the project while in the 2nd case, the app name is the top package name.
I know most of you will say "Why are you obssessed with app name? Just make sure the package structure is correct and django can run without problems." Yes, in most case, app name is nothing but a name. Except in one occasion: specify AUTH_PROFILE_MODULE. As the document explains,
To indicate that this model is the
user profile model for a given site,
fill in the setting
AUTH_PROFILE_MODULE with a string
consisting of the following items,
separated by a dot:
The name of the application (case
sensitive) in which the user profile
model is defined (in other words, the
name which was passed to manage.py
startapp to create the application).
The name of the model (not case
sensitive) class.
If I have a model as a user profile in a resuable package, I have to know the app name to correctly specify AUTH_PROFILE_MODULE.
Does django use certain path searching order to decide the app name?
|
Confusion about django app's name
| 3,848,861 | 2 | 1 | 5,314 | 0 |
python,django
|
The name of the app is the name of the directory, capitalization and all, unless you go to the extra work to change the name in the appropriate __init__.py file. Django apps are, after all, just Python modules, and all the same rules apply.
If you ever see an app or module name with different capitalization or other modifications, that doesn't reflect the actual app or module name. Instead, what you're seeing is the result of some "pretty-printing" that the Django admin app is known to do in some cases. This is for display only.
| 0 | 0 | 0 | 0 |
2010-10-03T03:45:00.000
| 4 | 1.2 | true | 3,848,490 | 0 | 0 | 1 | 4 |
I learned Django following django book and the document. In the django book exmaple, the project is called mysite and there's an app called book inside this project. So in this case, the app is called "book". I've no problem with it.
My confusion arises in front of reusable apps. Reusable apps usually reside outside the project. For example, django-registration only has an independent folder "registration". So what's its app name? "Registration", right?
If that's the case, isn't there some inconsistency regarding the app naming? In the first case, app name seems to be a folder name (or sub package name) under the project while in the 2nd case, the app name is the top package name.
I know most of you will say "Why are you obssessed with app name? Just make sure the package structure is correct and django can run without problems." Yes, in most case, app name is nothing but a name. Except in one occasion: specify AUTH_PROFILE_MODULE. As the document explains,
To indicate that this model is the
user profile model for a given site,
fill in the setting
AUTH_PROFILE_MODULE with a string
consisting of the following items,
separated by a dot:
The name of the application (case
sensitive) in which the user profile
model is defined (in other words, the
name which was passed to manage.py
startapp to create the application).
The name of the model (not case
sensitive) class.
If I have a model as a user profile in a resuable package, I have to know the app name to correctly specify AUTH_PROFILE_MODULE.
Does django use certain path searching order to decide the app name?
|
Confusion about django app's name
| 3,848,948 | 0 | 1 | 5,314 | 0 |
python,django
|
An app name is just the name of the Python module. Nothing more.
A python module name is the case name of the root folder of the module, that must contains an init.py file.
If you want to know what this name is, go to your site-packages folder and look for your module.
| 0 | 0 | 0 | 0 |
2010-10-03T03:45:00.000
| 4 | 0 | false | 3,848,490 | 0 | 0 | 1 | 4 |
I learned Django following django book and the document. In the django book exmaple, the project is called mysite and there's an app called book inside this project. So in this case, the app is called "book". I've no problem with it.
My confusion arises in front of reusable apps. Reusable apps usually reside outside the project. For example, django-registration only has an independent folder "registration". So what's its app name? "Registration", right?
If that's the case, isn't there some inconsistency regarding the app naming? In the first case, app name seems to be a folder name (or sub package name) under the project while in the 2nd case, the app name is the top package name.
I know most of you will say "Why are you obssessed with app name? Just make sure the package structure is correct and django can run without problems." Yes, in most case, app name is nothing but a name. Except in one occasion: specify AUTH_PROFILE_MODULE. As the document explains,
To indicate that this model is the
user profile model for a given site,
fill in the setting
AUTH_PROFILE_MODULE with a string
consisting of the following items,
separated by a dot:
The name of the application (case
sensitive) in which the user profile
model is defined (in other words, the
name which was passed to manage.py
startapp to create the application).
The name of the model (not case
sensitive) class.
If I have a model as a user profile in a resuable package, I have to know the app name to correctly specify AUTH_PROFILE_MODULE.
Does django use certain path searching order to decide the app name?
|
Confusion about django app's name
| 3,848,893 | 1 | 1 | 5,314 | 0 |
python,django
|
My confusion arises in front of reusable apps. Reusable apps usually reside outside the project. For example, django-registration only has an independent folder "registration". So what's its app name? "Registration", right?
django-registration is the project name. The application name is registration:
in application list you are using the application name only: registration
in other places you will use import registration
If that's the case, isn't there some inconsistency regarding the app naming? In the first case, app name seems to be a folder name (or sub package name) under the project while in the 2nd case, the app name is the top package name.
Think of the project as a simple collection of applications: you could store the apps as subfolders, or place them in a separate folder (that must be included in PYTHONPATH). In both cases the application name is the same.
Update
manage.py adds to the PYTHONPATH both the current folder (so you could use import app.module) and the parent folder (so you can use project.settings and project.urls).
So, if you can configure Pydev to add the project folder to the PYTHONPATH, then you could import the apps as app.module, independent of the project name.
| 0 | 0 | 0 | 0 |
2010-10-03T03:45:00.000
| 4 | 0.049958 | false | 3,848,490 | 0 | 0 | 1 | 4 |
I learned Django following django book and the document. In the django book exmaple, the project is called mysite and there's an app called book inside this project. So in this case, the app is called "book". I've no problem with it.
My confusion arises in front of reusable apps. Reusable apps usually reside outside the project. For example, django-registration only has an independent folder "registration". So what's its app name? "Registration", right?
If that's the case, isn't there some inconsistency regarding the app naming? In the first case, app name seems to be a folder name (or sub package name) under the project while in the 2nd case, the app name is the top package name.
I know most of you will say "Why are you obssessed with app name? Just make sure the package structure is correct and django can run without problems." Yes, in most case, app name is nothing but a name. Except in one occasion: specify AUTH_PROFILE_MODULE. As the document explains,
To indicate that this model is the
user profile model for a given site,
fill in the setting
AUTH_PROFILE_MODULE with a string
consisting of the following items,
separated by a dot:
The name of the application (case
sensitive) in which the user profile
model is defined (in other words, the
name which was passed to manage.py
startapp to create the application).
The name of the model (not case
sensitive) class.
If I have a model as a user profile in a resuable package, I have to know the app name to correctly specify AUTH_PROFILE_MODULE.
Does django use certain path searching order to decide the app name?
|
Retrieving YAML parameters during runtime in App Engine (Python)
| 3,849,039 | 5 | 3 | 1,038 | 0 |
python,google-app-engine,runtime,yaml
|
No, but some of the data is available from os.environ - for example, os.environ['APPLICATION_ID'], and os.environ['CURRENT_VERSION_ID'].
| 0 | 1 | 0 | 0 |
2010-10-03T05:05:00.000
| 3 | 1.2 | true | 3,848,671 | 0 | 0 | 1 | 1 |
Is it possible to programmatically retrieve any of the YAML parameters during run-time? Are they stored in the environment somewhere?
Good example would be to automatically find the application version and to add it as a comment in the landing HTML page.
|
How to access lowlevel API for storing data in Google App Engine for python
| 3,857,498 | 6 | 3 | 304 | 0 |
python,google-app-engine,google-cloud-datastore
|
The 'low level' API is in google.appengine.api.datastore. There's no public documentation for it, but the module itself has fairly complete docstrings.
| 0 | 0 | 0 | 0 |
2010-10-04T16:22:00.000
| 2 | 1 | false | 3,857,140 | 0 | 0 | 1 | 1 |
What is the alternative for Entity.java in python version?
I do not want any data model. I want my entities without a predefined structure. I just want them to be key and value pairs as the above Entity.java is.
Can I do it in Python version?
|
django.contrib.admin like application for cherrypy
| 3,898,465 | 3 | 2 | 570 | 0 |
python,django,cherrypy
|
Django admin is much more, but is bound to Models. Without them, You will not gain much and as there is no such concept in CherryPy, I doubt there is similar application.
However, Django admin is phpmyadmin for masses exploited. Don't be constrained by it and create much more usable admin apps, leveraging CherryPy simplicity ^_^
| 0 | 0 | 0 | 0 |
2010-10-05T05:23:00.000
| 2 | 0.291313 | false | 3,861,027 | 0 | 0 | 1 | 1 |
Is there a django.contrib.admin like app / module for cherrypy?
I really like the simplicity of cherrypy, but it would be nice, to have the user authentication and password management type things taken care of...
Or is it possible to run a cherrypy application behind the django admin app ?
|
Which language to use for writing an admin console à la webmin?
| 3,868,363 | 2 | 0 | 155 | 0 |
python,ruby,migration,administration
|
Have you considered writing your applications as Webmin modules?
You get a lot of stuff for free when you do so (users and groups, tons of security features, a pretty big variety of helper functions related to config files, and tons of existing code for most aspects of a UNIX/Linux system). You also get a lot of stuff for nearly free, like action logging, packages and updates via wbm or apt or yum, an online help system, etc.
There are some cons, as well. It's an old codebase, so it has some clunky bits in the API among other places. A lot of the old modules can be a bit hard to grok if you're not an old-school Perl programmer. But, it's a well-maintained codebase, and it's been banged on by millions of users for over a dozen years. It's pretty robust. The UI isn't beautiful, but it is relatively theme-able, and if you're distributing a minimized version it becomes easier to customize the UI.
I suspect you can be up and running a lot faster than starting from scratch or using most existing frameworks that aren't targeted specifically to building systems management interfaces the way Webmin is.
Also, it's BSD licensed, so you can do whatever you want with it, including building a custom commercial app with it (hundreds of companies have done so over the years).
| 0 | 0 | 0 | 1 |
2010-10-05T05:43:00.000
| 4 | 0.099668 | false | 3,861,102 | 0 | 0 | 1 | 3 |
We have an in house developed web-based admin console that uses a combination of C CGI and Perl scripts to administer our mail server stack. Of late we have been thinking of cleaning up the code (well, replacing most of it), making the implementation more secure, and improving the overall behavior.
I don't have much programming knowledge, but I use Ruby on and off (mainly for writing erb templates), and hence was thinking of using ruby/rails for developing such an app (off-duty for now, I also need to learn stuff !).
Before blindly picking up a language though, what would you folks suggest ? Please let me know if this is too vague a question, I'll try to supply more information, if needed.
|
Which language to use for writing an admin console à la webmin?
| 3,897,721 | 0 | 0 | 155 | 0 |
python,ruby,migration,administration
|
django has a nice admin interface
| 0 | 0 | 0 | 1 |
2010-10-05T05:43:00.000
| 4 | 0 | false | 3,861,102 | 0 | 0 | 1 | 3 |
We have an in house developed web-based admin console that uses a combination of C CGI and Perl scripts to administer our mail server stack. Of late we have been thinking of cleaning up the code (well, replacing most of it), making the implementation more secure, and improving the overall behavior.
I don't have much programming knowledge, but I use Ruby on and off (mainly for writing erb templates), and hence was thinking of using ruby/rails for developing such an app (off-duty for now, I also need to learn stuff !).
Before blindly picking up a language though, what would you folks suggest ? Please let me know if this is too vague a question, I'll try to supply more information, if needed.
|
Which language to use for writing an admin console à la webmin?
| 3,861,123 | 0 | 0 | 155 | 0 |
python,ruby,migration,administration
|
If you already know a bit of ruby, then there's no reason not to use that.
If you're interested specifically in learning another language, then what you're trying to do could be done in pretty much any language/framework, it's just a matter of which one you want to learn.
| 0 | 0 | 0 | 1 |
2010-10-05T05:43:00.000
| 4 | 1.2 | true | 3,861,102 | 0 | 0 | 1 | 3 |
We have an in house developed web-based admin console that uses a combination of C CGI and Perl scripts to administer our mail server stack. Of late we have been thinking of cleaning up the code (well, replacing most of it), making the implementation more secure, and improving the overall behavior.
I don't have much programming knowledge, but I use Ruby on and off (mainly for writing erb templates), and hence was thinking of using ruby/rails for developing such an app (off-duty for now, I also need to learn stuff !).
Before blindly picking up a language though, what would you folks suggest ? Please let me know if this is too vague a question, I'll try to supply more information, if needed.
|
send commands to a backgrounded jobs stdin
| 3,862,362 | 0 | 0 | 157 | 0 |
php,python
|
You could connect its stdin to a FIFO and then have another daemon also connect to the FIFO and send commands. It might be better to have the control daemon start the Java daemon though, so that the Java daemon doesn't shut down if the control daemon does for some reason.
| 0 | 1 | 0 | 0 |
2010-10-05T09:20:00.000
| 3 | 0 | false | 3,862,332 | 0 | 0 | 1 | 1 |
I have a java server application that, when its running, you can interact with it sending commands via stdin. I want to write a web interface that can send these commands to it.
In order to do that I need some way of getting commands from php to the stdin for this backgrounded job. Is there a way to do this from console? or possibly write some kind of wrapper that controls the server job and can access its stdin ? could this be done in python?
|
Agnostic automated deployment
| 3,864,388 | 1 | 3 | 520 | 0 |
java,python,ruby,deployment
|
We use Ant or Maven for different projects we have in house (depending on the need and how old the project is too...). We tend to use Jenkins (formerly known as Hudson) as our build and deployment tool.
And then we encourage developers to write code that does not hard code to DB's, URL's, etc. We try to abstract via the container (ie, Data Sources, pure JMS API's, etc) when running within an app server. And we tend to abstract environment specifics via properties files that we look up at runtime. The path to the properties file is to be defined as a variable on the server. This way we can be flexible enough to build code once and move it through to all our environments.
| 0 | 1 | 0 | 0 |
2010-10-05T13:47:00.000
| 8 | 0.024995 | false | 3,864,223 | 0 | 0 | 1 | 8 |
What do you use to automatically deploy applications for various kinds of server applications (web, socket, daemon) that uses various technologies (different DBs, languages, etc)?
Here we use Python, Java and Ruby, and may use other languages as well in the future.
Update: I ended up using Puppet to manage all server setup, configs AND deploy. To trigger the deploy of newer versions I ended up using Python Fabric scripts.
|
Agnostic automated deployment
| 3,864,349 | 1 | 3 | 520 | 0 |
java,python,ruby,deployment
|
you can use maven, ant, ivy along with hudson for java projects.
| 0 | 1 | 0 | 0 |
2010-10-05T13:47:00.000
| 8 | 0.024995 | false | 3,864,223 | 0 | 0 | 1 | 8 |
What do you use to automatically deploy applications for various kinds of server applications (web, socket, daemon) that uses various technologies (different DBs, languages, etc)?
Here we use Python, Java and Ruby, and may use other languages as well in the future.
Update: I ended up using Puppet to manage all server setup, configs AND deploy. To trigger the deploy of newer versions I ended up using Python Fabric scripts.
|
Agnostic automated deployment
| 3,864,310 | 1 | 3 | 520 | 0 |
java,python,ruby,deployment
|
I think the best choice you could do is using maven. Even if maven is mostly used for Java projects, you can with the right plugins (or the one you write) deploy anything anywhere.
| 0 | 1 | 0 | 0 |
2010-10-05T13:47:00.000
| 8 | 0.024995 | false | 3,864,223 | 0 | 0 | 1 | 8 |
What do you use to automatically deploy applications for various kinds of server applications (web, socket, daemon) that uses various technologies (different DBs, languages, etc)?
Here we use Python, Java and Ruby, and may use other languages as well in the future.
Update: I ended up using Puppet to manage all server setup, configs AND deploy. To trigger the deploy of newer versions I ended up using Python Fabric scripts.
|
Agnostic automated deployment
| 3,864,298 | 1 | 3 | 520 | 0 |
java,python,ruby,deployment
|
For Python you could use Fabric or Paver
For Ruby, there's capistrano and 'vlad the deployer'
For Java, it's the Ant.
For PHP/Python projects I also use Peritor Webistrano, a neat frontend for capistrano. It involves changing a few of the default recipes to remove the rails-specific stuff, but it's worth it once you get it setup correctly.
| 0 | 1 | 0 | 0 |
2010-10-05T13:47:00.000
| 8 | 0.024995 | false | 3,864,223 | 0 | 0 | 1 | 8 |
What do you use to automatically deploy applications for various kinds of server applications (web, socket, daemon) that uses various technologies (different DBs, languages, etc)?
Here we use Python, Java and Ruby, and may use other languages as well in the future.
Update: I ended up using Puppet to manage all server setup, configs AND deploy. To trigger the deploy of newer versions I ended up using Python Fabric scripts.
|
Agnostic automated deployment
| 3,864,289 | 3 | 3 | 520 | 0 |
java,python,ruby,deployment
|
I use Puppet for some of the deployements / initial configuration of server. Maven and Ant for Java based projects.
| 0 | 1 | 0 | 0 |
2010-10-05T13:47:00.000
| 8 | 1.2 | true | 3,864,223 | 0 | 0 | 1 | 8 |
What do you use to automatically deploy applications for various kinds of server applications (web, socket, daemon) that uses various technologies (different DBs, languages, etc)?
Here we use Python, Java and Ruby, and may use other languages as well in the future.
Update: I ended up using Puppet to manage all server setup, configs AND deploy. To trigger the deploy of newer versions I ended up using Python Fabric scripts.
|
Agnostic automated deployment
| 6,336,041 | 2 | 3 | 520 | 0 |
java,python,ruby,deployment
|
Go for KWateeSDCM. It comes with a straightforward web GUI and does not require obscure scripting and integrates nicely with your build chain via a REST API.
| 0 | 1 | 0 | 0 |
2010-10-05T13:47:00.000
| 8 | 0.049958 | false | 3,864,223 | 0 | 0 | 1 | 8 |
What do you use to automatically deploy applications for various kinds of server applications (web, socket, daemon) that uses various technologies (different DBs, languages, etc)?
Here we use Python, Java and Ruby, and may use other languages as well in the future.
Update: I ended up using Puppet to manage all server setup, configs AND deploy. To trigger the deploy of newer versions I ended up using Python Fabric scripts.
|
Agnostic automated deployment
| 3,864,283 | 1 | 3 | 520 | 0 |
java,python,ruby,deployment
|
We use Maven and pull out to the ant-plugin when required. In turn the ant-plugin very occasionally calls out to some native scripting language/application/packager/whatever but we're finding that over time we can generally find a Maven or ANT plugin/task to do the trick.
You might want to look up Continuous Deployment, it's a pretty hot topic in the build and CI space right now.
| 0 | 1 | 0 | 0 |
2010-10-05T13:47:00.000
| 8 | 0.024995 | false | 3,864,223 | 0 | 0 | 1 | 8 |
What do you use to automatically deploy applications for various kinds of server applications (web, socket, daemon) that uses various technologies (different DBs, languages, etc)?
Here we use Python, Java and Ruby, and may use other languages as well in the future.
Update: I ended up using Puppet to manage all server setup, configs AND deploy. To trigger the deploy of newer versions I ended up using Python Fabric scripts.
|
Agnostic automated deployment
| 3,864,269 | 2 | 3 | 520 | 0 |
java,python,ruby,deployment
|
You could use Ant, Makefile, or a batch script. Or a combination of them.
| 0 | 1 | 0 | 0 |
2010-10-05T13:47:00.000
| 8 | 0.049958 | false | 3,864,223 | 0 | 0 | 1 | 8 |
What do you use to automatically deploy applications for various kinds of server applications (web, socket, daemon) that uses various technologies (different DBs, languages, etc)?
Here we use Python, Java and Ruby, and may use other languages as well in the future.
Update: I ended up using Puppet to manage all server setup, configs AND deploy. To trigger the deploy of newer versions I ended up using Python Fabric scripts.
|
How do I replace the current working MySQL database with a .sql file?
| 3,868,544 | 1 | 0 | 182 | 1 |
python,mysql,django
|
You can't import sql dumps through django; import it through mysql directly, if you run mysql locally you can find various graphical mysql clients that can help you with doing so; if you need to do it remotely, find out if your server has any web interfaces for that installed!
| 0 | 0 | 0 | 0 |
2010-10-05T19:28:00.000
| 2 | 1.2 | true | 3,866,989 | 0 | 0 | 1 | 1 |
I'm trying to restore the current working database to the data stored in a .sql file from within Django. Whats the best way to do this? Does django have an good way to do this or do I need to grab the connection string from the settings.py file and send command line mysql commands to do this?
Thanks for your help.
|
Strip whitespace from Mako template output (Pylons)
| 3,868,737 | 0 | 7 | 4,817 | 0 |
python,html,pylons,mako
|
If your data are not too dynamic, you could store an optimised cache of the template output and serve this to web clients.
| 0 | 0 | 0 | 0 |
2010-10-06T00:24:00.000
| 5 | 0 | false | 3,868,722 | 0 | 0 | 1 | 1 |
I'm using Mako + Pylons and I've noticed a horrendous amount of whitespace in my HTML output.
How would I go about getting rid of it? Reddit manage to do it.
|
Pylons - Handling GET and POST requests
| 3,871,201 | 2 | 1 | 1,052 | 0 |
python,validation,pylons
|
Having it all in one method, and detecting if the form has been posted via a check on request.method. This works okay, but it seems clumsy to have if request.method == 'post': ... else: ...
I am not sure why you describe this as clumsy. Switching on request method is a valid idiom in the web app world across languages. For e.g. you'll find Django views having a single view that handles requests differently based on request.method. Similarly in Java, Servlets have doPost() and doGet() methods to provide different behavior for GET and POST requests.
Update
I'd just rather have them separated into different methods, if possible. Many other web frameworks do this
Nothing wrong with this approach either. I was merely pointing out that having the same method handle them is equally valid.
| 0 | 0 | 0 | 0 |
2010-10-06T09:32:00.000
| 1 | 1.2 | true | 3,871,145 | 0 | 0 | 1 | 1 |
What's the best way to handle form POST data in my Pylons app? I've tried:
Having a seperate GET method and a POST method with a rest.restrict('post') decorator. Problem -- if there were validation errors then you can't redisplay the form with the data which the user entered because you have to redirect back to the GET method OR you have to render the template directly from the POST method. Unfortunately this looks weird, as the URL has to change to correspond to the POST action.
Having it all in one method, and detecting if the form has been posted via a check on request.method. This works okay, but it seems clumsy to have if request.method == 'post': ... else: ...
|
Scrapy - how to identify already scraped urls
| 8,830,983 | 1 | 15 | 9,648 | 0 |
python,web-crawler,scrapy
|
I think jama22's answer is a little incomplete.
In the snippet if self.FILTER_VISITED in x.meta:, you can see that you require FILTER_VISITED in your Request instance in order for that request to be ignored. This is to ensure that you can differentiate between links that you want to traverse and move around and item links that well, you don't want to see again.
| 0 | 0 | 1 | 0 |
2010-10-06T10:38:00.000
| 5 | 0.039979 | false | 3,871,613 | 0 | 0 | 1 | 2 |
Im using scrapy to crawl a news website on a daily basis. How do i restrict scrapy from scraping already scraped URLs. Also is there any clear documentation or examples on SgmlLinkExtractor.
|
Scrapy - how to identify already scraped urls
| 13,578,588 | 1 | 15 | 9,648 | 0 |
python,web-crawler,scrapy
|
Scrapy can auto-filter urls which are scraped, isn't it? Some different urls point to the same page will not be filtered, such as "www.xxx.com/home/" and "www.xxx.com/home/index.html".
| 0 | 0 | 1 | 0 |
2010-10-06T10:38:00.000
| 5 | 0.039979 | false | 3,871,613 | 0 | 0 | 1 | 2 |
Im using scrapy to crawl a news website on a daily basis. How do i restrict scrapy from scraping already scraped URLs. Also is there any clear documentation or examples on SgmlLinkExtractor.
|
Caching external javascript for a QtWebkit widget in a PyQt app
| 3,886,529 | 0 | 1 | 1,071 | 0 |
javascript,python,pyqt,qtwebkit
|
Could you post some source code? Once downloaded that data will stay in the /tmp/ folder for some time. You could likely use the data in the temp folder, my guess is you are not enforcing that policy.
| 1 | 0 | 0 | 0 |
2010-10-06T11:41:00.000
| 2 | 0 | false | 3,872,033 | 0 | 0 | 1 | 1 |
I have a QWebView in my app which renders a html page stored in the app as a Qresource. This page, however requires meaty external Javascript libraries such as MathJax, which I would want to include as a resource due to its size.
My problem is that it seems that QtWebkit does not cache these files as a regular browser would do, and every time I refresh the widget it downloads MathJax afresh.
So my question is: is there any way to cache these libraries after first time they are downloaded, without having resorting to shipping it with the app as resource?
|
Can I change an an existing virtualenv to ignore global site packages? (like --no-site-package on a new one)
| 3,874,179 | 20 | 14 | 5,667 | 0 |
python,virtualenv
|
I think all you have to do is create an empty file called no-global-site-packages.txt and put it into the virtualenv's python2.x folder (eg, lib/python2.6/, the one with all the modules). Then the normal site.py generated by virtualenv detects the difference and handles everything from there.
| 0 | 0 | 0 | 0 |
2010-10-06T14:04:00.000
| 2 | 1 | false | 3,873,294 | 1 | 0 | 1 | 1 |
I can create a new virtualenv that ignores global site-packages with "--no-site-package". Is it possible to change an existing virtualenv (which was created without "--no-site-package") to also ignore the global site-packages? (So that it workes like it was created with "--no-site-package" in the first place.)
thanks in advance,
Sebastian
|
Javascript Execution Through Python
| 3,874,358 | 1 | 3 | 624 | 0 |
javascript,jquery,python,html,parsing
|
jQuery itself does not contain an HTML/XML parser at all. It uses the browser to do all its parsing. Thus, even if you figure out how to run Javascript from Python, it won't do you any good.
| 0 | 0 | 0 | 0 |
2010-10-06T15:41:00.000
| 4 | 0.049958 | false | 3,874,280 | 1 | 0 | 1 | 1 |
I am attempting to create an html document parser with Python. I am very familiar with jQuery and I would like to use its traversing functionality to parse these html files and return the data gathered with jQuery back to my Python program.
Is there any way to use javascript scripts through Python? Or is this just a pipe dream?
|
Developing with Django+Celery without running `celeryd`?
| 58,684,713 | 0 | 29 | 9,748 | 0 |
python,django,celery
|
After 5+ years of writing Celery tasks I have noticed a pattern I have developed that can help with testing and ease of development - I realised it is much better if my Celery tasks are thin wrappers around the regular Python functions that I typically put in myproject.impl package. Celery tasks may contain some strictly Celery related logic, like using distributed locking for an example, explicit retry logic, etc.
| 0 | 1 | 0 | 0 |
2010-10-06T15:54:00.000
| 4 | 0 | false | 3,874,422 | 0 | 0 | 1 | 1 |
In development, it's a bit of a hassle to run the celeryd as well as the Django development server. Is it possible to, for example, ask celery to run tasks synchronously during development? Or something similar?
|
Google App Engine (Python)- Strange behaviour of REMOTE_ADDR
| 3,877,766 | 0 | 0 | 438 | 0 |
python,google-app-engine,ip-address
|
I believe that I have figured out the reason for seeing so many warnings from google server IP addresses. It seems that immediately after a new user registers, the google crawlers are going to the same (registration) webpage (which I send information to as a GET instead of a POST for reasons which I will not get into). Of course, since many users are registering, but there are only a few crawler computers that are checking periodic updates to my website, I am triggering warning messages that a particular (google) IP is accessing a registration area repeatedly.
| 0 | 0 | 0 | 1 |
2010-10-06T23:28:00.000
| 1 | 1.2 | true | 3,877,631 | 0 | 0 | 1 | 1 |
In order to make the registration process on my website easy, I allow users to enter their email address which I will send a verification code to or alternatively they can solve a captcha.
The problem is that in order to prevent robots from registering accounts (with fake emails) I limit the number of registrations allowed per IP address and if this limit is exceeded I trigger a warning in the logs.
However ... what seems to be happening is that I am using os.environ['REMOTE_ADDR'] to check the remote address -- but it seems that I am triggering warnings on addresses that are owned by Google (66.249.65.XXX). It is possible that this is happening only after I change the version (but not confirmed). Does anyone know how/why this might be happening? Shouldn't the REMOTE_ADDR return the address of the client computer (and hopefully in all cases it would do this)?
I am curious if there is some behind the scenes re-directions going on, and if this is a normal event or if it only happens when a new version is installed (perhaps when a new version is installed the original server then proxies the user to the new server, therefore creating the illusion that the IP address is an internal IP?)
|
use sqlalchemy entity isolately
| 3,896,280 | 1 | 0 | 85 | 1 |
python,sqlalchemy,entity
|
You can expunge it from session before modifying object, then this changes won't be accounted on next commits unless you add the object back to session. Just call session.expunge(obj).
| 0 | 0 | 0 | 0 |
2010-10-07T11:56:00.000
| 1 | 1.2 | true | 3,881,364 | 0 | 0 | 1 | 1 |
i just want to use an entity modify it to show something,but don't want to change to the db,
but after i use it ,and in some other place do the session.commit()
it will add this entity to db,i don't want this happen,
any one could help me?
|
How google docs shows my .PPT files without using a flash viewer?
| 3,899,697 | 0 | 2 | 1,773 | 0 |
java,c++,python,powerpoint,google-docs
|
Now i found a solution to showing .ppt file on my website without using the flash
the solution is:
just convert the .ppt file to .pdf files using any language or using software(e.g. open office) and then use Imagemagick to convert that .pdf into image and show to your web page
once again thanks to you all for answering my question.
| 0 | 0 | 1 | 0 |
2010-10-07T13:45:00.000
| 3 | 1.2 | true | 3,882,249 | 0 | 0 | 1 | 1 |
I want to show .ppt (PowerPoint) files uploaded by my user on my website. I could do this by converting them into Flash files, then showing the Flash files on the web page. But I don't want to use Flash to do this. I want to show it, like google docs shows, without using Flash.
I've already solved the problem for .pdf files by converting them into images using ImageMagick, but now I have trouble with .ppt files.
|
Run Django on multiple ports
| 3,883,556 | 18 | 8 | 14,240 | 0 |
python,django
|
Just run two instances of ./manage.py runserver. You can set a port by simply specifying it directly: ./manage.py runserver 8002 to listen on port 8002.
Edit I don't really understand why you want to do this. If you want two servers serving different parts of your site, then you have in effect two sites, which will need two separate settings.py and urls.py files. You'd then run one instance of runserver with each, passing the settings flag appropriately: ./manage.py runserver 8002 --settings=app1.settings
| 0 | 0 | 0 | 0 |
2010-10-07T15:57:00.000
| 3 | 1.2 | true | 3,883,497 | 0 | 0 | 1 | 2 |
Could someone tell me how I can run Django on two ports simultaneously? The default Django configuration only listens on port 8000. I'd like to run another instance on port xxxx as well. I'd like to redirect all requests to this second port to a particular app in my Django application.
I need to accomplish this with the default Django installation and not by using a webserver like nginx, Apache, etc.
Thank you
Let's say I two applications in my Django application. Now i don't mean two separate Django applications but the separate folders inside the 'app' directory. Let's call this app1 and app2
I want all requests on port 8000 to go to app1 and all requests on port XXXX to go to app2
HTH.
|
Run Django on multiple ports
| 3,883,557 | 2 | 8 | 14,240 | 0 |
python,django
|
The built-in web-server is intended for development only, so you should really be using apache or similar in an situation where you need to run on multiple ports.
On the other hand you should be able to start up multiple servers just by starting multiple instances of runserver. As long as you are using a separate database server I don't think that will have any extra problems.
| 0 | 0 | 0 | 0 |
2010-10-07T15:57:00.000
| 3 | 0.132549 | false | 3,883,497 | 0 | 0 | 1 | 2 |
Could someone tell me how I can run Django on two ports simultaneously? The default Django configuration only listens on port 8000. I'd like to run another instance on port xxxx as well. I'd like to redirect all requests to this second port to a particular app in my Django application.
I need to accomplish this with the default Django installation and not by using a webserver like nginx, Apache, etc.
Thank you
Let's say I two applications in my Django application. Now i don't mean two separate Django applications but the separate folders inside the 'app' directory. Let's call this app1 and app2
I want all requests on port 8000 to go to app1 and all requests on port XXXX to go to app2
HTH.
|
django, python: reload function in shell
| 34,309,424 | 0 | 6 | 8,233 | 0 |
python,django,shell,ipython
|
The easiest solution I've found is combination of shell_plus and iPython which automatically reloads functions.
pip install ipython
pip install django-extensions
add 'django_extensions' to your INSTALLED_APPS
python manage.py shell_plus
| 0 | 0 | 0 | 0 |
2010-10-07T16:12:00.000
| 5 | 0 | false | 3,883,619 | 1 | 0 | 1 | 1 |
I work in the django IPython-shell, which can be started with manage.py shell.
When i load an extern function in the shell for testing, everything is alright. But when i make changes to the function, the shell still has the old version of the function. Even if i make a new import.
Does anyone know how to reload the actual version of the function?
Thanks in regards!
Edit: I use windows - if that makes a difference.
|
Letting users to choose what type of content they want to input
| 3,887,176 | 0 | 0 | 63 | 0 |
python,django-models,input,field
|
How about creating a separate model for each type of field you want to support, and then another model consisting of a list of (table_name, entry_id) pairs, which could be customized to use any combination of fields?
| 0 | 0 | 0 | 0 |
2010-10-08T01:09:00.000
| 1 | 0 | false | 3,887,017 | 0 | 0 | 1 | 1 |
This is my first post here, and I'd like to describe what I want to do as specific as possible.
I'd like to make a model that is 'selectable.'
for example,
class SimpleModel(models.Model):
property = models.CharField(max_length=255)
value = GeneralField()
GeneralField can be "CharField", "URLField", "TextField" so that user can select appropriate input type for specific property.
I'm kinda thinking of this similar to Wordpress's custom_field.
My initial thought is making TextField and tweak input interface depends on user's selection, but it's a bit tricky and if it involves file uploading functionality, it's gonna be complicated.
of course, I googled a lot. If you have any thoughts on this, please give me a tip :)
thanx in advance
|
What is the use of related fields in OpenERP?
| 10,221,855 | 1 | 10 | 11,804 | 0 |
python,openerp
|
related fields leads the control to another table the parent table wil have a onetomany relation with the child table and the child table have a manytoone relation towards the parent table.
eg: the account.invoice to account.invoice.line with the following field
'invoice_line': fields.one2many('account.invoice.line', 'invoice_id', 'Invoice Lines', readonly=True, states={'draft':[('readonly',False)]}),
and account.invoice.line relates to account.invoice with the following code in reverse.
'invoice_id': fields.many2one('account.invoice', 'Invoice Reference', ondelete='cascade', select=True),
| 0 | 0 | 0 | 0 |
2010-10-08T04:20:00.000
| 4 | 0.049958 | false | 3,887,675 | 0 | 0 | 1 | 1 |
Can someone explain to me something about related fields. For example -
How it was used
How it can be helped
For which kind of scenario I should use fields.related
If anybody can provide a small example for real use of fields.related I would appreciate it.
|
How can I get all the request headers in Django?
| 46,259,055 | 6 | 131 | 150,515 | 0 |
python,django,http-headers,httprequest
|
request.META.get('HTTP_AUTHORIZATION')
/python3.6/site-packages/rest_framework/authentication.py
you can get that from this file though...
| 0 | 0 | 0 | 0 |
2010-10-08T10:47:00.000
| 10 | 1 | false | 3,889,769 | 0 | 0 | 1 | 1 |
I need to get all the Django request headers. From what I've read, Django simply dumps everything into the request.META variable along with a lot of other data. What would be the best way to get all the headers that the client sent to my Django application?
I'm going use these to build a httplib request.
|
Python to javascript communication
| 3,890,407 | 7 | 1 | 1,908 | 0 |
javascript,python,sockets,encoding
|
JSON is definitely the way to go. It has a very small overhead and is capable of storing almost any kind of data. I am not a python expert, but i am sure that there is some kind of en/decoder available.
| 0 | 0 | 1 | 0 |
2010-10-08T12:22:00.000
| 2 | 1 | false | 3,890,390 | 1 | 0 | 1 | 1 |
OK so im using websockets to let javascript talk to python and that works very well BUT the data i need to send often has several parts like an array, (username,time,text) but how could i send it ? I originally though to encode each one in base64 or urlencode then use a character like | which those encoding methods will never use and then split the information. Unfortunately i cant find a method which both python and javascript can both do.
So the question, is there a encoding method which bath can do OR is there a different better way i can send the data because i havent really done anything like this before. (I have but AJAX requests and i send that data URL encoded). Also im not sending miles of text, about 100bytes at a time if that.
thankyou !
edit
Most comments point to JSON,so, Whats the best convert to use for javascript because javascript stupidly cant convert string to JSON,or the other way round.
Finished
Well jaascript does have a native way to convert javascript to string, its just hidden form the world. JSON.stringify(obj, [replacer], [space]) to convert it to a string and JSON.parse(string, [reviver]) to convert it back
|
Twisted Deferred.addCallBack() vs. yield and @inlineDeferred
| 8,505,450 | 0 | 11 | 5,275 | 0 |
python,twisted
|
use defer.inlineCallbacks can make your codes easiler to read..
and it somehow like corountine style: you neither block the call nor use chain of callbacks to build the whole logic. It is intuitive.
| 0 | 0 | 0 | 0 |
2010-10-08T21:00:00.000
| 3 | 0 | false | 3,894,278 | 0 | 0 | 1 | 2 |
Is there any reason to use one over the other?
Do they have the same performance?
|
Twisted Deferred.addCallBack() vs. yield and @inlineDeferred
| 3,894,412 | 2 | 11 | 5,275 | 0 |
python,twisted
|
The differences should really be subtle. If this code really does run that often that it matters, perhaps you should look into your application design. Otherwise, take the variant which is more easy to read, you will have to make heads and tails out of it a couple of months or years down the road.
EDIT: If you really want to know, here is how you find out (it could, after all, be implementation specific to your python version): run both version in a tight loop and measure the time. Increase loop count until the time difference between the versions is far greater than the time variance of the same version across multiple runs. Repeat after changing python version, OS etc.
| 0 | 0 | 0 | 0 |
2010-10-08T21:00:00.000
| 3 | 0.132549 | false | 3,894,278 | 0 | 0 | 1 | 2 |
Is there any reason to use one over the other?
Do they have the same performance?
|
Blender3d vs 3DS max; which one is better suited for automation in python?
| 3,896,157 | 4 | 2 | 1,647 | 0 |
python,blender,panda3d
|
From a python automation point of view, blender itself is written largely in python, and the source is available which allows a level of automation not possible if you can't change the source. To me, having the source available in that situation is more of a benefit than the price tag.
If you do go with blender, definitely grab the 2.5 beta. They made some huge UI and scripting improvements. In my opinion, most of the complaints about it being difficult to learn compared to commercial packages are no longer valid for 2.5, especially if you don't have the mental burden of already having learned another software's interface.
| 0 | 0 | 0 | 0 |
2010-10-09T15:11:00.000
| 2 | 1.2 | true | 3,896,087 | 0 | 0 | 1 | 1 |
I am getting started with the development of 3d environments for using in panda3d. As I am new to this, I need to choose a modelling software to create basic geometries, etc. Therefore, which one is better suited for automation through python? 3DS Max or Blender3D? I would like to automate generating basic geometries, the export process and some basic animations. Blender has the benefit of being free, but my office will provide me the licenses for 3DS if I request, so that is not a problem.
|
How to do cloud computing with Python and Java? Final Year project
| 3,896,820 | 0 | 1 | 2,332 | 0 |
python,django,cloud
|
If you're going to use a web framework on the server, it makes sense to use an HTTP-based protocol. The downside is that only the client can initiate a connection (e.g., the client needs to first ask for the "dump" file), but a simple GET request will suffice (remember, the server can send anything in the HTTP response, including your XML file).
Regarding encryption, it's best to use an existing protocol like HTTPS. There are well-vetted libraries that will correctly establish a secure connection between your client and the server.
Overall, I'm advocating the highest-level protocols that are appropriate for your application. HTTP(S) goes hand-in-hand with your web-based architecture, so make use of it.
| 0 | 0 | 0 | 0 |
2010-10-09T09:24:00.000
| 3 | 0 | false | 3,896,741 | 0 | 0 | 1 | 2 |
For my final year project I plan to code a cloud in Python. The client will be written in Java by the other member of my team. The client will have a tabbed interface and it will provide a text editor, a media player, a couple of small Java based games and a maybe a few more services.
The server will work like this:
1) Validate the user.
2) Send a file, called "dump" to the user. Dump will contain all the file names and file types that the user created by himself or the files which the user can read/write. This info will be fetched from the database.
3) The tabs in the client will display the file types associated with the tab application. e.g the media tab will only select and show the media files from the dump readable by user. The text editor tab will show only the txt files from the dump readable by the user.
4) A request to open the file will send the file back to client, which the associated application will open.
5) All the changes made to the files and all the actions (overwriting, saving, deleting etc.) will be sent back to the server along with the new object. Something similar will be done to the newly created objects.
My Questions are:
What are the best approaches for the communication between the client and the server. For the dump I plan to use some sort of encrypted XML file. For the other way round, I don't have a clue :/.
For easy integration with the database, I was planning to use Django (which I started few days back). How can I send my requests from the client to the server (without Django I'd use SQL queries) and the files from the server to the client? Maybe GET and POST will work for the former problem? Any other suggestions?
|
How to do cloud computing with Python and Java? Final Year project
| 3,896,834 | 0 | 1 | 2,332 | 0 |
python,django,cloud
|
Stick to Django. It's really productive. I would use JSON instead of XML. More convenient. import json. This should help you in communicating between client-server.
Also cloud computing is just a recent word that's just thrown around for (client+server+some services). Oh by the way all that you want to do can be completely done in Django itself. No need to go to JAVA.
Django is Cool :)
| 0 | 0 | 0 | 0 |
2010-10-09T09:24:00.000
| 3 | 0 | false | 3,896,741 | 0 | 0 | 1 | 2 |
For my final year project I plan to code a cloud in Python. The client will be written in Java by the other member of my team. The client will have a tabbed interface and it will provide a text editor, a media player, a couple of small Java based games and a maybe a few more services.
The server will work like this:
1) Validate the user.
2) Send a file, called "dump" to the user. Dump will contain all the file names and file types that the user created by himself or the files which the user can read/write. This info will be fetched from the database.
3) The tabs in the client will display the file types associated with the tab application. e.g the media tab will only select and show the media files from the dump readable by user. The text editor tab will show only the txt files from the dump readable by the user.
4) A request to open the file will send the file back to client, which the associated application will open.
5) All the changes made to the files and all the actions (overwriting, saving, deleting etc.) will be sent back to the server along with the new object. Something similar will be done to the newly created objects.
My Questions are:
What are the best approaches for the communication between the client and the server. For the dump I plan to use some sort of encrypted XML file. For the other way round, I don't have a clue :/.
For easy integration with the database, I was planning to use Django (which I started few days back). How can I send my requests from the client to the server (without Django I'd use SQL queries) and the files from the server to the client? Maybe GET and POST will work for the former problem? Any other suggestions?
|
URL rewriting question
| 3,898,807 | 0 | 0 | 762 | 0 |
python,apache
|
You'd need to show your apache configuration to say for certain, but it seems that Apache isn't actually using mod_cgi to serve the index.cgi script. In your configuration there should be something like 'LoadModule mod_cgi'. It should be uncommented (i.e., it shouldn't have a '#' at the beginning of the line).
If you want to test this, then write a 'Hello World' cgi script and put it (temporarily) in place of index.cgi and see if you can get that to run. Let us know the results.
| 0 | 1 | 0 | 1 |
2010-10-09T17:31:00.000
| 2 | 0 | false | 3,897,140 | 0 | 0 | 1 | 2 |
I have a CGI script (pwyky) that I called index.cgi, put in directory wiki/, and setup Apache to call localhost/wiki/index.cgi when I access localhost/wiki.
I'm getting errors when I'm trying to use this application -- it creates a page with links like "http://localhost/wiki/@edit/index", but when I click that link, Apace is trying to serve "wiki/@edit/index" as a file. I suspect that I need to get Apache to pass /@edit/index into index.cgi.
In particular, looking through index.cgi, its looking for strings like "@edit" in REQUEST_URI environment variable.
Any idea how to fix this?
|
URL rewriting question
| 3,908,016 | 0 | 0 | 762 | 0 |
python,apache
|
I found the problem, it turned out this is done through RewriteEngine. Pwyky puts .htaccess file in the directory with all the settings for RewriteEngine, but because AllowOverride is "None" by default on MacOS, they were ignored. The solution was to change all "AllowOverride" directives to "All"
| 0 | 1 | 0 | 1 |
2010-10-09T17:31:00.000
| 2 | 1.2 | true | 3,897,140 | 0 | 0 | 1 | 2 |
I have a CGI script (pwyky) that I called index.cgi, put in directory wiki/, and setup Apache to call localhost/wiki/index.cgi when I access localhost/wiki.
I'm getting errors when I'm trying to use this application -- it creates a page with links like "http://localhost/wiki/@edit/index", but when I click that link, Apace is trying to serve "wiki/@edit/index" as a file. I suspect that I need to get Apache to pass /@edit/index into index.cgi.
In particular, looking through index.cgi, its looking for strings like "@edit" in REQUEST_URI environment variable.
Any idea how to fix this?
|
Django Sphinx Text Search
| 4,121,651 | 1 | 0 | 395 | 1 |
python,django,search,full-text-search,django-sphinx
|
Here's a shot in the dark -
Try to get the name of your index in sphinx.conf same as the table_name you are trying to index. This is a quirk which is missed by lot of people.
| 0 | 0 | 0 | 0 |
2010-10-09T20:02:00.000
| 1 | 1.2 | true | 3,897,650 | 0 | 0 | 1 | 1 |
I am trying out Sphinx search in my Django project. All setup done & it works but need some clarification from someone who has actually used this setup.
In my Sphinx search while indexing, I have used 'name' as the field in my MySQL to be searchable & all other fields in sql_query to be as attributes (according to Sphinx lingo).
So when I search from my Model instance in Django, I get the search results alright but it does not have the 'name' field in the search results. I get all the other attributes.
However, I get the 'id' of the search term. Technically, I could get the 'name' by again querying MySQL but I want to avoid this. Is there anything I am not doing here?
|
Django - Form widget with a checkbox to choose between unlimited or a textbox for a number
| 3,910,066 | 1 | 2 | 734 | 0 |
python,django,django-forms
|
You can either make the form have an additional form field for the checkbox. And override it's save method to fill the model fields accordingly. Or you can make a custom form field widget that would hold both HTML input fields and produce the appropriate python value from the inputs and vice versa. The first option being the simpler to implement, and wiser if you need this functionality only in one form. Either way, I'd reconsider using a null value to mean anything except no value entered. You could make it so that the Integer field holds -1 to mean unlimited if all other user specified values can only be positive. Or add another boolean model field to hold the value for this checkbox.
| 0 | 0 | 0 | 0 |
2010-10-11T09:00:00.000
| 1 | 0.197375 | false | 3,904,809 | 0 | 0 | 1 | 1 |
I am making a form in Django. The field to display is a numeric field representing some limit. It's possible for there to be no limit. Rather than force the user to enter some strange number to mean unlimited (e.g. -1), I'd like there to be a radio button, with 2 options: "Unlimited" and the second option being a text box that the user can enter the value into.
The original model only has the IntegerField which can be null. A null value is used to mean unlimited. Is there some way I can make a FormField of this field that will include this checkbox functionality?
I know I can hand write the HTML myself, I'm wondering if there is a already made django field/widget that'll do this.
|
Twisted factory protocol instance based callback
| 3,906,174 | 1 | 0 | 499 | 0 |
python,twisted,factory
|
No. Write a class that does the interaction with one user. In connectionMade you check if a instance of this class already exists, if not you make a new one and store it on the factory, ie in a { addr : handler } dict. If the connection exists alreay you get the old handler from the factory.
| 0 | 1 | 0 | 0 |
2010-10-11T11:33:00.000
| 1 | 0.197375 | false | 3,905,791 | 0 | 0 | 1 | 1 |
Hey, I got a ReconnectingClientFactory and I wonder if I can somehow define protocol-instance-based connectionMade/connectionLost callbacks so that i can use the factory to connect to different hosts ans distinguish between each connection.
Thanks in advance.
|
Python hangs in futex calls
| 4,533,967 | 2 | 2 | 7,410 | 0 |
python,multithreading,debugging,deadlock,futex
|
Dear Helmut, I've the same problem with one thread hanging on FUTEXT_WAIT_PRIVATE.
It seems you have solved the issue. Can you share more information about the solution?
UPD:
The reason for the lock was finally found (at least for my case): it was due to import lock in Python.
Consider following situation:
file1.py:
import file2
file2.py:
create thread "thread2"
run "thread2"
wait until "thread2" finish with some function (let's say go Go())
def Go():
import some_module
....
Here the import in Go() would hang up since the import is locked in the main thread (by import file2) which will not be released until Go() finishes. The user will see in strace hang on FUTEX_WAIT_PRIVATE.
To work around this place the code executed during the import of file2 into Do() function and run it after importing file2:
import file2
file2.Do()
| 0 | 0 | 0 | 1 |
2010-10-11T11:48:00.000
| 2 | 0.197375 | false | 3,905,883 | 0 | 0 | 1 | 2 |
I have a Python daemon running in production. It employs between 7 and 120 threads. Recently the smallest instance (7 threads) started to show hangs while all other instances never showed this kind of problem. Attaching strace to the python process shows that all threads are calling futex FUTEX_WAIT_PRIVATE, so they are probably trying to lock something.
How would you debug such a problem?
Note that this is a production system running from flash memory, so disk writes are constrained, too.
|
Python hangs in futex calls
| 3,913,056 | 4 | 2 | 7,410 | 0 |
python,multithreading,debugging,deadlock,futex
|
The observation was slightly incorrect. One thread wasn't calling futex, but instead swapping while holding the gil. Since the machine in question is low hardware this swapping took very long and seemed to be a deadlock. The underlying problem is a memory leak. :-(
| 0 | 0 | 0 | 1 |
2010-10-11T11:48:00.000
| 2 | 1.2 | true | 3,905,883 | 0 | 0 | 1 | 2 |
I have a Python daemon running in production. It employs between 7 and 120 threads. Recently the smallest instance (7 threads) started to show hangs while all other instances never showed this kind of problem. Attaching strace to the python process shows that all threads are calling futex FUTEX_WAIT_PRIVATE, so they are probably trying to lock something.
How would you debug such a problem?
Note that this is a production system running from flash memory, so disk writes are constrained, too.
|
Can I use IronPython to develop GUIs for Google App Engine?
| 3,908,074 | 3 | 3 | 651 | 0 |
python,user-interface,google-app-engine,ironpython
|
Google's Google App Engine can only run pure python code, and not even all Python is supported. No, you can't do things like IronPython.
If you want to use Python, I'd learn Django. If you want something closer to .NET, I'd go with Java.
| 1 | 0 | 0 | 0 |
2010-10-11T16:23:00.000
| 1 | 0.53705 | false | 3,908,062 | 0 | 0 | 1 | 1 |
I'm developing a simple Python program with a (dynamic) form interface, but it needs to run on Google App Engine. I understand that IronPython lets one use Visual Studio's drag-and-drop interface builder and classes while programming with Python, but will this be compatible with Google App Engine?
|
Issue happens when installing Django on Windows 7
| 3,912,677 | 2 | 1 | 494 | 0 |
python,django,installation
|
It is very likely that the py extension is linked with the editor rather than the Python interpreter.
Right-click on a py file and click "Open with" then select the default program and choose 'C:...\Python2x\python.exe'
That should fix the pb
| 0 | 0 | 0 | 0 |
2010-10-12T07:53:00.000
| 1 | 1.2 | true | 3,912,579 | 0 | 0 | 1 | 1 |
I've got an issue when installing Django.
The official guide says open cmd with administrator privileges and run "setup.py install"
I did this but then the system default python editor came out, I don't know how to do anymore, please help me~
|
how to monitor python wsgi server,when it crashed restart it
| 3,923,177 | 1 | 0 | 829 | 0 |
python,crash,wsgi,restart
|
I'd use your operational system's service integration to do that. For example, on debian linux, there's start-stop-daemon. On windows, there's the service management.
It's the proven, well integrated way, provided by the operational system itself, to keep an application running.
Just make your installation program register your service with the native service management system.
| 0 | 0 | 0 | 0 |
2010-10-13T04:47:00.000
| 2 | 1.2 | true | 3,920,842 | 0 | 0 | 1 | 1 |
i have a wsgi server which use paste,for some unkonw reason,it will often crash,so i want to has a application or just some package can help me to slove this,when it crashed automaticly kill the process and restart it.Any advice is welcome.
|
Python webapp - moving from testing to production
| 3,965,912 | 1 | 2 | 444 | 0 |
python,web-applications,webserver,nginx
|
Available options are:
apache + mod_python
apache + mod_wsgi
lighttpd + mod_fastcgi
lighttpd + gunicorn
nginx + gunicorn
I suggest you to go for gunicorn.
| 0 | 0 | 0 | 0 |
2010-10-13T14:19:00.000
| 3 | 1.2 | true | 3,924,668 | 0 | 0 | 1 | 1 |
I've made a small web app using web.py that I now want to put into production. I dont anticipate this will have very high concurrent use (probably max of 5 or so users at any given time, if that).
That said, I dont want to go with the cherry.py server that comes with web.py (and which i have been using for debugging), because one of my main motivations for the app was to learn how to properly put apps in production.
Reading up on options - there seems to be dizzying array of stuff. Tornoado, nginx, lighttpd etc etc. Also stuff like Gunicorn, which I cant quite grasp the use of so far.
It seems WSGI is the way to go - and I wanted some help with what would be an appropriate, relatively easy to administer setup that i can run on an EC2 instance (ubuntu), perhaps using nginx/wsgi. Specifically, do i need gunicorn (or equivalent), and are there any good intros anybody may know of so i can actually get my web.py code running and at least start to understand this jigsaw of various technologies/options?
Many thanks
|
Options for handling javascript heavy pages while screen scraping
| 3,992,151 | 0 | 2 | 795 | 0 |
python,screen-scraping
|
For nonprogrammers, I recomment using IRobotSoft. It is visual oriented and with full javascript support. The shortcoming is that it runs only on Windows. The good thing is you can become an expert just by trial and error to learn the software.
| 0 | 0 | 1 | 0 |
2010-10-13T23:58:00.000
| 4 | 0 | false | 3,929,005 | 0 | 0 | 1 | 1 |
Disclaimer here: I'm really not a programmer. I'm eager to learn, but my experience is pretty much basic on c64 20 years ago and a couple of days of learning Python.
I'm just starting out on a fairly large (for me as a beginner) screen scraping project. So far I have been using python with mechanize+lxml for my browsing/parsing. Now I'm encountering some really javascript heavy pages that doesn't show a anything without javascript enabled, which means trouble for mechanize.
From my searching I've kind come to the conclusion that I have a basically a few options:
Trying to figure out what the javascript is doing a emulate that in my code (I don't quite know where to start with this. ;-))
Using pywin32 to control internet explorer or something similar, like using the webkit-browser from pyqt4 or even using telnet and mozrepl (this seems really hard)
Switching language to perl since www::Mechanize seems be a lot more mature on per (addons and such for javascript). Don't know too much about this at all.
If anyone has some pointers here that would be great. I understand that I need to do a lot of trial and error, but would be nice I wouldn't go too far away from the "true" answer, if there is such a thing.
|
Catching the Access Token sent by Facebook after successful authentication
| 4,663,777 | 0 | 2 | 755 | 0 |
python,facebook
|
There's a getLoginUrl in the facebook SDK. You might want to look at that.
-Roozbeh
| 0 | 0 | 1 | 0 |
2010-10-14T04:38:00.000
| 2 | 0 | false | 3,930,129 | 0 | 0 | 1 | 1 |
I am trying to make an app for authenticating user with their facebook account in python. App opens the facebook login page in web browser. After user logs in, facebook redirects it to thei dummy success page. At that moment i need to capture that redirect url in my app. I am not able to catch that URL.
I am opening fb login page by using webbrowser.open . How can i catch the redirect url after opening web browser?
Any suggestions will be very helpful.
Thanks,
Tara Singh
|
pydev not recognizing python installation with django
| 3,941,289 | 12 | 15 | 11,629 | 0 |
python,django,eclipse,pydev
|
go in the menu to window -> preference -> pydev -> Interpreter - Python ; and add the python interpreter there, if you installed the django in a virtual environment you should add the python interpreter of the virtual env ; after adding the interpreter by clicking on new you should now click on Apply , you should see now all the system libs from PYTHONPATH added there between them Django .
hope this will help
| 0 | 0 | 0 | 0 |
2010-10-15T06:11:00.000
| 10 | 1.2 | true | 3,939,877 | 1 | 0 | 1 | 10 |
I have python installed with django. I know the installation is there because I installed it following the directions and in the command line I can do "import python" and there is no crash.
When I try creating a django project in pydev, I get an error: "Django not found."
What could the problem be?
|
pydev not recognizing python installation with django
| 4,118,703 | 6 | 15 | 11,629 | 0 |
python,django,eclipse,pydev
|
Jaffa,
You might have configured your python interpreter in Eclipse prior to installing Django in python.
So what you have to do now is in Eclipse remove the Python interpreter and add it again (now that it has Django installed) and all should work ok.
| 0 | 0 | 0 | 0 |
2010-10-15T06:11:00.000
| 10 | 1 | false | 3,939,877 | 1 | 0 | 1 | 10 |
I have python installed with django. I know the installation is there because I installed it following the directions and in the command line I can do "import python" and there is no crash.
When I try creating a django project in pydev, I get an error: "Django not found."
What could the problem be?
|
pydev not recognizing python installation with django
| 28,459,588 | 0 | 15 | 11,629 | 0 |
python,django,eclipse,pydev
|
Same problem I have faced today. I took help from these answer.
but in my case it didnt work.
There is small modification in @antonkeren answer.
1) Go to Preferences. Windows > preferences.
2) Search for Pydev
3) Select Python Interpreter
4) Pressed Quick Auto-config
5) now download www.djangoproject.org/downloads django tar and extract on any location.
6) now click on Folder in "Libraries tab" of "System PYTHONPATH" and select your extracted django project folder location.
7) Click on apply and ok.
Creating a Django project afterwards should be ok.
Cheers...!!
| 0 | 0 | 0 | 0 |
2010-10-15T06:11:00.000
| 10 | 0 | false | 3,939,877 | 1 | 0 | 1 | 10 |
I have python installed with django. I know the installation is there because I installed it following the directions and in the command line I can do "import python" and there is no crash.
When I try creating a django project in pydev, I get an error: "Django not found."
What could the problem be?
|
pydev not recognizing python installation with django
| 3,943,039 | 1 | 15 | 11,629 | 0 |
python,django,eclipse,pydev
|
I stumbled upon this only yesterday myself: Django must not be among the system libraries for this to function...
| 0 | 0 | 0 | 0 |
2010-10-15T06:11:00.000
| 10 | 0.019997 | false | 3,939,877 | 1 | 0 | 1 | 10 |
I have python installed with django. I know the installation is there because I installed it following the directions and in the command line I can do "import python" and there is no crash.
When I try creating a django project in pydev, I get an error: "Django not found."
What could the problem be?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.