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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Is it crazy to not rely on a caching system like memcached nowadays ( for dynamic sites )?
| 1,338,810 | 6 | 2 | 385 | 0 |
php,python,memcached,scalability
|
If your site performance is fine then there's no reason to add caching. Lots of sites can get by without any cache at all, or by moving to a file-system based cache. It's only the super high traffic sites that need memcached.
What's "crazy" is code architecture (or a lack of architecture) that makes adding caching in latter difficult.
| 0 | 0 | 0 | 1 |
2009-08-27T03:57:00.000
| 4 | 1 | false | 1,338,777 | 0 | 0 | 1 | 3 |
I was just reviewing one of my client's applications which uses some old outdated php framework that doesn't rely on caching at all and is pretty much completely database dependent.
I figure I'll just rewrite it from scratch because it's really outdated and in this rewrite I want to implement a caching system. It'd be nice if I could get a few pointers if anyone has done this prior.
Rewrite will be done in either PHP or Python
Would be nice if I could profile before and after this implementation
I have my own server so I'm not restricted by shared hosting
|
Is it crazy to not rely on a caching system like memcached nowadays ( for dynamic sites )?
| 1,338,828 | 10 | 2 | 385 | 0 |
php,python,memcached,scalability
|
Caching, when it works right (==high hit rate), is one of the few general-purpose techniques that can really help with latency -- the harder part of problems generically describes as "performance". You can enhance QPS (queries per second) measures of performance just by throwing more hardware at the problem -- but latency doesn't work that way (i.e., it doesn't take just one month to make a babies if you set nine mothers to work on it;-).
However, the main resource used by caching is typically memory (RAM or disk as it may be). As you mention in a comment that the only performance problem you observe is memory usage, caching wouldn't help: it would just earmark some portion of memory to use for caching purposes, leaving even less available as a "general fund". As a resident of California I'm witnessing first-hand what happens when too many resources are earmarked, and I couldn't recommend such a course of action with a clear conscience!-)
| 0 | 0 | 0 | 1 |
2009-08-27T03:57:00.000
| 4 | 1.2 | true | 1,338,777 | 0 | 0 | 1 | 3 |
I was just reviewing one of my client's applications which uses some old outdated php framework that doesn't rely on caching at all and is pretty much completely database dependent.
I figure I'll just rewrite it from scratch because it's really outdated and in this rewrite I want to implement a caching system. It'd be nice if I could get a few pointers if anyone has done this prior.
Rewrite will be done in either PHP or Python
Would be nice if I could profile before and after this implementation
I have my own server so I'm not restricted by shared hosting
|
Is it crazy to not rely on a caching system like memcached nowadays ( for dynamic sites )?
| 1,338,864 | 0 | 2 | 385 | 0 |
php,python,memcached,scalability
|
Depending on the specific nature of the codebase and traffic patterns, you might not even need to re-write the whole site. Horribly inefficient code is not such a big deal if it can be bypassed via cache for 99.9% of page requests.
When choosing PHP or Python, make sure you figure out where you're going to host the site (or if you even get to make that call). Many of my clients are already set up on a webserver and Python is not an option. You should also make sure any databases/external programs you want to interface with are well-supported in PHP or Python.
| 0 | 0 | 0 | 1 |
2009-08-27T03:57:00.000
| 4 | 0 | false | 1,338,777 | 0 | 0 | 1 | 3 |
I was just reviewing one of my client's applications which uses some old outdated php framework that doesn't rely on caching at all and is pretty much completely database dependent.
I figure I'll just rewrite it from scratch because it's really outdated and in this rewrite I want to implement a caching system. It'd be nice if I could get a few pointers if anyone has done this prior.
Rewrite will be done in either PHP or Python
Would be nice if I could profile before and after this implementation
I have my own server so I'm not restricted by shared hosting
|
Locally Hosted Google App Engine (WebApp Framework / BigTable)
| 1,342,175 | 4 | 1 | 911 | 0 |
python,google-app-engine,mod-wsgi
|
Webapp is a fine choice for a simple web framework but there are plenty of other simple python web frameworks that have instructions for setting them up in your use case (cherrypy, web.py, etc). Since google developed webapp for gae I don't believe they published instructions for setting it up behind apache.
BigTable is proprietary to Google so you will not be able to run it locally. If you are looking for something with similar performance characteristics I'd look into the schemaless 'document-oriented' databases.
| 0 | 1 | 0 | 0 |
2009-08-27T12:51:00.000
| 1 | 1.2 | true | 1,340,887 | 0 | 0 | 1 | 1 |
I have been playing with Google App engine a lot lately, from home on personal projects, and I have been really enjoying it. I've converted a few of my coworkers over and we are interested in using GAE for a few of our projects at work.
Our work has to be hosted locally on our own servers. I've done some searching around and I really can't find any information on using the WebApp framework and BigTable locally.
Any information you could provide on setting up a GAE-ish environment on a local Windows server would be much appreciated. I know GAE is much more than just the framework and BigTable - the scalability, propogation of your application/data across many servers are all features we don't need. We just want to get the webapp framework and BigTable up and running through mod_wsgi on Apache.
|
IronPython and ASP.NET: ready for prime time?
| 1,350,056 | 0 | 7 | 284 | 0 |
asp.net,ironpython
|
I don't believe that ASP.NET was ever ready for prime time. The framework is contrived and an awful fit for designing web applications. It was made for VB6 programmers that only know how to drag controls onto a design surface.
Most decent(and pretty much all bad) applications written on ASP.NET don't use it as it was designed, and if that's the case then what's the point.
| 0 | 0 | 0 | 0 |
2009-08-27T20:51:00.000
| 3 | 0 | false | 1,343,679 | 0 | 0 | 1 | 2 |
Has anyone actually built and deployed a website with IronPython and ASP.NET. What were your experiences and is the combination ready for prime-time?
I asked this question just over a year ago. And the consensus seemed to be "not really".
What's the status now?
|
IronPython and ASP.NET: ready for prime time?
| 1,344,833 | 1 | 7 | 284 | 0 |
asp.net,ironpython
|
I believe that if you want to do anthing useful/em> with .NET + IronPython, you need better support for the dynamicy of Microsoft's CLR environment, and you'll need VS2010 for that.
You may have better luck just building a strait up python app. Why bother using ASP.NET? Are you integrating with another codebase?
| 0 | 0 | 0 | 0 |
2009-08-27T20:51:00.000
| 3 | 0.066568 | false | 1,343,679 | 0 | 0 | 1 | 2 |
Has anyone actually built and deployed a website with IronPython and ASP.NET. What were your experiences and is the combination ready for prime-time?
I asked this question just over a year ago. And the consensus seemed to be "not really".
What's the status now?
|
JavaFX or RIA desktop app (on dvd) also available on the web?
| 1,371,752 | 0 | 1 | 316 | 0 |
java,python,web-applications,javafx,turbogears
|
Yes, it is possible. If you use JavaFX you will be allowed use multiple deployments. For example, NetBeans 6.7.1 with JavaFX creates several possible deployments from one project. Then you can publish this application on web, DVD, etc. You will need to slightly customize standalone deployment for DVD to be able e.g. start it as autorun if necessary. JavaFX is good choice.
| 0 | 0 | 0 | 0 |
2009-08-28T12:30:00.000
| 4 | 0 | false | 1,346,723 | 0 | 0 | 1 | 4 |
Is it possible to develop an application easily available on the web that also can be distributed on DVD (installer or started from the dvd)?
For the moment, we use static html (frameset!) pages (generated by xml files), with one difference: pdf's are only on the DVD version, the web version only shows a preview of these files.
Can this be done with JavaFX, OpenLaszlo or are there better options?
(for example: turbogears, and using tg2exe for DVD version)
|
JavaFX or RIA desktop app (on dvd) also available on the web?
| 1,357,063 | 0 | 1 | 316 | 0 |
java,python,web-applications,javafx,turbogears
|
Yes JavaFX or Flash applications can be used to develop applications that run in different contexts.
However, it's not clear from your question why these would be preferable over your current solution.
If the information your sharing is primarily text and you're using DVD because your audience is primarily located in area with bad Internet connectivity, then you're current approach probably makes more sense. JavaFX or Flash might be more fun to write for developers but maybe doesn't serve your audience.
I would suggest that if you are shipping DVD and are looking for ways to make the DVD more useful than as a PDF delivery system would be to add video to the DVDs. And then maybe it would make more sense to use JavaFX or Flash to drive the UI.
| 0 | 0 | 0 | 0 |
2009-08-28T12:30:00.000
| 4 | 0 | false | 1,346,723 | 0 | 0 | 1 | 4 |
Is it possible to develop an application easily available on the web that also can be distributed on DVD (installer or started from the dvd)?
For the moment, we use static html (frameset!) pages (generated by xml files), with one difference: pdf's are only on the DVD version, the web version only shows a preview of these files.
Can this be done with JavaFX, OpenLaszlo or are there better options?
(for example: turbogears, and using tg2exe for DVD version)
|
JavaFX or RIA desktop app (on dvd) also available on the web?
| 1,508,000 | 0 | 1 | 316 | 0 |
java,python,web-applications,javafx,turbogears
|
This seems like a job for flex, however I know better little about it to give a better answer.
| 0 | 0 | 0 | 0 |
2009-08-28T12:30:00.000
| 4 | 0 | false | 1,346,723 | 0 | 0 | 1 | 4 |
Is it possible to develop an application easily available on the web that also can be distributed on DVD (installer or started from the dvd)?
For the moment, we use static html (frameset!) pages (generated by xml files), with one difference: pdf's are only on the DVD version, the web version only shows a preview of these files.
Can this be done with JavaFX, OpenLaszlo or are there better options?
(for example: turbogears, and using tg2exe for DVD version)
|
JavaFX or RIA desktop app (on dvd) also available on the web?
| 1,347,338 | 0 | 1 | 316 | 0 |
java,python,web-applications,javafx,turbogears
|
I think if you design it correctly to begin with, a JavaFX app can be interchanged between web-app and desktop-app relatively easily. However, I've only done this with very simple apps (specifically, Tic-Tac-Toe!), so I'm sure there might exist some caveats that I am unaware of (thus the "design it correctly" catch-all). ;)
Why don't you just provide the PDFs in your current web version, rather than redeveloping everything? I'm not aware of any browsers that don't support in-browser PDF reading anymore.
| 0 | 0 | 0 | 0 |
2009-08-28T12:30:00.000
| 4 | 0 | false | 1,346,723 | 0 | 0 | 1 | 4 |
Is it possible to develop an application easily available on the web that also can be distributed on DVD (installer or started from the dvd)?
For the moment, we use static html (frameset!) pages (generated by xml files), with one difference: pdf's are only on the DVD version, the web version only shows a preview of these files.
Can this be done with JavaFX, OpenLaszlo or are there better options?
(for example: turbogears, and using tg2exe for DVD version)
|
How do you add a custom section to the Django admin home page?
| 1,349,413 | 6 | 8 | 5,525 | 0 |
python,django,django-admin
|
To add a section not associated with an app, you'll have to override the admin index template. Create an admin/ directory in your project templates directory, and copy the file django/contrib/admin/templates/admin/index.html into it. Then you can add whatever markup you want to this file. The only downside (unfortunately there's no good way around it at the moment) is that if you upgrade Django, you'll have to be on the lookout for any changes to that index.html file, and copy those changes over into your version as well.
| 0 | 0 | 0 | 0 |
2009-08-28T18:46:00.000
| 1 | 1.2 | true | 1,348,710 | 0 | 0 | 1 | 1 |
In the Django admin each app you have registered with the admin gets its own section. I want to add a custom section for reporting that isn't associated with any app. How do I do that?
|
Object store for objects in Django between requests
| 1,351,459 | 0 | 7 | 5,947 | 0 |
python,django
|
An in memory storage is not persistent, so no.
I think you mean that you only want to write to the database ever X new posts of objects. I guess this is for speedup reasons. But since you need to serialize them sooner or later anyway, you don't actually save any time that way. However, you will save time by not flushing the new objects to disk, but most databases already support that.
But you also talk about caching the rendered page, which is read caching. There you can't cache the finished result you say, but you can cache the result of the database query. That means that new message will not be immediately updated, but take a minute or so to show up, but I think most people will see this as acceptable.
Update: In this case not, then. But you should still easily be able to cache the query results, but invalidate that cache when new responses are added. That should help.
| 0 | 0 | 0 | 0 |
2009-08-29T12:24:00.000
| 2 | 0 | false | 1,351,323 | 0 | 0 | 1 | 1 |
I had the following idea: Say we have a webapp written using django which models some kind of bulletin board. This board has many threads but a few of them get the most posts/views per hour.
The thread pages look a little different for each user, so you can't cache the rendered page as whole and caching only some parts of the rendered page is also not an option.
My idea was: I create an object structure of the thread in memory (with every post and other data that is needed to display it). If a new message is posted the structure is updated and every X posts (or every Y minutes, whatever comes first) the new messages are written back to the database. If the app crashes, some posts are lost, but this is definitely okay (for users and admins).
The question: Can I create such a persistent in memory storage without serialization (so no serialize->memcached)? As I understand it, WSGI applications (like Django) run in a continuous process without shutting down between requests, so it should be possible in theory. Is there any API I could use? If not: any point to look?
/edit1: I know that "persistent" usually has a different meaning, but in this case I strictly mean "in between request".
|
Encrypted Django Model Fields
| 23,873,516 | 0 | 7 | 5,260 | 0 |
python,django,encryption,django-models
|
Some other issues to consider are that the web application will then not be able to sort or easily query on the encrypted fields. It would be helpful to know what administrative functions the client wants you to have. Another approach would be to have a separate app / access channel that does not show the critical data but still allows you to perform your admin functions only.
| 0 | 0 | 0 | 0 |
2009-08-30T04:55:00.000
| 6 | 0 | false | 1,353,128 | 0 | 0 | 1 | 4 |
A client wants to ensure that I cannot read sensitive data from their site, which will still be administered by me. In practice, this means that I'll have database access, but it can't be possible for me to read the contents of certain Model Fields. Is there any way to make the data inaccessible to me, but still decrypted by the server to be browsed by the client?
|
Encrypted Django Model Fields
| 9,006,291 | 5 | 7 | 5,260 | 0 |
python,django,encryption,django-models
|
This is possible with public key encryption. I have done something similar before in PHP but the idea is the same for a Django app:
All data on this website was stored encrypted using a private key held by the system software. The corresponding public key to decrypt the data was held by the client in a text file.
When the client wanted to access their data, they pasted the public key into an authorisation form (holding the key in the session) which unlocked the data.
When done, they deauthorised their session.
This protected the information against authorised access to the web app (so safe against weak username/passwords) and also from leaks at the database level.
This is still not completely secure: if you have root access to the machine you can capture the key as it is uploaded, or inspect the session information. For that the cure could be to run the reading software on the client's machine and access the database through an API.
I realise this is an old question but I thought I'd clarify that it is indeed possible.
| 0 | 0 | 0 | 0 |
2009-08-30T04:55:00.000
| 6 | 0.16514 | false | 1,353,128 | 0 | 0 | 1 | 4 |
A client wants to ensure that I cannot read sensitive data from their site, which will still be administered by me. In practice, this means that I'll have database access, but it can't be possible for me to read the contents of certain Model Fields. Is there any way to make the data inaccessible to me, but still decrypted by the server to be browsed by the client?
|
Encrypted Django Model Fields
| 1,360,064 | 0 | 7 | 5,260 | 0 |
python,django,encryption,django-models
|
You and your client could agree on them being obscured. A simple XOR operation or something similar will make the values unreadable in the admin and they can be decoded just in time they are needed in the site.
This way you can safely administer the site without "accidentally" reading something.
Make sure your client understands that it is technically possible for you to get the actual contents but that it would require active effort.
| 0 | 0 | 0 | 0 |
2009-08-30T04:55:00.000
| 6 | 0 | false | 1,353,128 | 0 | 0 | 1 | 4 |
A client wants to ensure that I cannot read sensitive data from their site, which will still be administered by me. In practice, this means that I'll have database access, but it can't be possible for me to read the contents of certain Model Fields. Is there any way to make the data inaccessible to me, but still decrypted by the server to be browsed by the client?
|
Encrypted Django Model Fields
| 1,353,174 | 4 | 7 | 5,260 | 0 |
python,django,encryption,django-models
|
No, it's not possible to have data that is both in a form you can't decrypt it, and in a form where you can decrypt it to show it to the client simultaneously. The best you can do is a reversible encryption on the content so at least if your server is compromised their data is safe.
| 0 | 0 | 0 | 0 |
2009-08-30T04:55:00.000
| 6 | 1.2 | true | 1,353,128 | 0 | 0 | 1 | 4 |
A client wants to ensure that I cannot read sensitive data from their site, which will still be administered by me. In practice, this means that I'll have database access, but it can't be possible for me to read the contents of certain Model Fields. Is there any way to make the data inaccessible to me, but still decrypted by the server to be browsed by the client?
|
Django: How can you stop long queries from killing your database?
| 1,500,947 | 0 | 7 | 4,741 | 1 |
python,mysql,django,timeout
|
You shouldn't write queries like that, at least not to run against your live database. Mysql has a "slow queries" pararameter which you can use to identify the queries that are killing you. Most of the time, these slow queries are either buggy or can be speeded up by defining a new index or two.
| 0 | 0 | 0 | 0 |
2009-08-30T06:10:00.000
| 6 | 0 | false | 1,353,206 | 0 | 0 | 1 | 3 |
I'm using Django 1.1 with Mysql 5.* and MyISAM tables.
Some of my queries can take a TON of time for outliers in my data set. These lock the tables and shut the site down. Other times it seems some users cancel the request before it is done and some queries will be stuck in the "Preparing" phase locking all other queries out.
I'm going to try to track down all the corner cases, but its nice to have a safety net so the site doesn't come down.
How do I avoid this? Can I set maximum query times?
|
Django: How can you stop long queries from killing your database?
| 1,353,862 | 1 | 7 | 4,741 | 1 |
python,mysql,django,timeout
|
Unfortunately MySQL doesn't allow you an easy way to avoid this. A common method is basically to write a script that checks all running processes every X seconds (based on what you think is "long") and kill ones it sees are running too long. You can at least get some basic diagnostics, however, by setting log_slow_queries in MySQL which will write all queries that take longer than 10 seconds into a log. If that's too long for what you regard as "slow" for your purposes, you can set long_query_time to a value other than 10 to change the threshold.
| 0 | 0 | 0 | 0 |
2009-08-30T06:10:00.000
| 6 | 1.2 | true | 1,353,206 | 0 | 0 | 1 | 3 |
I'm using Django 1.1 with Mysql 5.* and MyISAM tables.
Some of my queries can take a TON of time for outliers in my data set. These lock the tables and shut the site down. Other times it seems some users cancel the request before it is done and some queries will be stuck in the "Preparing" phase locking all other queries out.
I'm going to try to track down all the corner cases, but its nice to have a safety net so the site doesn't come down.
How do I avoid this? Can I set maximum query times?
|
Django: How can you stop long queries from killing your database?
| 1,353,366 | 0 | 7 | 4,741 | 1 |
python,mysql,django,timeout
|
Do you know what the queries are? Maybe you could optimise the SQL or put some indexes on your tables?
| 0 | 0 | 0 | 0 |
2009-08-30T06:10:00.000
| 6 | 0 | false | 1,353,206 | 0 | 0 | 1 | 3 |
I'm using Django 1.1 with Mysql 5.* and MyISAM tables.
Some of my queries can take a TON of time for outliers in my data set. These lock the tables and shut the site down. Other times it seems some users cancel the request before it is done and some queries will be stuck in the "Preparing" phase locking all other queries out.
I'm going to try to track down all the corner cases, but its nice to have a safety net so the site doesn't come down.
How do I avoid this? Can I set maximum query times?
|
Latin letters with acute : DjangoUnicodeDecodeError
| 1,355,303 | 5 | 1 | 3,312 | 1 |
python,django,utf-8,character-encoding
|
Judging from the \xf3 code for 'ó', it does look like the data is encoded in ISO-8859-1 (or some close relative). So body.decode('iso-8859-1') should be a valid Unicode string (you don't specify what "without solution" means -- what error message do you get, and where?); if what you need is a utf-8 encoded bytestring instead, body.decode('iso-8859-1').encode('utf-8') should give you one!
| 0 | 0 | 0 | 0 |
2009-08-31T00:11:00.000
| 1 | 1.2 | true | 1,355,285 | 0 | 0 | 1 | 1 |
I have a problem reading a txt file to insert in the mysql db table, te sniped of this code:
file contains the in first line: "aclaración"
archivo = open('file.txt',"r")
for line in archivo.readlines():
....body = body + line
model = MyModel(body=body)
model.save()
i get a DjangoUnicodeDecodeError:
'utf8' codec can't decode bytes in position 8: invalid data. You passed in 'aclaraci\xf3n' (type 'str')
Unicode error hint
The string that could not be encoded/decoded was: araci�n.
I tried to body.decode('utf-8'), body.decode('latin-1'), body.decode('iso-8859-1') without solution.
Can you help me please? Any hint is apreciated :)
|
django : ImportError No module named myapp.views.hometest
| 2,978,457 | 4 | 3 | 7,581 | 0 |
python,django,mod-wsgi
|
I just had this problem. It went away when I added sys.path.append('/path/to/project') to my .wsgi file.
| 0 | 0 | 0 | 0 |
2009-08-31T21:10:00.000
| 4 | 0.197375 | false | 1,359,449 | 0 | 0 | 1 | 4 |
I have fecora 11, set django with mod_wsgi2.5 and apache2.2. And I can run "python manage.py runserver" at local. It works fine. I got error when i test from remote browser.
Thanks for any suggestion and help!
|
django : ImportError No module named myapp.views.hometest
| 1,360,370 | 1 | 3 | 7,581 | 0 |
python,django,mod-wsgi
|
All required env variables should be set in django.wsgi. You could compare the env declared in django.wsgi and the env of executing ./manage runserver and make sure they are same.
Furthermore, if there is another myapp package which could be found through PYTHONPATH before /usr/local/django/myapp, ImportError may be raised.
| 0 | 0 | 0 | 0 |
2009-08-31T21:10:00.000
| 4 | 0.049958 | false | 1,359,449 | 0 | 0 | 1 | 4 |
I have fecora 11, set django with mod_wsgi2.5 and apache2.2. And I can run "python manage.py runserver" at local. It works fine. I got error when i test from remote browser.
Thanks for any suggestion and help!
|
django : ImportError No module named myapp.views.hometest
| 1,359,482 | 2 | 3 | 7,581 | 0 |
python,django,mod-wsgi
|
Is the application containing your Django project in your $PYTHONPATH (when Python is invoked in a server context)? For example, if your Django project is at /home/wwwuser/web/myproj, then /home/wwwuser/web should be in your $PYTHONPATH. You should set this in the script that loads the project when invoked from the web server.
| 0 | 0 | 0 | 0 |
2009-08-31T21:10:00.000
| 4 | 0.099668 | false | 1,359,449 | 0 | 0 | 1 | 4 |
I have fecora 11, set django with mod_wsgi2.5 and apache2.2. And I can run "python manage.py runserver" at local. It works fine. I got error when i test from remote browser.
Thanks for any suggestion and help!
|
django : ImportError No module named myapp.views.hometest
| 1,359,494 | 1 | 3 | 7,581 | 0 |
python,django,mod-wsgi
|
Just a guess, but unless you've explicitly made sure that your app is on PYTHONPATH, you should be specifying views in urls.py as myproject.myapp.views.functionname.
Otherwise:
check if you're setting PYTHONPATH, or what to. Your project directory should be in there.
if you enable the django admin (by uncommenting the lines that are there by default in urls.py), does that work?
| 0 | 0 | 0 | 0 |
2009-08-31T21:10:00.000
| 4 | 0.049958 | false | 1,359,449 | 0 | 0 | 1 | 4 |
I have fecora 11, set django with mod_wsgi2.5 and apache2.2. And I can run "python manage.py runserver" at local. It works fine. I got error when i test from remote browser.
Thanks for any suggestion and help!
|
Block requests from *.appspot.com and force custom domain in Google App Engine
| 1,364,875 | 17 | 14 | 5,133 | 0 |
python,google-app-engine,redirect
|
You can check if os.environ['HTTP_HOST'].endswith('.appspot.com') -- if so, then you're serving from something.appspot.com and can send a redirect, or otherwise alter your behavior as desired.
You could deploy this check-and-redirect-if-needed (or other behavior alteration of your choice) in any of various ways (decorators, WSGI middleware, inheritance from an intermediate base class of yours that subclasses webapp.RequestHandler [[or whatever other base handler class you're currently using]] and method names different than get and post in your application-level handler classes, and others yet) but I think that the key idea here is that os.environ is set by the app engine framework according to CGI standards and so you can rely on those standards (similarly WSGI builds its own environment based on the values it picks up from os.environ).
| 0 | 1 | 0 | 0 |
2009-09-01T21:26:00.000
| 5 | 1.2 | true | 1,364,733 | 0 | 0 | 1 | 1 |
How can I prevent a user from accessing my app at example.appspot.com and force them to access it at example.com? I already have example.com working, but I don't want users to be able to access the appspot domain. I'm using python.
|
How to download a webpage in every five minutes?
| 1,367,209 | 5 | 1 | 2,545 | 0 |
python,download,webpage,wget,web-crawler
|
Write a bash script that uses wget and put it in your crontab to run every 5 minutes. (*/5 * * * *)
If you need to keep a history of all these web pages, set a variable at the beginning of your script with the current unixtime and append it to the output filenames.
| 0 | 0 | 1 | 0 |
2009-09-02T11:39:00.000
| 2 | 1.2 | true | 1,367,189 | 0 | 0 | 1 | 1 |
I want to download a list of web pages. I know wget can do this. However downloading every URL in every five minutes and save them to a folder seems beyond the capability of wget.
Does anyone knows some tools either in java or python or Perl which accomplishes the task?
Thanks in advance.
|
How would you query Picasa from a Google App Engine app? Data API or Url Fetch?
| 1,369,908 | 2 | 0 | 1,248 | 0 |
python,api,google-app-engine,picasa,urlfetch
|
Your question is a little off, since the Data API is exposed through RESTful URLs, so both methods are ultimately a "URL Fetch".
The Data API works quite well, though. It gives you access to nearly all the functionality of Picasa, and responses are sent back and forth in well-formed, well-documented XML. Google's documentation for the API is very good.
If you only need access to limited publicly available content (like a photostream) then you can do this at a very basic level by just fetching the feed url and parsing that... but even for that you can get the same data with more configuration options via the Data API URLs.
I'm not sure what code samples you'd like... it really depends what you actually want to do with Picasa.
| 0 | 1 | 0 | 0 |
2009-09-02T20:10:00.000
| 1 | 1.2 | true | 1,369,861 | 0 | 0 | 1 | 1 |
How would you query Picasa from a Google App Engine app? Data API or Url Fetch? What are the pros and cons of using either method?
[Edit]
I would like to be able to query a specific album in Picasa and list all the photos in it.
Code examples to do this in python are much appreciated.
|
web2py in the future?
| 1,380,536 | 7 | 15 | 9,030 | 0 |
python,ruby-on-rails,django,web2py
|
Web2py is a good one to learn. If this is going to be deployed to a server, double check it supports wsgi. Sometimes php is the way to go because you know it's supported almost anywhere.
| 0 | 0 | 0 | 0 |
2009-09-04T15:52:00.000
| 10 | 1 | false | 1,380,079 | 0 | 0 | 1 | 5 |
Given the size of web2py and the lack of resources and corporate support, do you think it would be advisable to learn web2py as the only web development framework I know. I'm considersing learning Ruby on Rails or web2py for a website I need to create for as a school project.
|
web2py in the future?
| 10,003,970 | 1 | 15 | 9,030 | 0 |
python,ruby-on-rails,django,web2py
|
I've already used Java EE and Django. The web2py learning curve is so fast! It's incredible! Things that I was getting a time to develop in three days using java, I can do fastly using web2py. Of course, Web2py has not the same ready plugins that RoR, but, doubtless, we can do these things fastly using web2py. Therefore, is a good opportunity to start learning = )
| 0 | 0 | 0 | 0 |
2009-09-04T15:52:00.000
| 10 | 0.019997 | false | 1,380,079 | 0 | 0 | 1 | 5 |
Given the size of web2py and the lack of resources and corporate support, do you think it would be advisable to learn web2py as the only web development framework I know. I'm considersing learning Ruby on Rails or web2py for a website I need to create for as a school project.
|
web2py in the future?
| 3,646,728 | 1 | 15 | 9,030 | 0 |
python,ruby-on-rails,django,web2py
|
Glad I found this thread! Cause some outdated pages and broken external links on Web2Py's website almost scared me off. But at least now I know there's a pretty good community around Web2Py.
I've just been looking through a load of Python web frameworks, and Web2Py's description sounded enticing and managed to make Django sound overly laborious. Pretty sure there are some tangible benefits to Django's design decisions avoiding "too much magic" when it comes to larger projects.
But to just throw something up on the web with err "sane defaults" sounds perfectly good to me. Instead of throwaway scripts, we can make throwaway websites to handle some temporary thing...
There should be room for an appliance style framework with no installation...
Interesting possibilities for some projects. I saw someone already got a python framework + server to work on android phones :))
For me, thanks to this thread, I will just learn both.
Another thought; if Web2Py is open source and you like what it does you might not even mind being the only user at some point in the future, since you can add features to it yourself?
Mind you, I have not used either yet, just read the docs. I think the Web2Py people should put up a blurb on their website to differentiate themselves from Django in more detail, I haven't been able to check off all my question marks for choosing the right one.
| 0 | 0 | 0 | 0 |
2009-09-04T15:52:00.000
| 10 | 0.019997 | false | 1,380,079 | 0 | 0 | 1 | 5 |
Given the size of web2py and the lack of resources and corporate support, do you think it would be advisable to learn web2py as the only web development framework I know. I'm considersing learning Ruby on Rails or web2py for a website I need to create for as a school project.
|
web2py in the future?
| 1,381,094 | 3 | 15 | 9,030 | 0 |
python,ruby-on-rails,django,web2py
|
Ask yourself what you are looking to gain from the experience. Ie, is it more important to just get the application built and running with a minimum of time and effort, or are you trying to learn about web stack architecture?
If you're just looking for results, obviously you'll have more code and documentation to borrow from if you stick with a more commonly used framework. If you grit your teeth and accept Django's view of the world, you can build very functional applications very quickly. If you can find some pre-made reusable Django apps that handle part of your problem, it'll be even faster.
But if you want to make sure you have a very solid understanding of everything in the request cycle from HTTP request handling to database access and abstraction to form generation and processing and HTML templating, you'll be bettered served with a minimal framework that forces you to think more about the architecture and has a small enough codebase that you can just read it all top to bottom and not really need documentation beyond that. In that case though, I'd advise going even deeper and building your own framework on top of a WSGI library (you don't actually want to waste time learning the intricacies of working around browser quirks if you can help it). Once you've built your own and seen where things get complicated and where the tradeoffs are, you'll be in an excellent position to judge other frameworks and decide if there's one that does things the way you want to work.
| 0 | 0 | 0 | 0 |
2009-09-04T15:52:00.000
| 10 | 0.059928 | false | 1,380,079 | 0 | 0 | 1 | 5 |
Given the size of web2py and the lack of resources and corporate support, do you think it would be advisable to learn web2py as the only web development framework I know. I'm considersing learning Ruby on Rails or web2py for a website I need to create for as a school project.
|
web2py in the future?
| 1,380,121 | 12 | 15 | 9,030 | 0 |
python,ruby-on-rails,django,web2py
|
Learning is good.
Learning something (that eventually goes away) is no loss at all. The basic skills of web development (HTML, CSS, URL-parsing, GET vs. POST) don't ever change.
Frameworks come and go. Learn as many as you can. Learn how to manage your learning so that you (a) get to the important stuff first and (b) leave the other framework stuff behind when tackling a new framework.
Every framework has it's bias (or focus). Once you figure this out, you can make use of them without all the "compare and contrast" that slows some people down. Once you've learned web2py, you have to be careful learning Django that you start fresh, with no translation from old concepts to new.
| 0 | 0 | 0 | 0 |
2009-09-04T15:52:00.000
| 10 | 1 | false | 1,380,079 | 0 | 0 | 1 | 5 |
Given the size of web2py and the lack of resources and corporate support, do you think it would be advisable to learn web2py as the only web development framework I know. I'm considersing learning Ruby on Rails or web2py for a website I need to create for as a school project.
|
Easiest way to write a Python program with access to Django database functionality
| 1,381,517 | 0 | 3 | 3,911 | 0 |
python,django,django-models,django-orm
|
I'd like to have a Python program
which is run using a cronjob instead
of manually visiting the correct URL
to update the information.
A simplistic alternative: write a cronjob to automatically "visit the correct URL to update the information" -- could be as simple as a curl or wget, after all. This doesn't answer the question in the title, but given the way you explain your real underlying problem it just might be the simplest and most immediate approach to solve it.
| 0 | 0 | 0 | 0 |
2009-09-04T20:16:00.000
| 5 | 0 | false | 1,381,346 | 0 | 0 | 1 | 1 |
I have a website which fetches information from RSS feeds periodically (well, currently manually, and this is my problem). This is currently implemented as a normal Django view, which isn't very nice in my opinion. I'd like to have a Python program which is run using a cronjob instead of manually visiting the correct URL to update the information.
What is the easiest way to make a Python program have access to my particular Django application and the Django ORM?
|
XCode 3.2 Ruby and Python templates
| 1,448,482 | 0 | 6 | 11,625 | 0 |
python,ruby,cocoa,xcode,pyobjc
|
The above coments were all good and helpful but didn't really help. Easiest thing I could find is to create an empty python/ruby project in xcode 3.1, then make copies of this project folder for every new project you work on.
When you open the new/blank project, 3.2 has a new feature that lets you rename the project so you can have proper names for eacn new project.
| 0 | 0 | 0 | 0 |
2009-09-05T02:14:00.000
| 5 | 0 | false | 1,382,252 | 1 | 0 | 1 | 1 |
Under xcode 3.2 my ObjectiveC + Python/Ruby projects can still be opened updated and compiled, but you cannot create new projects.
Given that all traces of ruby and python are missing from xcode 3.2 (ie create project and add new ruby/python file), is there an easy way to get the templates installed again?
I found some info about copying them into a folder somewhere, but I cant seem to get it to work, I suspect the folder location has changed for 3.2.
|
Django: Simple rate limiting
| 1,388,111 | 1 | 4 | 1,777 | 0 |
python,django,caching,mutex,semaphore
|
What about using a different process to handle scraping, and a queue for the communication between it and Django?
This way you would be able to easily change the number of concurrent requests, and it would also automatically keep track of the requests, without blocking the caller.
Most of all, I think it would help lowering the complexity of the main application (in Django).
| 0 | 0 | 0 | 0 |
2009-09-07T07:08:00.000
| 2 | 0.099668 | false | 1,387,937 | 0 | 0 | 1 | 1 |
Many of my views fetch external resources. I want to make sure that under heavy load I don't blow up the remote sites (and/or get banned).
I only have 1 crawler so having a central lock will work fine.
So the details: I want to allow at most 3 queries to a host per second, and have the rest block for a maximum of 15 seconds. How could I do this (easily)?
Some thoughts :
Use django cache
Seems to only have 1 second resolution
Use a file based semaphore
Easy to do locks for concurrency. Not sure how to make sure only 3 fetches happen a second.
Use some shared memory state
I'd rather not install more things, but will if I have to.
|
IPv6 address validation and canonicalization
| 1,390,016 | 7 | 5 | 17,450 | 0 |
java,javascript,c++,python,ipv6
|
On POSIX systems you can use inet_pton and inet_ntop in combination to do canonicalization. You will still have to do your own CIDR parsing. Fortunately, I believe the only valid CIDR syntax for IPv6 is the /number_of_bits notation, so that's fairly easy.
The other issue you will run into is the lack of support for interface specifications. For link-local addresses, you will see things like %eth0 on the end to specify what link they are local too. getaddrinfo will parse that but inet_pton won't.
One strategy you could go for is using getaddrinfo to parse and inet_ntop to canonicalize.
getaddrinfo is available for Windows. inet_pton and inet_ntop aren't. Fortunately, it isn't too hard to write code to produce a canonical form IPv6 address. It will require two passes though because the rule for 0 compression is the biggest string of 0s that occurs first. Also IPv4 form (i.e. ::127.0.0.1) is only used for ::IPv4 or ::ffff:IPv4.
I have no Windows machine to test with, but from the documentation it appears that Python on Windows supports inet_pton and inet_ntop in its socket module.
Writing your own routine for producing a canonical form might not be a bad idea, since even if your canonical form isn't the same as everybody else's, as long as it's valid other people can parse it. But I would under no circumstances write a routine of your own to parse IPv6 addresses.
My advice above is good for Python, C, and C++. I know little or nothing about how to solve this problem in Java or Javascript.
EDIT: I have been examining getaddrinfo and its counterpart, getnameinfo. These are in almost all ways better than inet_pton and inet_ntop. They are thread safe, and you can pass them options (AI_NUMERICHOST in getaddrinfo's case, and NI_NUMERCHOST in getnameinfo's case) to keep them from doing any kind of DNS queries. Their interface is a little complex and reminds me of an ugly Windows interface in some respects, but it's fairly easy to figure out what options to pass to get what you want. I heartily recommend them both.
| 0 | 0 | 0 | 0 |
2009-09-07T12:07:00.000
| 11 | 1.2 | true | 1,389,082 | 0 | 0 | 1 | 1 |
What libs have you used for that? How compatible are they with one another? Or did you write your own parsing routine?
I'm particularly interested in mutually-compatible implementations for Java, C++, Python, and JavaScript, which support:
zero compression ("::")
IPv4-mapped addresses ("::ffff:123.45.67.89")
canonicalization (including to the short form, for human readability)
CIDR-style netmasks (like "/64" at the end)
|
How to process UDP data in Appengine
| 17,618,253 | 0 | 1 | 2,113 | 0 |
python,google-app-engine,udp
|
You could run a separate agent on a cloud host like DigitalOcean or Amazon EC2 that proxies this protocol and makes itself available to Google App Engine via ordinary HTTP or web sockets.
| 0 | 1 | 0 | 0 |
2009-09-07T13:14:00.000
| 3 | 0 | false | 1,389,385 | 0 | 0 | 1 | 1 |
I have a service provider who is transmitting data thro' UDP. I want to establish a connection to them, receive & process data (will be with in the 30 sec limit/request)
Is it possible to get & process UDP data in appengine. I am looking for some simple example.
|
Is it possible to deploy one GAE application from another GAE application?
| 1,392,766 | 5 | 3 | 418 | 0 |
python,google-app-engine
|
Is it possible? Yes. The protocol appcfg uses to update apps is entirely HTTP-based, so there's absolutely no reason you couldn't write an app that's capable of deploying other apps (or redeploying itself - self-modifying code)! You may even be able to reuse large parts of appcfg.py to do it.
Is it easy? Probably not. It's quite likely you'll need to understand a decent chunk of appcfg's internals, and the RPCs it uses to upload new apps - not a trivial undertaking. You'll also need to store your credentials in the app, in all likelihood - though you can use a role account that is and admin only for the apps it's deploying to minimize risk there.
| 0 | 1 | 0 | 0 |
2009-09-08T02:02:00.000
| 3 | 1.2 | true | 1,391,608 | 0 | 0 | 1 | 3 |
In order to redeploy a GAE application, I currently have to install the GAE deployment tools on the system that I am using for deployment. While this process is relatively straight forward, the deployment process is a manual process that does not work from behind a firewall and the deployment tools must be installed on every machine that will be used for updating GAE apps. A more ideal solution would be if I could update a GAE application from another GAE application that I have deployed previously. This would remove the need to have multiple systems configured to deploy apps.
Since the GAE deployment tools are written in Python and the GAE App Engine supports Python, is it possible to modify appcfg.py to work from within GAE? The use case would be to pull a project from GitHub or some other online repository and update one GAE application from another GAE app. If this is not possible, what is the limiting constraint?
|
Is it possible to deploy one GAE application from another GAE application?
| 1,391,649 | 2 | 3 | 418 | 0 |
python,google-app-engine
|
One limiting constraint could be the protocol that the python sdk uses to communicate with the GAE servers. If it only uses HTTP, you might be OK. but if it's anything else, you might be out of luck because you can't open a socket directly from within GAE.
| 0 | 1 | 0 | 0 |
2009-09-08T02:02:00.000
| 3 | 0.132549 | false | 1,391,608 | 0 | 0 | 1 | 3 |
In order to redeploy a GAE application, I currently have to install the GAE deployment tools on the system that I am using for deployment. While this process is relatively straight forward, the deployment process is a manual process that does not work from behind a firewall and the deployment tools must be installed on every machine that will be used for updating GAE apps. A more ideal solution would be if I could update a GAE application from another GAE application that I have deployed previously. This would remove the need to have multiple systems configured to deploy apps.
Since the GAE deployment tools are written in Python and the GAE App Engine supports Python, is it possible to modify appcfg.py to work from within GAE? The use case would be to pull a project from GitHub or some other online repository and update one GAE application from another GAE app. If this is not possible, what is the limiting constraint?
|
Is it possible to deploy one GAE application from another GAE application?
| 1,391,652 | 0 | 3 | 418 | 0 |
python,google-app-engine
|
What problem did you have by trying to update behind a firewall?
I've got some, but finally I manage to work around them.
About your question, the constraint is that you cannot write files into a GAE app, so even though you could possibly pull from the VCS you can't write those pulled files.
So you would have to update from outside the GAE in first place.
Anyway every machine that needs to update the GAE should have the SDK anyway just to see if they changes work.
So, If you really want to do this you have two alternatives:
Host your own "updater" site and istall the SDK there, then when you want to update log into your side ( or run a script ) and do the remote update.
Although I don't know Amazon EC2 well, I think you can do pretty much the same thing as op 1 from there.
Finally I think the password to update has to be typed always. ( you could have the SDK of the App engine and modify that, because it is open source )
| 0 | 1 | 0 | 0 |
2009-09-08T02:02:00.000
| 3 | 0 | false | 1,391,608 | 0 | 0 | 1 | 3 |
In order to redeploy a GAE application, I currently have to install the GAE deployment tools on the system that I am using for deployment. While this process is relatively straight forward, the deployment process is a manual process that does not work from behind a firewall and the deployment tools must be installed on every machine that will be used for updating GAE apps. A more ideal solution would be if I could update a GAE application from another GAE application that I have deployed previously. This would remove the need to have multiple systems configured to deploy apps.
Since the GAE deployment tools are written in Python and the GAE App Engine supports Python, is it possible to modify appcfg.py to work from within GAE? The use case would be to pull a project from GitHub or some other online repository and update one GAE application from another GAE app. If this is not possible, what is the limiting constraint?
|
Django and monkey patching issue
| 1,399,813 | 7 | 4 | 1,938 | 0 |
python,django,monkeypatching
|
When you add a field to any model, even if you do it the 'official' way, you need to migrate the database - Django doesn't do it for you. Drop the table and run ./manage.py syncdb again.
You might want to investigate one of the migrations frameworks, such as south, which will manage this sort of thing for you.
| 0 | 0 | 0 | 0 |
2009-09-09T13:40:00.000
| 5 | 1.2 | true | 1,399,746 | 0 | 0 | 1 | 1 |
I have recently started experimenting with Django for some web applications in my spare time. While designing the data model for one, I came across the dilemma of using inheritance to define a user of the website or using a technique known as monkey patching with the User class already supplied by the framework.
I tried to add a field by means of (after having defined all my models etc. without errors, according to python manage.py validate):
User.add_to_class('location', models.CharField(max_length=250,blank=True))
and executed the syncdb command. However, I keep getting this error
OperationalError: no such column:
auth_user.location
whether I am in the admin view of the site or the manage.py shell. There must be an extra step I'm missing, but there seems to be limited documentation on the whole monkey patching technique. So I'm asking you for assistance before I resort to inheritance. Any code, tips, or pointers to additional documentation are of course welcome.
Thanks in advance.
PS. I'm aware this technique is ugly, and probably ill-advised. ;)
|
How do I scroll a wxPython wx.html.HtmlWindow back down to where it was when the user clicked a link?
| 1,579,014 | 0 | 2 | 1,216 | 0 |
python,wxpython
|
Usually, click events are trigged by MouseUp events. If you track the mouse position by capturing any MouseDown events, you will know where the last click (MouseUp) happened, and that should allow you to reconstruct things.
For this particular problem, you might have to do a bit more work in MouseDown like checking if they are within the wxHtmlWindow control and if so, then saving something like a line number.
| 1 | 0 | 0 | 0 |
2009-09-09T14:45:00.000
| 4 | 0 | false | 1,400,179 | 0 | 0 | 1 | 1 |
I am using a wxPython wx.html.HtmlWindow to display part of my interface. The user can scroll down a list of links in a window smaller than the list. When they click on a link, I need to repaint the web page, but I want to return the page position back to where they clicked it.
I've tried MouseEvent.GetLogicalPosition() on the event, but it wants a DC and the best I've been able to do is get the same information as GetPosition(), so I must not be feeding it the right one.
I also tried HtmlWindow.CalcScrolledPosition(), but apparently that isn't available in HtmlWindow because I get a NotImplementedError...
What I would like is a scroll position that can be derived from the MouseEvent, or the OnLinkClicked information.
I know about HtmlWindow.ScrollToAnchor(), but it's flaky and unaesthetic -- I would prefer to bypass it if possible so that I can scroll back exactly to where the user clicked.
Thanks!
|
How do I keep state between requests in AppEngine (Python)?
| 1,406,768 | 3 | 1 | 564 | 0 |
python,google-app-engine
|
The ways to reliable keep state between requests are memcache, the datastore or through the user (cookies or post/get).
You can use the runtime cache too, but this is very unreliable as you don't know if a request will end up in the same runtime or the runtime can drop it's entire cache if it feels like it.
I really wouldn't use the runtime cache except for very specific situations, for example I use it to cache the serialization of objects to json as that is pretty slow and if the caching is gone I can regenerate the result easily.
| 0 | 1 | 0 | 0 |
2009-09-10T17:32:00.000
| 2 | 0.291313 | false | 1,406,636 | 0 | 0 | 1 | 1 |
I'm writing a simple app with AppEngine, using Python. After a successful insert by a user and redirect, I'd like to display a flash confirmation message on the next page.
What's the best way to keep state between one request and the next? Or is this not possible because AppEngine is distributed? I guess, the underlying question is whether AppEngine provides a persistent session object.
Thanks
Hannes
|
Twisted(asynch server) vs Django(or any other framework)
| 1,468,718 | 5 | 15 | 11,799 | 0 |
python,django,asynchronous,twisted,real-time
|
The biggest advantage for me is that Twisted gives me an application that has state, and can communicate with many different clients using many protocols.
For me, my Twisted server communicates with a number of sensors installed in houses and businesses that monitor power usage. It stores the data and keeps recent data and state in handy-dandy python classes in memory. Requests via xmlrpc from django get this state and can present recent data to the user. My Gridspy stuff is still in development so the actual site at your.gridspy.co.nz is a bit pre-alpha.
The best part is that you need surprisingly little code to make an effective server. An amazing amount of the work is done for you.
| 0 | 1 | 0 | 0 |
2009-09-11T17:09:00.000
| 6 | 0.16514 | false | 1,412,169 | 0 | 0 | 1 | 4 |
I need help understanding what the advantage of using an asynch framework is. Suppose I want to develop a simple chat web app. Why cant I write python code in the Django framework that does long polling where I dont send a response back the server until someone enters a new msg. What does Twisted provide that gives it an advantage for real-time apps like the chat app?
Sorry I am obviously little confused about the need for an asynchronous framework.
|
Twisted(asynch server) vs Django(or any other framework)
| 1,417,358 | 3 | 15 | 11,799 | 0 |
python,django,asynchronous,twisted,real-time
|
In twisted you can implement protocols of your own. Django certainly can't do this.
| 0 | 1 | 0 | 0 |
2009-09-11T17:09:00.000
| 6 | 0.099668 | false | 1,412,169 | 0 | 0 | 1 | 4 |
I need help understanding what the advantage of using an asynch framework is. Suppose I want to develop a simple chat web app. Why cant I write python code in the Django framework that does long polling where I dont send a response back the server until someone enters a new msg. What does Twisted provide that gives it an advantage for real-time apps like the chat app?
Sorry I am obviously little confused about the need for an asynchronous framework.
|
Twisted(asynch server) vs Django(or any other framework)
| 1,412,226 | 16 | 15 | 11,799 | 0 |
python,django,asynchronous,twisted,real-time
|
Asynchronous servers support much larger numbers of simultaneous client connections. More conventional servers come up against thread and process limits when servicing large number of concurrent clients, particularly those with long-lived connections. Async servers can also provide better performance as they avoid the overheads of e.g. thread context switching.
As well as the Twisted framework, there are also asynchronous server building blocks in Python's standard library: previously asyncore and asynchat, but now also asyncio.
| 0 | 1 | 0 | 0 |
2009-09-11T17:09:00.000
| 6 | 1.2 | true | 1,412,169 | 0 | 0 | 1 | 4 |
I need help understanding what the advantage of using an asynch framework is. Suppose I want to develop a simple chat web app. Why cant I write python code in the Django framework that does long polling where I dont send a response back the server until someone enters a new msg. What does Twisted provide that gives it an advantage for real-time apps like the chat app?
Sorry I am obviously little confused about the need for an asynchronous framework.
|
Twisted(asynch server) vs Django(or any other framework)
| 1,412,372 | 19 | 15 | 11,799 | 0 |
python,django,asynchronous,twisted,real-time
|
First off Django is a framework for writing web apps so it provides ORM, html templating, it requires running an http server etc. Twisted helps to write much lower level code than that. You could use twisted to write the http server Django runs on. If you use Django you are limited to http model, with twisted it could be communicating in any protocol you like including push protocols. So for your chat example you get a server that scales better since it can push comments to people who have logged in VS with django every client having to poll repeatedly.
edited to reflect comments by: sos-skyl
| 0 | 1 | 0 | 0 |
2009-09-11T17:09:00.000
| 6 | 1 | false | 1,412,169 | 0 | 0 | 1 | 4 |
I need help understanding what the advantage of using an asynch framework is. Suppose I want to develop a simple chat web app. Why cant I write python code in the Django framework that does long polling where I dont send a response back the server until someone enters a new msg. What does Twisted provide that gives it an advantage for real-time apps like the chat app?
Sorry I am obviously little confused about the need for an asynchronous framework.
|
Resources for developing Python and Google App Engine
| 1,415,236 | 3 | 2 | 471 | 0 |
python,google-app-engine,user-controls,controls
|
The google app engine "Getting Started" tutorial is very good. The django documentation is also really detailed.
Take a look at GoogleIO on youtube and watch some of the tutorials.
| 0 | 1 | 0 | 0 |
2009-09-12T14:07:00.000
| 3 | 0.197375 | false | 1,415,208 | 0 | 0 | 1 | 2 |
I would like to ask about some sources for developing applications with Python and Google App Engine.
For example, some controls to generate automatically pages with the insert/update/delete of a database table, or any other useful resources are welcome.
Thank you!
|
Resources for developing Python and Google App Engine
| 1,419,518 | 7 | 2 | 471 | 0 |
python,google-app-engine,user-controls,controls
|
The Python community tends to look askance at code generation; so, @Hoang, if you think code generation is THE way to go, I suggest you try just about any other language BUT Python.
@Dominic has already suggested some excellent resources, I could point you to more (App Engine Fan, App Engine Utilities, etc, etc) but they're all based on the Pythonic mindset: understand what you need and what you could be doing, wrap as much of it as feasible into reusable components, reuse those components from your own sources.
You want magic, wizards and code generation that basically excused you (in theory) from STUDYING and UNDERSTANDING: give up on Python, it's SO not the language for that,
| 0 | 1 | 0 | 0 |
2009-09-12T14:07:00.000
| 3 | 1.2 | true | 1,415,208 | 0 | 0 | 1 | 2 |
I would like to ask about some sources for developing applications with Python and Google App Engine.
For example, some controls to generate automatically pages with the insert/update/delete of a database table, or any other useful resources are welcome.
Thank you!
|
To Ruby or not to Ruby
| 25,123,266 | 0 | 1 | 567 | 0 |
python,ruby
|
Using Ruby für two years now , i find it powerful, easy to learn, having good libraries, good community.
But how should we know if it fits your needs? Try it an you will find out.
| 0 | 0 | 0 | 1 |
2009-09-13T00:59:00.000
| 6 | 0 | false | 1,416,570 | 0 | 0 | 1 | 5 |
I know that this is a difficult question to answer, but I thought I would try anwyays....
I am just starting at a new company where they have a minimal existing code base. It probably has a month of man effort invested at this point. It is currently written in Ruby.
It is also currently using Ruby on Rails -- but mostly just for the sake of testing out the Ruby code.
The ultimate goal of the code is actually to drive a backend to a site that will be written in php (could be a backend to Drupal, Echo, etc...).
I have no experience with Ruby, so I would tend to want to go with a language I know better (like Python), but am not willing to rule Ruby out for no reason.
If you are not going to use Ruby for a Rails project, is it still worth it? Will I be better off going with Python or some other language?
How do the libraries stack up?
Thanks!!!
|
To Ruby or not to Ruby
| 1,416,827 | 4 | 1 | 567 | 0 |
python,ruby
|
Ruby Madness. Sure, it seems cool, but it might lead to the hard stuff: Lisp
My predictions:
It's pretty clear that you are OK with either Ruby or Python, and obviously php can be made to work.
You will really like Ruby.
I'm a little bit worried that after Ruby the only place left to go will be Lisp, and that I will become one of those raving lisp maniacs with bad haircuts waving my arms and muttering about The One True Macro Processor.
Slightly more seriously, though Lisp and Smalltalk are still in tiny niche spaces after 60 and 40 years, it turns out that the child of the two bore fruit. Various Lisp and Smalltalk hackers are starting to show up speaking about their child Ruby at Ruby and Rails cons. As it happens, Ruby (timeframe 15 years) has quite a bit of the Lisp and Smalltalk magic.
And, to this party, Ruby brings about every single bit of the day-to-day and 3-line-script usefulness of Perl. Ruby is an explosion on the language scene that combines the scripting superpower of Perl with the object-orient superpower of an exotic language like Smalltalk.
Ruby is an awesome and groundbreaking language with or without Rails. I say, drink the kool-aid.
| 0 | 0 | 0 | 1 |
2009-09-13T00:59:00.000
| 6 | 0.132549 | false | 1,416,570 | 0 | 0 | 1 | 5 |
I know that this is a difficult question to answer, but I thought I would try anwyays....
I am just starting at a new company where they have a minimal existing code base. It probably has a month of man effort invested at this point. It is currently written in Ruby.
It is also currently using Ruby on Rails -- but mostly just for the sake of testing out the Ruby code.
The ultimate goal of the code is actually to drive a backend to a site that will be written in php (could be a backend to Drupal, Echo, etc...).
I have no experience with Ruby, so I would tend to want to go with a language I know better (like Python), but am not willing to rule Ruby out for no reason.
If you are not going to use Ruby for a Rails project, is it still worth it? Will I be better off going with Python or some other language?
How do the libraries stack up?
Thanks!!!
|
To Ruby or not to Ruby
| 1,416,574 | 1 | 1 | 567 | 0 |
python,ruby
|
Rails apps can potentially make a great REST backend for a php based system.
The REST stuff is made for it. You want xml? ok. You want json? ok.
If you and the staff aren't comfy with it, use something you are more comfy in to write a REST interface. :)
| 0 | 0 | 0 | 1 |
2009-09-13T00:59:00.000
| 6 | 0.033321 | false | 1,416,570 | 0 | 0 | 1 | 5 |
I know that this is a difficult question to answer, but I thought I would try anwyays....
I am just starting at a new company where they have a minimal existing code base. It probably has a month of man effort invested at this point. It is currently written in Ruby.
It is also currently using Ruby on Rails -- but mostly just for the sake of testing out the Ruby code.
The ultimate goal of the code is actually to drive a backend to a site that will be written in php (could be a backend to Drupal, Echo, etc...).
I have no experience with Ruby, so I would tend to want to go with a language I know better (like Python), but am not willing to rule Ruby out for no reason.
If you are not going to use Ruby for a Rails project, is it still worth it? Will I be better off going with Python or some other language?
How do the libraries stack up?
Thanks!!!
|
To Ruby or not to Ruby
| 1,416,583 | 0 | 1 | 567 | 0 |
python,ruby
|
Why wouldn't you just keep it consistent and use PHP?
| 0 | 0 | 0 | 1 |
2009-09-13T00:59:00.000
| 6 | 0 | false | 1,416,570 | 0 | 0 | 1 | 5 |
I know that this is a difficult question to answer, but I thought I would try anwyays....
I am just starting at a new company where they have a minimal existing code base. It probably has a month of man effort invested at this point. It is currently written in Ruby.
It is also currently using Ruby on Rails -- but mostly just for the sake of testing out the Ruby code.
The ultimate goal of the code is actually to drive a backend to a site that will be written in php (could be a backend to Drupal, Echo, etc...).
I have no experience with Ruby, so I would tend to want to go with a language I know better (like Python), but am not willing to rule Ruby out for no reason.
If you are not going to use Ruby for a Rails project, is it still worth it? Will I be better off going with Python or some other language?
How do the libraries stack up?
Thanks!!!
|
To Ruby or not to Ruby
| 1,416,625 | 0 | 1 | 567 | 0 |
python,ruby
|
IMO, if you're comfortable with Python then you shouldn't have too much trouble picking up Ruby. This doesn't mean Ruby is the best choice - you should still evaluate the options.
| 0 | 0 | 0 | 1 |
2009-09-13T00:59:00.000
| 6 | 0 | false | 1,416,570 | 0 | 0 | 1 | 5 |
I know that this is a difficult question to answer, but I thought I would try anwyays....
I am just starting at a new company where they have a minimal existing code base. It probably has a month of man effort invested at this point. It is currently written in Ruby.
It is also currently using Ruby on Rails -- but mostly just for the sake of testing out the Ruby code.
The ultimate goal of the code is actually to drive a backend to a site that will be written in php (could be a backend to Drupal, Echo, etc...).
I have no experience with Ruby, so I would tend to want to go with a language I know better (like Python), but am not willing to rule Ruby out for no reason.
If you are not going to use Ruby for a Rails project, is it still worth it? Will I be better off going with Python or some other language?
How do the libraries stack up?
Thanks!!!
|
Google appengine string replacement in template file
| 1,416,947 | 1 | 0 | 600 | 0 |
python,google-app-engine
|
Apart from the argument-less .fetch() call in your code, which I believe can't possibly work (you ALWAYS have to pass fetch an argument -- the max number of entities you're willing to fetch!), I can't reproduce your problem -- assigning a new attribute (including one obtained by processing existing ones) to each item just works fine in my tests.
Can you please reproduce your observed problem in as tiny as compass as possible and edit your question to include all relevant files pls? Seems to be the only way we could help you with your weird observed bug!
BTW, select name,LEFT( description, 50 ) or whatever OF COURSE won't work in GQL -- GQL, very very explicitly, ONLY supports select * to get whole entities, or select __key__ to get just the entities' keys -- that's all; NO selectivity of columns in the select, much less any OPERATIONS on them!-)
| 0 | 1 | 0 | 0 |
2009-09-13T05:23:00.000
| 2 | 0.099668 | false | 1,416,921 | 0 | 0 | 1 | 1 |
I'm using google appengine (python, of course :) ) and I'd like to do a string.replace on a string from the template file.
{% for item in items %}
<p>{{ item.code.replace( '_', ' ' ) }}</p>
{% endfor %}
But that isn't working. So we cannot execute anything other than basic checks in the app engine templates. Is that Correct ?
Another related problem is I'm trying to shorten a string and make it available to the template.
Each furniture object has a name and a longer description field. In this view I'm rendering, I want only the first 50 characters of the description field.
So I tried something like
items = db.GqlQuery( 'select * from furniture' )
# edit: if you change the above line to
# items = db.GqlQuery( 'select * from furniture' ).fetch( 1000 )
# the .fetch() command makes the addition of dynamic properties work!
for item in items :
item.shortdescr = item.description[ 0:50 ]
# pass data off to template for rendering
self.response.out.write(
template.render( 'furnitureAll.html', { 'items' : items } )
)
Template goes
{% for item in items %}
<p>{{ item.name }}</p>
<p>{{ item.shortdescr }}</p>
<!-- items.shortdescr does not exist here,
probably because I did not .put() it previously. -->
{% endfor %}
Since that didn't work, I tried changing the Gql Query to shorten the string instead. But I'm quickly realizing Gql isn't like SQL. I'm trying to write queries like
select name,LEFT( description, 50 ) from furniture
With little success
|
How to Model a Foreign Key in a Reusable Django App?
| 1,419,548 | 0 | 17 | 3,459 | 0 |
python,django,django-models
|
Probably you need to use the content types app to link to a model. You might then arrange for your app to check the settings to do some additional checking to limit which content types it will accept or suggest.
| 0 | 0 | 0 | 0 |
2009-09-14T02:24:00.000
| 6 | 0 | false | 1,419,442 | 0 | 0 | 1 | 1 |
In my django site I have two apps, blog and links. blog has a model blogpost, and links has a model link. There should be a one to many relationship between these two things. There are many links per blogpost, but each link has one and only one blog post. The simple answer is to put a ForeignKey to blogpost in the link model.
That's all well and good, however there is a problem. I want to make the links app reusable. I don't want it to depend upon the blog app. I want to be able to use it again in other sites and perhaps associate links with other non-blogpost apps and models.
A generic foreign key seems like it might be the answer, but not really. I don't want links to be able to associate with any model in my site. Just the one that I explicitly specify. And I know from prior experience that there can be issues using generic foreign keys in terms of database usage because you can't do a select_related over a generic foreign key the way you can with a regular foreign key.
What is the "correct" way to model this relationship?
|
web framework compatible with python 3.1 and py-postgresql
| 1,934,744 | 0 | 1 | 1,695 | 1 |
python,web-applications,python-3.x,wsgi
|
Even though it's not officially released yet, I am currently 'playing around' with CherryPy 3.2.0rc1 with Python 3.1.1 and have had no problems yet. Haven't used it with py-postgresql, but I don't see why it shouldn't work.
Hope this helps,
Alan
| 0 | 0 | 0 | 0 |
2009-09-14T17:56:00.000
| 4 | 0 | false | 1,423,000 | 0 | 0 | 1 | 1 |
I have started learning Python by writing a small application using Python 3.1 and py-PostgreSQL. Now I want to turn it into a web application.
But it seems that most frameworks such as web-py, Django, zope are still based on Python 2.x. Unfortunately, py-PostgreSQL is incompatible with Python 2.x.
Do I have to rewrite all my classes and replace py-PostgreSQL with something supported by web-py etc., or is there a framework compatible with Python 3.1?
Or maybe py-PostgreSQL is compatible with 2.x but I did not figure it out?
|
What python web frameworks work well with CGI (e.g. on nearlyfreespeech.net)?
| 1,423,084 | 0 | 6 | 1,934 | 0 |
python,frameworks,cgi,nearlyfreespeech
|
By the things they reject. I think that twisted.web is still an option there, but I don't have any experience with nearlyfreespeech.net
| 0 | 0 | 0 | 0 |
2009-09-14T18:03:00.000
| 4 | 0 | false | 1,423,041 | 0 | 0 | 1 | 1 |
From nearlyfreespeech's website, they state that the following don't work well:
mod_python Web application
frameworks that depend on persistent processes, including: Ruby On Rails, Django, Zope, and others (some of these will run under CGI, but will run slowly and are suitable only for development purposes)
Are there any Python web frameworks that work well on NearlyFreeSpeech?
|
Komodo Edit - code-completion for Django?
| 1,424,443 | 8 | 2 | 6,602 | 0 |
python,django,ide,code-completion,komodo
|
o to Edit > Preferences. Expand the
"Languages" group by clicking the [+]
symbol. Click "Python". Click the
little "Add..." button under
"Additional Python Import
Directories". Add the directory ABOVE
your project and you should have
intellisense enabled.
This has always worked for me for both Django and my individual projects.
| 0 | 0 | 0 | 0 |
2009-09-14T23:26:00.000
| 3 | 1 | false | 1,424,392 | 0 | 0 | 1 | 3 |
I've been using Komodo Edit for a small project in Django.
The code completion features seem to work pretty well for standard python modules, however, it doesn't know anything about Django modules. Is there any way to configure Komodo Edit to use Django modules for autocomplete as well?
|
Komodo Edit - code-completion for Django?
| 1,424,422 | 4 | 2 | 6,602 | 0 |
python,django,ide,code-completion,komodo
|
By sure Django is on your python path and Komodo should pick it up. Alternatively you can add the location of Django to where Komodo looks for its autocomplete.
| 0 | 0 | 0 | 0 |
2009-09-14T23:26:00.000
| 3 | 1.2 | true | 1,424,392 | 0 | 0 | 1 | 3 |
I've been using Komodo Edit for a small project in Django.
The code completion features seem to work pretty well for standard python modules, however, it doesn't know anything about Django modules. Is there any way to configure Komodo Edit to use Django modules for autocomplete as well?
|
Komodo Edit - code-completion for Django?
| 1,424,499 | 2 | 2 | 6,602 | 0 |
python,django,ide,code-completion,komodo
|
Hmmm. It's installed by default so my answer probably isn't the right solution. :-)
But here goes...
You can install a Django extension in Komodo edit. I haven't tested it myself but you can test it.
Tools -> Add-ons -> Extensions
It's name is "Django Language".
Check if it works.
| 0 | 0 | 0 | 0 |
2009-09-14T23:26:00.000
| 3 | 0.132549 | false | 1,424,392 | 0 | 0 | 1 | 3 |
I've been using Komodo Edit for a small project in Django.
The code completion features seem to work pretty well for standard python modules, however, it doesn't know anything about Django modules. Is there any way to configure Komodo Edit to use Django modules for autocomplete as well?
|
Live UI update of model changes when the model contains plain data structures only
| 1,426,368 | 0 | 1 | 108 | 0 |
python,design-patterns,architecture
|
You may be operating under a mis-conception: pickles don't include the code from classes that are pickled. You can add methods to your data structures, and it will not increase the size of your pickles.
This is a common misunderstanding about pickles. They don't include code.
| 0 | 0 | 0 | 0 |
2009-09-15T10:05:00.000
| 2 | 0 | false | 1,426,272 | 0 | 0 | 1 | 1 |
Please consult me with your opinions on the following topic:
I have a model - a structure of the objects. Such as:
Event, containing participants
Current task
Assignee of each task
The model is going to be pickled on the server and transferred over the network to the client GUI application. Because of the pickle I'd want to keep the model classes as simple as possible (i.e. just simple classes with data fields only, no any single method inside). As a result I can't create signals (such as OnUpdate) on the model objects.
Sometimes the server will send model updates. Such as "Task text changed". When the update is applied, I need it to be reflected in the UI. In the case of task text change it shall be change of the label in the UI. I'd want only related controls to be changed, so the whole UI update is not the best solution.
On the other hand, would not like to traverse the whole model in the search of changes - that would be too resource intensive.
So, what is the best pattern of notifying the UI about changes on the plain data structures?
|
Proxy for Google App Engine
| 1,427,324 | 1 | 2 | 5,503 | 0 |
python,google-app-engine,proxy
|
SOCKS is not an HTTP-based protocol, so it's not possible to write a SOCKS proxy on App Engine.
Edit: Note I wrote the above when you were specifically referring to a SOCKS proxy.
Regarding general HTTP proxy servers, you can't really do that on App Engine, either, because proxies need to be able to accept requests for any hostname; your App Engine app will only accept requests for the hosts you're serving off it.
You could write an 'anonymizer' type interface on App Engine, but it's not a true proxy, because it will require rewriting URLs to work.
| 0 | 1 | 0 | 0 |
2009-09-15T12:08:00.000
| 3 | 0.066568 | false | 1,426,779 | 0 | 0 | 1 | 1 |
I am looking for a basic open source http proxy server for Google App Engine.
Preferably written in Python. Any suggestions?
|
Kill sub-threads when Django restarts?
| 1,430,541 | 0 | 0 | 1,029 | 0 |
python,django,multithreading
|
What are you using to restart django? I'd put something in that script to look for process id's in the socket file(s) and kill those before starting django.
Alternatively, you could be very heavy handed and just run something like 'pkill -9 *django*' before your django startup sequence.
| 0 | 0 | 0 | 0 |
2009-09-16T01:51:00.000
| 2 | 0 | false | 1,430,517 | 0 | 0 | 1 | 1 |
I'm running Django, and I'm creating threads that run in parallel while Django runs. Those threads sometimes run external processes that block while waiting for external input.
When I restart Django, those threads that are blocking while awaiting external input sometimes persist through the restart, and further they have and keep open Port 8080 so Django can't restart.
If I knew when Django was restarting, I could kill those threads. How can I tell when Django is restarting so that I can kill those threads (and their spawn).
It wasn't obvious from django.utils.autoreload where any hooks may be to tell when a restart is occurring.
Is there an alternative way to kill these threads when Django starts up?
Thanks for reading.
Brian
|
Python HTML Minimizer
| 1,531,684 | 2 | 1 | 1,549 | 0 |
python,html,minimize
|
there are bindings to tidy for python, called mxTidy from eGenix (Marc André Lemburg)
| 0 | 0 | 0 | 1 |
2009-09-17T07:59:00.000
| 3 | 0.132549 | false | 1,437,357 | 0 | 0 | 1 | 1 |
I have a cherrypy web server that uses larges amounts of HTML data. Is there anyway in Python to minimize the HTML so that all comments, spaces, ext, are removed?
|
Whats the proper idiom for naming django model fields that are python reserved names?
| 1,446,128 | 1 | 5 | 412 | 0 |
python,django,idioms
|
Do you really want to use the db_column="complex" argument and call your field something else?
| 0 | 0 | 0 | 0 |
2009-09-18T17:48:00.000
| 2 | 0.099668 | false | 1,445,971 | 0 | 0 | 1 | 1 |
I have a model that needs to have a field named complex and another one named type. Those are both python reserved names. According to PEP 8, I should name them complex_ and type_ respectively, but django won't allow me to have fields named with a trailing underscore. Whats the proper way to handle this?
|
Passing Python Data to JavaScript via Django
| 1,446,136 | 3 | 59 | 89,362 | 0 |
javascript,python,django
|
You can include <script> tags inside your .html templates, and then build your data structures however is convenient for you. The template language isn't only for HTML, it can also do Javascript object literals.
And Paul is right: it might be best to use a json module to create a JSON string, then insert that string into the template. That will handle the quoting issues best, and deal with deep structures with ease.
| 0 | 0 | 0 | 0 |
2009-09-18T17:52:00.000
| 8 | 0.07486 | false | 1,445,989 | 0 | 0 | 1 | 3 |
I'm using Django and Apache to serve webpages. My JavaScript code currently includes a data object with values to be displayed in various HTML widgets based on the user's selection from a menu of choices. I want to derive these data from a Python dictionary. I think I know how to embed the JavaScript code in the HTML, but how do I embed the data object in that script (on the fly) so the script's functions can use it?
Put another way, I want to create a JavaScript object or array from a Python dictionary, then insert that object into the JavaScript code, and then insert that JavaScript code into the HTML.
I suppose this structure (e.g., data embedded in variables in the JavaScript code) is suboptimal, but as a newbie I don't know the alternatives. I've seen write-ups of Django serialization functions, but these don't help me until I can get the data into my JavaScript code in the first place.
I'm not (yet) using a JavaScript library like jQuery.
|
Passing Python Data to JavaScript via Django
| 1,446,060 | 2 | 59 | 89,362 | 0 |
javascript,python,django
|
It is suboptimal. Have you considered passing your data as JSON using django's built in serializer for that?
| 0 | 0 | 0 | 0 |
2009-09-18T17:52:00.000
| 8 | 0.049958 | false | 1,445,989 | 0 | 0 | 1 | 3 |
I'm using Django and Apache to serve webpages. My JavaScript code currently includes a data object with values to be displayed in various HTML widgets based on the user's selection from a menu of choices. I want to derive these data from a Python dictionary. I think I know how to embed the JavaScript code in the HTML, but how do I embed the data object in that script (on the fly) so the script's functions can use it?
Put another way, I want to create a JavaScript object or array from a Python dictionary, then insert that object into the JavaScript code, and then insert that JavaScript code into the HTML.
I suppose this structure (e.g., data embedded in variables in the JavaScript code) is suboptimal, but as a newbie I don't know the alternatives. I've seen write-ups of Django serialization functions, but these don't help me until I can get the data into my JavaScript code in the first place.
I'm not (yet) using a JavaScript library like jQuery.
|
Passing Python Data to JavaScript via Django
| 1,448,178 | 1 | 59 | 89,362 | 0 |
javascript,python,django
|
Putting Java Script embedded into Django template is rather always bad idea.
Rather, because there are some exceptions from this rule.
Everything depends on the your Java Script code site and functionality.
It is better to have seperately static files, like JS, but the problem is that every seperate file needs another connect/GET/request/response mechanism. Sometimes for small one, two liners code os JS to put this into template, bun then use django templatetags mechanism - you can use is in other templates ;)
About objects - the same. If your site has AJAX construction/web2.0 like favour - you can achieve very good effect putting some count/math operation onto client side. If objects are small - embedded into template, if large - response them in another connection to avoid hangind page for user.
| 0 | 0 | 0 | 0 |
2009-09-18T17:52:00.000
| 8 | 0.024995 | false | 1,445,989 | 0 | 0 | 1 | 3 |
I'm using Django and Apache to serve webpages. My JavaScript code currently includes a data object with values to be displayed in various HTML widgets based on the user's selection from a menu of choices. I want to derive these data from a Python dictionary. I think I know how to embed the JavaScript code in the HTML, but how do I embed the data object in that script (on the fly) so the script's functions can use it?
Put another way, I want to create a JavaScript object or array from a Python dictionary, then insert that object into the JavaScript code, and then insert that JavaScript code into the HTML.
I suppose this structure (e.g., data embedded in variables in the JavaScript code) is suboptimal, but as a newbie I don't know the alternatives. I've seen write-ups of Django serialization functions, but these don't help me until I can get the data into my JavaScript code in the first place.
I'm not (yet) using a JavaScript library like jQuery.
|
Role-based security with Google App Engine and Python
| 1,448,733 | 4 | 5 | 2,588 | 0 |
python,google-app-engine,role-based
|
I would do this by adding a ListProperty for roles to the model representing users. The list contains any roles a given user belongs to. This way if you want to know whether a given user belongs to a given role (I expect, the most common operation), it is a fast membership test.
You could put the role names directly into the lists as strings or add a layer of indirection to another entity specifying the details about the role so it is easy to change the details later. But, this has a runtime cost of an additional RPC to fetch the details about the role.
The downside to this method comes if you want to remove all users from a given role, or perform any other kind of global operation. I suppose you could mark a role 'deleted', but then you still have data cluttering up all your user models until you clean them up manually. So I am curious to hear what others suggest.
| 0 | 0 | 0 | 0 |
2009-09-19T10:42:00.000
| 1 | 1.2 | true | 1,448,308 | 0 | 0 | 1 | 1 |
I would like to ask what is the common way for handling role-based security with Google App Engine, Python?
In the app.yaml, there is the "login" section, but available values are only "admin" and "required".
How do you normally handle role-based security?
Create the model with two tables: Roles and UserRoles
Import values for Roles table
Manually add User to UserRoles
Check if user is in the right Roles group
Any other idea or any other method for role-based security, please let us know!
|
How can I get the domain name of my site within a Django template?
| 1,451,155 | 85 | 202 | 188,129 | 0 |
python,django,django-templates
|
I think what you want is to have access to the request context, see RequestContext.
| 0 | 0 | 0 | 0 |
2009-09-20T14:27:00.000
| 18 | 1.2 | true | 1,451,138 | 0 | 0 | 1 | 2 |
How do I get the domain name of my current site from within a Django template? I've tried looking in the tag and filters but nothing there.
|
How can I get the domain name of my site within a Django template?
| 23,763,770 | -6 | 202 | 188,129 | 0 |
python,django,django-templates
|
You can use {{ protocol }}://{{ domain }} in your templates to get your domain name.
| 0 | 0 | 0 | 0 |
2009-09-20T14:27:00.000
| 18 | -1 | false | 1,451,138 | 0 | 0 | 1 | 2 |
How do I get the domain name of my current site from within a Django template? I've tried looking in the tag and filters but nothing there.
|
How to rapidly build a Web Application?
| 1,452,676 | 4 | 5 | 4,394 | 0 |
java,php,python,ruby-on-rails
|
You've already tagged your question with "java", "php", "python", and "ruby-on-rails", so researching and learning more about those tools would probably help to answer your question.
However, I believe that rapidly building an application is almost never actually the correct goal. Normally, what you want to do is build an application that can be rapidly maintained -- that is, maintained with the lowest possible overall development cost over time.
| 0 | 0 | 0 | 0 |
2009-09-21T02:44:00.000
| 8 | 0.099668 | false | 1,452,652 | 0 | 0 | 1 | 4 |
To build a Web Application, what kind of open source web application frameworks / technologies are currently present that would be:
Faster to learn.
Ease of use.
Have widgets for rapid development(From a GUI perspective).
Database integration.
I would want this web app to communicate to a Java client.
I am not bound to Java on the server side and free to try out any good rapid application framework.
To summarize, I haven't done much work for the server side hence am not conversant with the tools and technologies for the same.
What would you suggest?
Any and every input would be welcome!...
|
How to rapidly build a Web Application?
| 1,452,751 | 1 | 5 | 4,394 | 0 |
java,php,python,ruby-on-rails
|
Speaking only in terms of speed of development, Ruby on Rails is the fastest one out there.
| 0 | 0 | 0 | 0 |
2009-09-21T02:44:00.000
| 8 | 0.024995 | false | 1,452,652 | 0 | 0 | 1 | 4 |
To build a Web Application, what kind of open source web application frameworks / technologies are currently present that would be:
Faster to learn.
Ease of use.
Have widgets for rapid development(From a GUI perspective).
Database integration.
I would want this web app to communicate to a Java client.
I am not bound to Java on the server side and free to try out any good rapid application framework.
To summarize, I haven't done much work for the server side hence am not conversant with the tools and technologies for the same.
What would you suggest?
Any and every input would be welcome!...
|
How to rapidly build a Web Application?
| 1,453,699 | 2 | 5 | 4,394 | 0 |
java,php,python,ruby-on-rails
|
I would say part of the learning curve will go into understanding concepts. I have been learning about web-apps for some months now, and with my improved understanding of concepts right now, most frameworks show very much similarities. Here are my results so far:
PHP: Great to learn about concepts for doing forms, http-post-requests, http-get-requests. easy interaction with database layer, and it is possible to obtain a working basic application in couple of hours. Almost no hassle with build-systems and web-server configuration.
Ruby-on-Rails: Great to learn about REST and more complicated CRUD applications. Great to learn about the complexity behind MVC and especially simple and powerful interaction with the database layer by using ActiveRecord. Introduction of meta-programming (code-that-writes-code, code-scaffolding) is great. Nice opportunities for free cloud-deployment, e.g. heroku.com and there is a very active community
Java: Powerful interaction with web-server possible (Tomcat, JBoss, ...) MVC is rather complicated here, and in general many configuration-steps necessary (build systems, ORM layer, ...) Grails is a great simplifaction and introduces meta-programming for Java. Jboss Seam introduces REST for Java (but have not looked into this yet)
| 0 | 0 | 0 | 0 |
2009-09-21T02:44:00.000
| 8 | 0.049958 | false | 1,452,652 | 0 | 0 | 1 | 4 |
To build a Web Application, what kind of open source web application frameworks / technologies are currently present that would be:
Faster to learn.
Ease of use.
Have widgets for rapid development(From a GUI perspective).
Database integration.
I would want this web app to communicate to a Java client.
I am not bound to Java on the server side and free to try out any good rapid application framework.
To summarize, I haven't done much work for the server side hence am not conversant with the tools and technologies for the same.
What would you suggest?
Any and every input would be welcome!...
|
How to rapidly build a Web Application?
| 1,452,667 | 1 | 5 | 4,394 | 0 |
java,php,python,ruby-on-rails
|
There are tons, which ones are "good" depend on what you need.
There's Ruby on Rails, which is pretty handy.
For python there's django.
For PHP (I spend a lot of time dealing with PHP), you can look at:
symfony
cakePHP
Solar
Zend Framework
Which are all good in certain situations, and annoying in others.
| 0 | 0 | 0 | 0 |
2009-09-21T02:44:00.000
| 8 | 0.024995 | false | 1,452,652 | 0 | 0 | 1 | 4 |
To build a Web Application, what kind of open source web application frameworks / technologies are currently present that would be:
Faster to learn.
Ease of use.
Have widgets for rapid development(From a GUI perspective).
Database integration.
I would want this web app to communicate to a Java client.
I am not bound to Java on the server side and free to try out any good rapid application framework.
To summarize, I haven't done much work for the server side hence am not conversant with the tools and technologies for the same.
What would you suggest?
Any and every input would be welcome!...
|
Modify address in Django middleware
| 1,460,317 | 1 | 3 | 1,984 | 0 |
python,django,django-urls,django-middleware
|
I think this really depends on your problem and what exactly you are trying to do.
You cannot change the URL without redirecting the user, as you cannot modify the URL on a page without a reload. Basically a redirect is a response telling the user to move on, there is no way to actually change the URL. Note that even if you do it in something like JavaScript you basically do the same as a redirect, so it can't be done client or server side.
I think it might help if you explain to us why you need to pass this information via the URL. Why not store data in the session?
I guess you could add the data to the request object but that doesn't add it to the URL.
| 0 | 0 | 0 | 0 |
2009-09-22T08:41:00.000
| 3 | 1.2 | true | 1,458,829 | 0 | 0 | 1 | 2 |
I don't know if it's possible but I'd like to add few parameters at the end of the URL using middleware. Can it be done without redirect after modyfing requested URL?
ie.
user clicks: .../some_link
and middleware rewrites it to: .../some_link?par1=1&par2=2
Other way is to modify reponse and replace every HTML link but it's not something I'd like to do.
Thanks
|
Modify address in Django middleware
| 1,458,950 | 0 | 3 | 1,984 | 0 |
python,django,django-urls,django-middleware
|
You can do whatever you like in the middleware. You have access to the request object, you can get the URL and redirect to a new one if you want.
My question would be, why do you want to do this? If you need to keep information about the request, the proper place to do this is in the session.
| 0 | 0 | 0 | 0 |
2009-09-22T08:41:00.000
| 3 | 0 | false | 1,458,829 | 0 | 0 | 1 | 2 |
I don't know if it's possible but I'd like to add few parameters at the end of the URL using middleware. Can it be done without redirect after modyfing requested URL?
ie.
user clicks: .../some_link
and middleware rewrites it to: .../some_link?par1=1&par2=2
Other way is to modify reponse and replace every HTML link but it's not something I'd like to do.
Thanks
|
appengine and no-ip.org
| 1,480,797 | 1 | 0 | 875 | 0 |
python,google-app-engine,dns,subdomain
|
You can't do this, because you don't own no-ip.org. In order to use a domain with App Engine, you have to set up Google Apps on the domain, and in order to do that, you must own the domain.
As mentioned in the comments, buying your own domain is your best option.
| 0 | 1 | 0 | 0 |
2009-09-23T12:47:00.000
| 5 | 0.039979 | false | 1,465,769 | 0 | 0 | 1 | 1 |
I'd like to run an appengine app on a subdomain
like something.no-ip.org instead of something.appspot.com
is this doable? If so, can you please help me understand? :)
Thank you so much for your help!
|
Install mysqldb on snow leopard
| 6,537,345 | 7 | 7 | 7,786 | 1 |
python,mysql,django,osx-snow-leopard
|
On MAC OS X 10.6, Install the package as usual. The dynamic import error occurs because of wrong DYLD path. Export the path and open up a python terminal.
$ sudo python setup.py clean
$ sudo python setup.py build
$ sudo python setup.py install
$ export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH
$python
import MySQLdb
Now import MySQLdb should work fine.
You may also want to manually remove the build folder, before build and install. The clean command does not do a proper task of cleaning up the build files.
| 0 | 0 | 0 | 0 |
2009-09-23T13:01:00.000
| 8 | 1 | false | 1,465,846 | 0 | 0 | 1 | 1 |
I am trying to get started on working with Python on Django I am by profession a PHP developer and have been told to set up django and python on my current apache and mysql setup however I am having trouble getting the Mysqldb module for python to work, I must of followed about 6 different set of instructions, I am running snow leopard and have mysql installed natively it is not part of MAMP or similar. Please can some tell me where I need to start and what steps I need to follew I would be most grateful.
Thanks
|
Cross-platform help viewer with search functionality
| 1,809,732 | 1 | 0 | 231 | 0 |
python,documentation,cross-platform,chm
|
wxHtmlHelpController doesn't support any scripting within pages, nor does it support css.
| 0 | 1 | 0 | 0 |
2009-09-23T20:20:00.000
| 2 | 0.099668 | false | 1,468,314 | 0 | 0 | 1 | 1 |
I am looking for a help viewer like Windows CHM that basically provides support for
adding content in HTML format
define Table of Contents
decent search
It should work on Windows, Mac and Linux. Bonus points for also having support for generating a "plain HTML/javascript" version that can be viewed in any browser (albeit without search support).
Language preference: Python
|
Better webserver performance for Python Django: Apache mod_wsgi or Lighttpd fastcgi
| 1,470,459 | 1 | 3 | 3,952 | 0 |
python,django,apache,fastcgi,lighttpd
|
Doesn't answer you question, but do you already use caching for your site? Like memcached? This might give you a better performance gain than going through the mess of switching webservers.
| 0 | 0 | 0 | 1 |
2009-09-24T04:26:00.000
| 4 | 0.049958 | false | 1,469,770 | 0 | 0 | 1 | 1 |
I am currently running a high-traffic python/django website using Apache and mod_wsgi. I'm hoping that there's a faster webserver configuration out there, and I've heard a fair number of recommendations for lighttpd and fastcgi. Is this setup faster than apache+mod_wsgi for serving dynamic django pages (I'm already convinced that lighttpd can server static files better)? The benchmarks online are either poorly conducted or inconclusive so I'm looking for some personal anecdotes. What architectural benefits does lighttpd + fastcgi provide? I understand that lighttpd uses epoll, and that a fastcgi process will be multithreaded. Also, having two separate processes, one for lighttpd and one for the python interpreter, will be largely beneficial.
I am aware of tornado and its ability to handle thousands of file descriptors with much fewer threads using epoll and callbacks. However, I'd prefer to stick with django for now.
Thanks,
Ken
|
Copying modules into Django, "No module named [moduleName]"
| 1,472,013 | 2 | 0 | 1,933 | 0 |
python,django
|
They way Django works is pretty much how Python works. At default the folder you create when you run django-admin.py startproject name is added to your python path. That means that anything you put into there you can get to. But you have to mind that when you write the app into the installed app list. If you have an app at project/apps/appname, you would have to write 'app.appname' in the installed apps list.
Now there are some ways to go about adding 3rd party apps located somewhere else to your project. You can either add them to your python path, put in your python path, or make a link to your python path. However, you can also add a sys.path.insert(...) in your manage.py file where you add the folder of your liking to your python path. Doing this will allow you to add folders to your python path for that project only, and will keep your python path more clean.
| 0 | 0 | 0 | 0 |
2009-09-24T13:32:00.000
| 2 | 0.197375 | false | 1,471,707 | 0 | 0 | 1 | 1 |
I run into this problem pretty consistently... keep in mind I am quite new to Django and a total Python amateur.
It seems that, for example, whenever I check out my Django project on a new computer after a clean install of Python and Django, it can never find the project/apps I create or copy in.
So right now I have an app that is working, and I downloaded a 3rd party Django module and installed it into my app directory, include it in my settings, and the web server quits because it cannot find the module.
This is the first time I've imported an third party module. In the past when it couldn't find modules I created, I would just rename the folder and run "manage.py startapp appname", delete the folder it created, and name my original folder back, boom, problem solved...
But that's obviously a hack, I am wondering if anyone can explain the the heck is going on here and how best to approach it.
I can't be the only one who has run into this, but I couldn't find any other questions on this site that seemed to match my issue.
Happens on both OS X and Windows 7.
|
What is setup.py?
| 1,472,439 | 122 | 1,389 | 905,751 | 0 |
python,python-3.x,setup.py,pypi,python-packaging
|
setup.py is Python's answer to a multi-platform installer and make file.
If you’re familiar with command line installations, then make && make install translates to python setup.py build && python setup.py install.
Some packages are pure Python, and are only byte compiled. Others may contain native code, which will require a native compiler (like gcc or cl) and a Python interfacing module (like swig or pyrex).
| 0 | 0 | 0 | 0 |
2009-09-24T14:16:00.000
| 10 | 1 | false | 1,471,994 | 1 | 0 | 1 | 1 |
Can anyone please explain what setup.py is and how it can be configured or used?
|
Raising ValidationError from django model's save method?
| 1,473,979 | 9 | 12 | 13,039 | 0 |
python,django
|
There's currently no way of performing validation in model save methods. This is however being developed, as a separate model-validation branch, and should be merged into trunk in the next few months.
In the meantime, you need to do the validation at the form level. It's quite simple to create a ModelForm subclass with a clean() method which does your remote call and raises the exception accordingly, and use this both in the admin and as the basis for your other forms.
| 0 | 0 | 0 | 0 |
2009-09-24T20:13:00.000
| 2 | 1.2 | true | 1,473,888 | 0 | 0 | 1 | 1 |
I need to raise an exception in a model's save method. I'm hoping that an exception exists that will be caught by any django ModelForm that uses this model including the admin forms.
I tried raising django.forms.ValidationError, but this seems to be uncaught by the admin forms. The model makes a remote procedure call at save time, and it's not known until this call if the input is valid.
Thanks, Pete
|
Java vs Python on Hadoop
| 1,482,294 | 15 | 53 | 40,609 | 0 |
java,python,hadoop
|
Java is less dynamic than Python and more effort has been put into its VM, making it a faster language. Python is also held back by its Global Interpreter Lock, meaning it cannot push threads of a single process onto different core.
Whether this makes any significant difference depends on what you intend to do. I suspect both languages will work for you.
| 0 | 0 | 0 | 0 |
2009-09-26T21:55:00.000
| 3 | 1.2 | true | 1,482,282 | 0 | 0 | 1 | 1 |
I am working on a project using Hadoop and it seems to natively incorporate Java and provide streaming support for Python. Is there is a significant performance impact to choosing one over the other? I am early enough in the process where I can go either way if there is a significant performance difference one way or the other.
|
3d game engines for Ruby or Python?
| 1,483,914 | 3 | 4 | 1,768 | 0 |
python,ruby,game-engine
|
I have worked a little bit with Panda3D, and it is a competent professional 3D engine. I haven't really worked with any of the other engines, though. If you are trying to start out with some 3D programming, I would recommend Blender3D because it is coupled with free 3D modeling software, which makes it easier to get models into your code. With Panda3D you will need to download and install an extension to allow you to export 3D models from software into a format the engine can recognize.
I have only used Panda3D, so I cannot compare the merits of the engines. From my basic knowledge (very basic), I would say that Blender3D is a good start.
| 0 | 0 | 0 | 0 |
2009-09-27T06:50:00.000
| 3 | 0.197375 | false | 1,482,953 | 0 | 0 | 1 | 2 |
Are there any 3d game engines for these ?
|
3d game engines for Ruby or Python?
| 11,091,017 | 1 | 4 | 1,768 | 0 |
python,ruby,game-engine
|
Personally, i like to use pygame. Its easy, free and fast.
| 0 | 0 | 0 | 0 |
2009-09-27T06:50:00.000
| 3 | 0.066568 | false | 1,482,953 | 0 | 0 | 1 | 2 |
Are there any 3d game engines for these ?
|
python _+ django, is it compiled code?
| 1,483,720 | 1 | 3 | 7,736 | 0 |
python
|
Obfuscation is false security. And the only thing worse than no security is false security. Why would you obfuscate a web app anyways?
Python is compiled to bytecode and run on a virtual machine, but usually distributed as source code.
Unless you really plan to run your webapp on "pretty much every web host" that question doesn't matter. There are many good hosts that support python and django.
| 0 | 0 | 0 | 0 |
2009-09-27T14:31:00.000
| 6 | 0.033321 | false | 1,483,685 | 0 | 0 | 1 | 3 |
Just looking into python from a .net background.
Is python compiled like .net?
If yes, can it be obfuscated and is it more or less secure than .net compiled code that is obfuscated?
does pretty much every web host (unix) support django and python?
|
python _+ django, is it compiled code?
| 1,483,820 | 2 | 3 | 7,736 | 0 |
python
|
You shouldn't have to worry about obfuscating your code, specially since it's going to run on your server.
You are not supposed to put your code in a public directory anyway. The right thing to do with django (as oposed to PHP) is to make the code accessible by the webserver, but not by the public.
And if your server's security has been breached, then you have other things to worry about...
| 0 | 0 | 0 | 0 |
2009-09-27T14:31:00.000
| 6 | 0.066568 | false | 1,483,685 | 0 | 0 | 1 | 3 |
Just looking into python from a .net background.
Is python compiled like .net?
If yes, can it be obfuscated and is it more or less secure than .net compiled code that is obfuscated?
does pretty much every web host (unix) support django and python?
|
python _+ django, is it compiled code?
| 1,483,846 | 0 | 3 | 7,736 | 0 |
python
|
Code obfuscation in .NET are mostly a question of changing variable names to make it harder to understand the disassembled code. Yes, you can do those techniques with CPython too.
Now, why ever you would want to is another question completely. It doesn't actually provide you with any security, and does not prevent anybody from stealing your software.
| 0 | 0 | 0 | 0 |
2009-09-27T14:31:00.000
| 6 | 0 | false | 1,483,685 | 0 | 0 | 1 | 3 |
Just looking into python from a .net background.
Is python compiled like .net?
If yes, can it be obfuscated and is it more or less secure than .net compiled code that is obfuscated?
does pretty much every web host (unix) support django and python?
|
How do I use PyMock and Nose with Django models?
| 1,484,428 | 4 | 2 | 1,276 | 0 |
python,django,unit-testing,nose
|
You do need DJANGO_SETTINGS_MODULE defined in order to run core.py -- why don't you just export DJANGO_SETTINGS_MODULE=whatever in your bash session before starting nose?
| 0 | 0 | 0 | 0 |
2009-09-27T19:48:00.000
| 1 | 1.2 | true | 1,484,293 | 0 | 0 | 1 | 1 |
I'm trying to do TDD with PyMock, but I keep getting error when I use Nose and execute core.py from command line:
"ERROR: Failure: ImportError (Settings cannot be imported, because environment variable DJA
NGO_SETTINGS_MODULE is undefined.)"
If I remove "from cms.models import Entry" from the unit test module I created, everything works fine, but I need to mock functionality in django module cms.models.Entry that I created.
What am I doing wrong? Can this be done?
|
Django slugified urls - how to handle collisions?
| 1,492,882 | 6 | 7 | 3,203 | 0 |
python,django,url,slug,collision
|
One thing I never liked about the unique slug fields/methods is that if you have a lot of clashes for a single title, you'll end up running several queries to try and determine an available slug. I know you mentioned you don't want to show the id for non-clashing slugs, but, as far as performance, I think it's the better route to take. To make the URL a little nicer looking, I prefer also to embed the id before the slug, so that a URL takes the form of www.example.com/reviews/1/the-best-thing-ever.
| 0 | 0 | 0 | 0 |
2009-09-29T04:23:00.000
| 4 | 1.2 | true | 1,490,559 | 0 | 0 | 1 | 2 |
I'm currently working on a toy project in Django.
Part of my app allows users to leave reviews. I'd like to take the title of the review and slugify it to create a url.
So, if a user writes a review called "The best thing ever!", the url would be something like: www.example.com/reviews/the-best-thing-ever.
That's all well and good, but what is the best way to handle case where two users pick the same title? I don't want to make the title required to be unique.
I've thought about adding the review id in the url somewhere, but I'd like to avoid that extra info for any urls that don't collide.
Any ideas?
|
Django slugified urls - how to handle collisions?
| 2,340,063 | 0 | 7 | 3,203 | 0 |
python,django,url,slug,collision
|
I would (in the form validation) just check to see if the slug is used, and then add something to it, either a number "my-cool-idea_2" or the actual id
| 0 | 0 | 0 | 0 |
2009-09-29T04:23:00.000
| 4 | 0 | false | 1,490,559 | 0 | 0 | 1 | 2 |
I'm currently working on a toy project in Django.
Part of my app allows users to leave reviews. I'd like to take the title of the review and slugify it to create a url.
So, if a user writes a review called "The best thing ever!", the url would be something like: www.example.com/reviews/the-best-thing-ever.
That's all well and good, but what is the best way to handle case where two users pick the same title? I don't want to make the title required to be unique.
I've thought about adding the review id in the url somewhere, but I'd like to avoid that extra info for any urls that don't collide.
Any ideas?
|
Separate Admin/User authentication system in Django
| 1,494,572 | 0 | 8 | 3,543 | 0 |
python,django,authentication
|
Modify things slightly so that users have a category prefix on their username? You haven't given us much info on what you want to do, it's possible that your needs might be met by using the sites framework, or simply two separate django installs.
If what you're trying to do is make the user login page and the admin login page separate, just use the built in framework as detailed in the docs to create a "user" login page and leave the admin one alone. If you're worried that users will somehow start editing admin login stuff, don't be, they won't unless you let them.
| 0 | 0 | 0 | 0 |
2009-09-29T19:41:00.000
| 3 | 0 | false | 1,494,524 | 0 | 0 | 1 | 1 |
I've recently started learning/using django; I'm trying to figure out a way to have two separate authentications systems for administrators and users. Rather than create a whole new auth system, I'd like to leverage django's built-in functionality (i.e. session management, @login_required decorator, etc.).
Specifically, I want to have two separate login tables - one for admins, one for users. The admin login table should be the default table that django generates with its default fields (ie. id, username, email, is_staff, etc.). The user table, on the other hand, I want to have only 5 fields - id, email, password, first_name, last_name. Furthermore, I want to use django built-in session management for both login tables and the @login_required decorator for their respective views. Lastly, I want two separate and distinct login forms for admins and users.
Anyone have any suggestions on how I can achieve my goal or know of any articles/examples that could help me along?
|
Aggregating multiple feeds with Universal Feed Parser
| 1,496,616 | 1 | 0 | 1,280 | 0 |
python,django
|
Here is already suggestion to store data in the database, e.g. bsddb.btopen() or any RDBMS.
Take a look at heapq.merge() and bisect.insort() or use one of B-tree implementations if you'd like to merge data in memory.
| 0 | 0 | 1 | 0 |
2009-09-30T04:04:00.000
| 2 | 0.099668 | false | 1,496,067 | 0 | 0 | 1 | 1 |
Having great luck working with single-source feed parsing in Universal Feed Parser, but now I need to run multiple feeds through it and generate chronologically interleaved output (not RSS). Seems like I'll need to iterate through URLs and stuff every entry into a list of dictionaries, then sort that by the entry timestamps and take a slice off the top. That seems do-able, but pretty expensive resource-wise (I'll cache it aggressively for that reason).
Just wondering if there's an easier way - an existing library that works with feedparser to do simple aggregation, for example. Sample code? Gotchas or warnings? Thanks.
|
Run a task every hour on the hour with App Engine's cron API
| 1,501,925 | -1 | 4 | 3,297 | 0 |
python,google-app-engine,cron
|
Looking over the docs, I agree that your 24 cron entry idea is the only documented way that would work. Not ideal, but should work.
| 0 | 1 | 0 | 0 |
2009-10-01T04:36:00.000
| 4 | -0.049958 | false | 1,501,907 | 0 | 0 | 1 | 2 |
I need to run a task every hour on the hour (00:00, 01:00, 02:00, ..., 23:00) every day of the week, but can't seem to find an example in App Engine's docs of how to do this.
There is an example of running at ask every hour, but this doesn't fit because the "start" of that hour depends on when you deploy the application. That is, if I deploy at 4:37 PM, the cron scripts will get executed at 5:37, 6:37, ... instead of 5:00, 6:00, ...
So far the only way that looks like it would work is to have 24 different cron entries, one for the specific hour of each day set to run each day at that specific time.
Does anyone know of anything that would let me use a schedule like "every hour at :00" or even "every day 00:00, 01:00, ... 23:00"?
|
Run a task every hour on the hour with App Engine's cron API
| 1,501,960 | 1 | 4 | 3,297 | 0 |
python,google-app-engine,cron
|
The docs say you can have 20 cron entries, so you can't have one for every hour of the day.
You could run your task every minute and check if it is the first minute of the hour - exit otherwise.
| 0 | 1 | 0 | 0 |
2009-10-01T04:36:00.000
| 4 | 0.049958 | false | 1,501,907 | 0 | 0 | 1 | 2 |
I need to run a task every hour on the hour (00:00, 01:00, 02:00, ..., 23:00) every day of the week, but can't seem to find an example in App Engine's docs of how to do this.
There is an example of running at ask every hour, but this doesn't fit because the "start" of that hour depends on when you deploy the application. That is, if I deploy at 4:37 PM, the cron scripts will get executed at 5:37, 6:37, ... instead of 5:00, 6:00, ...
So far the only way that looks like it would work is to have 24 different cron entries, one for the specific hour of each day set to run each day at that specific time.
Does anyone know of anything that would let me use a schedule like "every hour at :00" or even "every day 00:00, 01:00, ... 23:00"?
|
Using IronPython to learn the .NET framework, is this bad?
| 1,551,802 | 5 | 4 | 477 | 0 |
c#,.net,ironpython
|
If I wanted to just "learn the framework", I would do it in C# or VB for two main reasons:
Intellisense - the framework is huge, and being offered suggestions for function overloads is one of the ways to find new stuff. There's almost no good intellisense for the framework with IronPython at the moment (Michael Foord has done some work on building the appropriate info for Wing, but I haven't tried it myself).
Code samples - pretty much all the educational material that exists about the .NET framework is given with C# or VB. You'll be much more on your own with IronPython.
| 0 | 0 | 0 | 1 |
2009-10-01T15:55:00.000
| 4 | 0.244919 | false | 1,504,804 | 1 | 0 | 1 | 3 |
Because I'm a Python fan, I'd like to learn the .NET framework using IronPython. Would I be missing out on something? Is this in some way not recommended?
EDIT:
I'm pretty knowledgeable of Java ( so learning/using a new language is not a problem for me ). If needed, will I be able to use everything I learned in IronPython ( excluding language featurs ) to write C# code?
|
Using IronPython to learn the .NET framework, is this bad?
| 1,504,823 | 11 | 4 | 477 | 0 |
c#,.net,ironpython
|
No, sounds like a good way to learn to me. You get to stick with a language and syntax that you are familiar with, and learn about the huge range of classes available in the framework, and how the CLR supports your code.
Once you've got to grips with some of the framework and the CLR services you could always pick up C# in the future. By that point it will just be a minor syntax change from what you already know.
Bare in mind that if you are thinking with respect to a career, you won't find many iron python jobs, but like I say, this could be a good way to learn about the framework first, then build on that with C# in a month or twos time.
| 0 | 0 | 0 | 1 |
2009-10-01T15:55:00.000
| 4 | 1.2 | true | 1,504,804 | 1 | 0 | 1 | 3 |
Because I'm a Python fan, I'd like to learn the .NET framework using IronPython. Would I be missing out on something? Is this in some way not recommended?
EDIT:
I'm pretty knowledgeable of Java ( so learning/using a new language is not a problem for me ). If needed, will I be able to use everything I learned in IronPython ( excluding language featurs ) to write C# code?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.