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
web application firewall development
4,486,542
1
3
3,881
0
python,security,activemq,mod-security,apache-modules
Unless this is just some kind of academic exercise and Python helps you get it done fast, I don't think a high level language like Python is the best choice for a firewall (I don't even know if it's possible honestly). If you're planning some sort of proxy/filter application, that might be fine, but Django isn't needed either way.
0
0
0
0
2010-12-20T01:19:00.000
5
0.039979
false
4,486,178
0
0
1
4
I have an assignment to develop a web application firewall. I have been researching for some source codes about that.My main source was ModSecurity. Main question is that: -Which framework or programming language I can use, to develop a web application firewall? Which one would be the most useful? -Can I use Django & Python? It would be a starting point for the project research.
web application firewall development
51,471,417
0
3
3,881
0
python,security,activemq,mod-security,apache-modules
C, C++, Golang, Lua are all optional languages to develop a Web Application Firewall or Gateway, but django is not suitable for it. C, C++ can develop nginx plugin or backend WAF. Golang can develop gateway with WAF, such as Janusec Application Gateway. Lua can extend nginx access control and work as a WAF.
0
0
0
0
2010-12-20T01:19:00.000
5
0
false
4,486,178
0
0
1
4
I have an assignment to develop a web application firewall. I have been researching for some source codes about that.My main source was ModSecurity. Main question is that: -Which framework or programming language I can use, to develop a web application firewall? Which one would be the most useful? -Can I use Django & Python? It would be a starting point for the project research.
Django with PyPy
4,490,438
23
17
8,263
0
python,django,pypy
Unlikely. A Django application is almost always I/O-bound, usually because of the database connection. PyPy wouldn't help with that at all, even if it was purely compatible (which I'm not sure it is).
0
0
0
0
2010-12-20T14:06:00.000
3
1.2
true
4,490,366
0
0
1
3
Are there some reasons of using Django with PyPy? I read PyPy increases perfomance.
Django with PyPy
4,490,455
10
17
8,263
0
python,django,pypy
Depends. PyPy does improve performance for all benchmarks that are in the PyPy's benchmark suite. This is only template rendering for now, but noone submitted anything else. It's however safe to assume that performance critical code will be faster (especially after some tuning). Compatibility-wise databases are a bit of an issue, because only sqlite is working and it's slow (there is a branch to fix it though). People also reported pg8000 working with sqlalchemy for example, but I don't have a first-hand experience. Cheers, fijal
0
0
0
0
2010-12-20T14:06:00.000
3
1
false
4,490,366
0
0
1
3
Are there some reasons of using Django with PyPy? I read PyPy increases perfomance.
Django with PyPy
14,871,428
6
17
8,263
0
python,django,pypy
I have done some experimentation with PyPy + Django. There are two main issues: Most database adaptors and other third-party modules cannot be compiled with PyPy (even when the wiki says they can). One server I thought might benefit from JIT compilation because it did a fancy calculation in some requests had an increasing memory footprint, perhaps because the JIT was storing traces that turned out to be unique to each request so were never reused? Theoretically PyPy might be a win if your server is doing interesting calculations, uses pure-python modules, and has large numbers of objects in-memory (because PyPy can reduce the memory used per-object in some circumstances). Otherwise the higher memory requirements of the JIT will be an impediment because it reduces opportunities for in-memory caching and may require extra servers to run enough server processes.
0
0
0
0
2010-12-20T14:06:00.000
3
1
false
4,490,366
0
0
1
3
Are there some reasons of using Django with PyPy? I read PyPy increases perfomance.
Where to place the call to a external API that has a dependency on a Model?
4,491,538
1
1
625
0
python,django,web-services
This sounds like it should be done in a View, because then you will be returning to a template with all the required context.
0
0
0
0
2010-12-20T16:10:00.000
2
0.099668
false
4,491,434
0
0
1
1
Suppose I have a Django app named "blog". There's a model called Post and I have an external API call that returns the list of the most popular posts in a given time, e.g., the Google Analytics API. My question is: Where is the expected place that I should place the code that makes the call to the external API, parses the id from each post, query the database and sort the list of models accordingly? I don't think that it should live in the Manager or in a templatetag. Any tips or suggestions? Thanks in advance! EDIT: The desired result might be need in several places across the project, so if I place the code in view, I'll have duplication.
Django Templates: Display a date only if it's in the future
4,499,448
2
1
3,751
0
python,django,datetime,django-templates
IMO it is cleaner to do that kind of things in a view or in a helper module, and pass it in the context. The templates are better left with no logic or the very least possible (that's the MVC pattern after all).
0
0
0
0
2010-12-20T20:42:00.000
2
0.197375
false
4,493,761
0
0
1
1
How do I compare dates in a Django template? I thought of several possible avenues: Send today's date in the context to be compared at the template Create my own template tag Have some logic in the view to only pass the date if it's in the future Although the last option seems easier, I rather leave the display logic in the template than in the view. I also do not want to pass something that seems so trivial like today's date in the template context. Perhaps someone has another option or could share their implementation of one of the options I mentioned above and why they decided to go that route.
Testing a custom Django template filter
4,499,889
17
18
2,822
0
python,django,django-template-filters
The easiest way to test a template filter is to test it as a regular function. @register.filter decorator doesn't harm the underlying function, you can import the filter and use just it like if it is not decorated. This approach is useful for testing filter logic. If you want to write more integration-style test then you should create a django Template instance and check if the output is correct (as shown in Gabriel's answer).
0
0
0
0
2010-12-21T03:47:00.000
2
1
false
4,496,109
0
0
1
1
I have a custom template filter I created under project/app/templatetags. I want to add some regression tests for some bugs I just found. How would I go about doing so?
Developing a RIA with Django - what technology stack?
4,498,355
1
4
3,240
0
python,django
using web browser as your client platform?
0
0
0
0
2010-12-21T10:10:00.000
3
0.066568
false
4,498,125
0
0
1
1
I need to develop a web application with the following requirements: Desktop like UI on the client side Application deployment Scalability (i.e. distributing the service on multiple servers) What I thought of so far (as I love Python but haven't done much web development yet): Django Fabric (think I've read somewhere it's suited for this) What I'm missing is: How to create rich clients (probably need some javascript libraries for that)? How to distribute the service?
python importerror no module named zope.interface twisted
11,055,554
0
5
4,933
0
python,twisted,zope
I had the same error after following the steps scrapy suggested, mainly using pip install Scrapy. In order to install some Scrapy dependencies you will need root permision, and my mistake was creating a virtualenv for my scrapy project. Maybe you will run into the same error after following the scrapy setup steps and using virtualenv. Just dont use virtualenv.
0
0
0
0
2010-12-21T10:30:00.000
2
0
false
4,498,313
1
0
1
1
I am new in python.I installed "scrapy" but it giving error "importerror no module named zope.interface twisted".Please help me. Thanks in advance..........
Python/Django excel to html
4,499,265
4
1
1,961
1
python,html,django,excel
Why don't you need xlrd? It sounds like exactly what you need. Create a Django model with a FileField that holds the spreadsheet. Then your view uses xlrd to loop over the rows and columns and put them into an HTML table. Job done. Possible complications: multiple sheets in one Excel file; formulas; styles.
0
0
0
0
2010-12-21T11:20:00.000
2
1.2
true
4,498,678
0
0
1
1
Okay, so what I want to do is upload an excel sheet and display it on my website, in html. What are my options here ? I've found this xlrd module that allows you to read the data from spreadsheets, but I don't really need that right now.
Storing Templates and Object-Oriented vs Relational Databases
4,505,053
0
0
233
0
python,database-design,relational-database,object-oriented-database
I'm a huge Oracle booster but I think you should seriously consider NoSQL. Cassandra and other NoSQL Databases have already considered your conundrum and have smashed it down to the ground. CouchDB is another who, I believe their example code is how to store a blog.
0
0
0
0
2010-12-21T19:51:00.000
2
0
false
4,503,301
0
0
1
2
I'm designing some custom blog software, and have run into a conundrum regarding database design. The software requires that there be multiple content types, each of which will require different entry forms and presentation templates. My initial instinct is to create these content types as objects, then serialize them and store them in the database as JSON or YAML, with the entry forms and templates as simple strings attached to the "contentTypes" table. This seems cumbersome, however. Are there established best practices for dealing with this design? Is this a use case where I should consider an object database? If I should be using an object database, which should I consider? I am currently working in Python and would prefer a capable Python library, but can move to Java if need be.
Storing Templates and Object-Oriented vs Relational Databases
4,517,964
2
0
233
0
python,database-design,relational-database,object-oriented-database
Please do Not Store templates (that might be altered by a user) in a database. There's no sane way to migrate from a staging environment to production if you have to deal with doffs of database dumps. We are dumping some software right one for this very reason. Apart from that I'd simply store the source (user editable part) in the database plus a "precompiled version" either directly in the database (for faster retrieval) or in some cache system. I'd personally go with a set theory approach. Store each set of content type precompiled and recompile it when edited for fast serving in a separate place (table, collection, directory, whatever) Store the sources in a common place to make it easy to rebuild different content types (the source format really just is a special case content type) keep the templates in a place where migration between systems (dev, staging, prod) makes migration easy
0
0
0
0
2010-12-21T19:51:00.000
2
1.2
true
4,503,301
0
0
1
2
I'm designing some custom blog software, and have run into a conundrum regarding database design. The software requires that there be multiple content types, each of which will require different entry forms and presentation templates. My initial instinct is to create these content types as objects, then serialize them and store them in the database as JSON or YAML, with the entry forms and templates as simple strings attached to the "contentTypes" table. This seems cumbersome, however. Are there established best practices for dealing with this design? Is this a use case where I should consider an object database? If I should be using an object database, which should I consider? I am currently working in Python and would prefer a capable Python library, but can move to Java if need be.
Best way to get user nearest city? Python/Django
9,200,451
0
4
4,549
0
python,django,geolocation,geoip
Have it such that whenever you add a city to your database, a piece of code is run (off-line) that calculates the closest city to every city that you have. You can have each city point to another city as its closest city with a foreignkey. Now that you have everything pre-calculated, whenever there is a live request, with a name of a city, you just hit the database with the city name and you can get to the closest city by the foreignkey you have specified. (city ---foreignkey---> city ) Now that is going to be very fast as you have pre-calculated the closest city off-line and can return the result right away on each live request. But how often do you plan to add a city? Probably not that often. So, the off-line pre-calculation would be rare even if it takes a bit of time to do. But live requests are responded to very fast. (others have already recommend the formula to use to calculate the distance, so I am going to skip that part!)
0
0
0
0
2010-12-22T18:23:00.000
2
0
false
4,512,329
0
0
1
1
I have a website with a limited number of cities in the database, and need to show the user the nearest city to his current location. I can get the location by MaxMind API, but I want to get the nearest city in my database to user city. For example, if I have these cities in the database: Los Angeles, San Francisco and New York City, and I'm accessing from other city like Miami, I should see NYC selected because it's the nearest geographically. What's the best way to do this quick and performance aware?
How to convert unicode escape sequence URL to python unicode?
4,513,304
3
0
1,994
0
javascript,python,unicode,escaping
eventually what I did is changed the client side from escape(text) to urlEncodeComponent(text) and then in the python side used: request.encoding = 'UTF-8' text = unicode(request.GET.get('text', None)) Not sure this is the best thing to do, but it works in English and Hebrew
0
0
1
0
2010-12-22T19:47:00.000
2
0.291313
false
4,513,083
0
0
1
1
what is the right way to do it if the URL has some unicode chars in it, and is escaped in the client side using javascript ( escape(text) )? For example, if my url is: domain.com/?text=%u05D0%u05D9%u05DA%20%u05DE%u05DE%u05D9%u05E8%u05D9%u05DD%20%u05D0%u05EA%20%u05D4%u05D8%u05E7%u05E1%u05D8%20%u05D4%u05D6%u05D4 I tried: text = urllib.unquote(request.GET.get('text')) but I got the exact same string back (%u05D0%u05D9%u05DA%20%u05DE ... )
Django Subdomain URL Dispatch
4,514,284
4
2
1,219
0
python,django,django-urls,subdomain
This is definitely possible - you'll need to tweak your configuration files so that subdomain requests are sent to that URL instead of the root of your app, and then you should be good to go (use request.get_host() to retrieve the domain you're being called at).
0
0
0
0
2010-12-22T22:13:00.000
1
1.2
true
4,514,198
0
0
1
1
I have a Django project and I wanted to map a URL to handle subdomains. If there is a subdomain then it should call a function with the subdomain as a parameter. Is this possible? If not then what would be the best way to tell what the subdomain of a request is? Thanks
Beginner's Language app
4,514,409
0
1
352
0
iphone,python,android
Python is a good beginning language, but you need to ensure that you do more than just course work. Why not just run through tutorials on Android development right off the bat? If you are worried about wasting time by not using Java immediately, then why not just start there?
1
0
0
0
2010-12-22T22:41:00.000
5
0
false
4,514,389
0
0
1
2
Hi I'm a techie with no programing experience. I know html and css, but I'd like to someday be able to make an app for my phone (I have an android) and possibly mobile websites. I made learning a programing language and creating a mobile app a goal for my job, and now my boss would like me to pick a programing language to learn. I found a free open course from MIT (http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/) called introduction to computer science. In the course they teach python, but more importantly it seems they teach how to think like a programmer. When I told my boss about the free online course she didn't think that Python was an appropriate language for me to learn. She'd like me to learn a language that is more similar to one used to make Phone apps. Does anyone out there know a better language for me to pick up that would be similar to Android or iPhone's App language. Thank you
Beginner's Language app
4,514,481
1
1
352
0
iphone,python,android
Learn to program first before learning how to develop for the iPhone. That will give you a much better chance at success. Python a perfectly good language for learning to program, especially in the context of an Intro to CS course environment. But any intro programming language environment will do (even one designed for kids). Once you're comfortable writing non-trivial programs in Python (or whatever first computer language you choose), learning Objective C and the iOS APIs (or Java and the Android APIs) will become much much easier, compared with starting from scratch and zero programming background.
1
0
0
0
2010-12-22T22:41:00.000
5
0.039979
false
4,514,389
0
0
1
2
Hi I'm a techie with no programing experience. I know html and css, but I'd like to someday be able to make an app for my phone (I have an android) and possibly mobile websites. I made learning a programing language and creating a mobile app a goal for my job, and now my boss would like me to pick a programing language to learn. I found a free open course from MIT (http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/) called introduction to computer science. In the course they teach python, but more importantly it seems they teach how to think like a programmer. When I told my boss about the free online course she didn't think that Python was an appropriate language for me to learn. She'd like me to learn a language that is more similar to one used to make Phone apps. Does anyone out there know a better language for me to pick up that would be similar to Android or iPhone's App language. Thank you
Copy,Cut and Paste
4,520,749
0
1
532
0
wxpython
Ctrl+C > Ctrl+x > Ctrl+v Basic window command.
0
0
0
0
2010-12-23T16:13:00.000
1
0
false
4,520,476
0
0
1
1
How to make copy,cut and paste in popup menu???
using pyxml library pyjamas
4,521,206
2
2
222
0
python,django
No. See 'supported modules' in the Pyjamas docs.
0
0
0
0
2010-12-23T17:38:00.000
1
1.2
true
4,521,124
0
0
1
1
I need to write a small web app that does xml parsing on the client browser I am considering pyjamas as the front end framework and django for the backend. I understand that with pyjamas one can code in python and javascript is automatically generated my question is: can I use external python libraries such as pyxml to be used by pyjamas to manipulate xml on the browser?
PyDev Undefined variable from import error
31,399,986
3
1
11,564
0
python,django,pydev,virtualenv
Window -> Preferences -> PyDev -> Editor -> Code Analysis -> Undefined -> Undefined Variable From Import -> Ignore Then try to close and reopen eclipse again, which worked for me.
0
0
0
0
2010-12-23T18:03:00.000
4
0.148885
false
4,521,258
1
0
1
3
I'm using virtualenv for Django project. From command line I can import modules hashlib and zipfile. But PyDev is reporting unresolved import for those two. (os, sys and email are working). When I copy zipfile.py and zipfile.pyc (and same for hashlib) to virtualenv lib's folder I can import modules, but I get errors that md5 variable isn't defined in hashlib and so on. Again, I can call md5 method within virtualenv in command line... What Can I do?
PyDev Undefined variable from import error
61,027,786
0
1
11,564
0
python,django,pydev,virtualenv
Right Click on your module name >> Py Dev >> Remove Error Markers All my red cross false errors from editors vanished!
0
0
0
0
2010-12-23T18:03:00.000
4
0
false
4,521,258
1
0
1
3
I'm using virtualenv for Django project. From command line I can import modules hashlib and zipfile. But PyDev is reporting unresolved import for those two. (os, sys and email are working). When I copy zipfile.py and zipfile.pyc (and same for hashlib) to virtualenv lib's folder I can import modules, but I get errors that md5 variable isn't defined in hashlib and so on. Again, I can call md5 method within virtualenv in command line... What Can I do?
PyDev Undefined variable from import error
4,521,311
1
1
11,564
0
python,django,pydev,virtualenv
I'd start by removing / re-adding the PyDev Interpreter. I've also seen instances where, on my initial launch of Eclipse the PyDev plugin will fail to load some of my modules (most commonly the wx module) and give me a raft of unresolved import errors. Restarting Eclipse (from the file menu, not closing and reopening) seems to cause it to reload in some way that makes it properly recognize the previously missing modules. HTH.
0
0
0
0
2010-12-23T18:03:00.000
4
0.049958
false
4,521,258
1
0
1
3
I'm using virtualenv for Django project. From command line I can import modules hashlib and zipfile. But PyDev is reporting unresolved import for those two. (os, sys and email are working). When I copy zipfile.py and zipfile.pyc (and same for hashlib) to virtualenv lib's folder I can import modules, but I get errors that md5 variable isn't defined in hashlib and so on. Again, I can call md5 method within virtualenv in command line... What Can I do?
Does any webhosting service that supports python also supports django?
4,521,483
1
0
323
0
python,django,web-hosting
Yes, but if they only support Python via CGI then your application will be very, very slow. Best is WSGI, then FastCGI, then mod_python.
0
0
0
0
2010-12-23T18:35:00.000
4
0.049958
false
4,521,460
0
0
1
2
I'm trying to learn python/django, these are installed on my desktop computer and all the examples run fine. My question is: If a webhosting service supports python (2.4), does the webhosting service supports django by default? Thanks guys.
Does any webhosting service that supports python also supports django?
4,521,513
0
0
323
0
python,django,web-hosting
Not necessarily.Many web hosting companies(shared) claim to offer django but this is a big lie.Case in point,a2hosting claims to have django but don't offer it;its disallowed.I tried to compile my own python and install django and found out that that path is also closed. Django is memory intensive and will only work on vps and dedicated accounts.Web faction though is the only web host that wont lie to you.
0
0
0
0
2010-12-23T18:35:00.000
4
0
false
4,521,460
0
0
1
2
I'm trying to learn python/django, these are installed on my desktop computer and all the examples run fine. My question is: If a webhosting service supports python (2.4), does the webhosting service supports django by default? Thanks guys.
Parsing parts of a Large XML File in App Engine using Blobstore?
4,522,924
0
2
630
0
python,xml,google-app-engine,beautifulsoup,blobstore
It really sounds like App Engine is not the right platform for this project.
0
1
0
0
2010-12-23T21:00:00.000
4
0
false
4,522,434
0
0
1
1
I'm working on an google app engine app that will have to deal with some largish ( <100 MB) XML files uploaded from a form that will exceed GAE's limits -- either taking longer than 30 seconds to upload the file, or exceeding the 10 MB request size. The current solution I'm envisioning is to upload the file to the blobstore, and then bring it into the application (1 MB at a time) for parsing. This could also very well exceed the 30 second limits for a request, so I'm wondering if there's a nice way to handle large XML documents in chunks, as I may end up having to do it via task queues in 30 second bursts. I'm currently using BeautifulSoup for other parts of the project, having switched from minidom. Is there a way to handle data in chunks that would play nice with GAE?
Choosing MooTools over Google closure?
4,527,494
5
5
909
0
python,mootools,javascript,google-closure
This shouldn't be the accepted answer, but it may help a little. I've had to make a similar choice recently -- but for me it was between YUI3 and JQuery. My main priority was agility and modularity, which tipped me toward YUI3. Though a few things make me think a little every day about my choice: Code Assist in Eclipse. I got so used to it with Python, and have not gotten it to work with YUI3. It seems to be available for MooTools, but I didn't see it for Google Closure. Stack Overflow Support. There are >55000 questions tagged for JQuery, >700 for MooTools, but <50 for Google Closure and YUI3 (~600 for YUI). Distance from vanilla JavaScript. YUI3 seems to wrap almost everything away from vanilla DOM/JavaScript. This takes some getting used to, and I have the feeling that it is doing a good job of insulating me from lots of cross browser, optimization issues that I would like to not even think about. However it does diminish the value of more vanilla JavaScript tutorials and examples. I'm not sure how this weighs between MooTools and Google Closure. (BTW. All in all, I still really dig YUI3.)
0
0
0
0
2010-12-24T14:51:00.000
2
0.462117
false
4,526,906
0
0
1
1
I am in a process to select javascript library for our new web application. This app is not very UI heavy but has forms, reports, search, calendars, tabs and target multiple countries like most web apps. We are a tiny team. Biggest concern is maintainability and readability of the code. We are Python programmers. After evaluating many other javascript frameworks we have narrowed down to mootools and google-closure. We loved mootools syntax. It took us no time to learn. It's like Python. On other hand we were stumped seeing private/public in google closure. It's tempting to go for mootools however, I would love to hear from you about specific advantages these frameworks offer over each other.
Python virtualenv questions
70,587,915
0
60
107,968
0
python,windows,linux,virtualenv
In windows: Press Windows (or Windows+R) and then type “cmd”: Run the Command Prompt in normal mode. cd C:\Users\user\Desktop\UserProjectName> pip install virtualenv For Create a venv run this virtualenv -p python3 venv Activate virtualenv venv\Scripts\activate It will look like this (venv) C:\Users\user\Desktop\UserDjangoProject> Then run pip install -r requirements.txt Show the installed package pip list
0
0
0
0
2010-12-24T19:11:00.000
6
0
false
4,527,958
1
0
1
2
I'm using VirtualEnv on Windows XP. I'm wondering if I have my brain wrapped around it correctly: I ran virtualenv ENV and it created C:\WINDOWS\system32\ENV. I then changed my PATH variable to include C:\WINDOWS\system32\ENV\Scripts instead of C:\Python27\Scripts. Then, I checked out Django into C:\WINDOWS\system32\ENV\Lib\site-packages\django-trunk, updated my PYTHON_PATH variable to point the new Django directory, and continued to easy_install other things (which of course go into my new C:\WINDOWS\system32\ENV\Lib\site-packages directory). I understand why I should use VirtualEnv so I can run multiple versions of Django, and other libraries on the same machine, but does this mean that to switch between environments I have to basically change my PATH and PYTHON_PATH variable? So, I go from developing one Django project which uses Django 1.2 in an environment called ENV and then change my PATH and such so that I can use an environment called ENV2 which has the dev version of Django? Is that basically it, or is there some better way to automatically do all this (I could update my path in Python code, but that would require me to write machine-specific code in my application)? Also, how does this process compare to using VirtualEnv on Linux (I'm quite the beginner at Linux).
Python virtualenv questions
55,598,306
3
60
107,968
0
python,windows,linux,virtualenv
on Windows I have python 3.7 installed and I still couldn't activate virtualenv from Gitbash with ./Scripts/activate although it worked from Powershell after running Set-ExecutionPolicy Unrestricted in Powershell and changing the setting to "Yes To All". I don't like Powershell and I like to use Gitbash, so to activate virtualenv in Gitbash first navigate to your project folder, use ls to list the contents of the folder and be sure you see "Scripts". Change directory to "Scripts" using cd Scripts, once you're in the "Scripts" path use . activate to activate virtualenv. Don't forget the space after the dot.
0
0
0
0
2010-12-24T19:11:00.000
6
0.099668
false
4,527,958
1
0
1
2
I'm using VirtualEnv on Windows XP. I'm wondering if I have my brain wrapped around it correctly: I ran virtualenv ENV and it created C:\WINDOWS\system32\ENV. I then changed my PATH variable to include C:\WINDOWS\system32\ENV\Scripts instead of C:\Python27\Scripts. Then, I checked out Django into C:\WINDOWS\system32\ENV\Lib\site-packages\django-trunk, updated my PYTHON_PATH variable to point the new Django directory, and continued to easy_install other things (which of course go into my new C:\WINDOWS\system32\ENV\Lib\site-packages directory). I understand why I should use VirtualEnv so I can run multiple versions of Django, and other libraries on the same machine, but does this mean that to switch between environments I have to basically change my PATH and PYTHON_PATH variable? So, I go from developing one Django project which uses Django 1.2 in an environment called ENV and then change my PATH and such so that I can use an environment called ENV2 which has the dev version of Django? Is that basically it, or is there some better way to automatically do all this (I could update my path in Python code, but that would require me to write machine-specific code in my application)? Also, how does this process compare to using VirtualEnv on Linux (I'm quite the beginner at Linux).
Best method of extracting text from multiple html files into one CSV file
4,528,928
1
1
2,299
0
python
I don't know if Python natively supports XPath, but if it does, you should do some research on that subject. Another alternative solution would be regular expressions.
0
0
0
0
2010-12-25T01:02:00.000
3
0.066568
false
4,528,915
0
0
1
1
After reading this forum I am not sure which method is best to extract sections of data into a CSV file I.e. Python/Beautiful Soup/html2text. Because of the large number of files, I want to try and write a script I can run within the Terminal. Output: One CSV file, with lines of text and five columns of data. e.g. first and last line 100 2010-12-20 145 ABC 04110000 1 2010-11-10 133 DDD 041123847 Thanks!
How to test my GAE site for performance
4,536,343
1
2
193
0
python,google-app-engine,load-testing
You can get a free linux micro instance from EC2 and then run ab (apache benchmark) with lots of requests. You can change number of requests, concurrent requests and you can even launch multiple EC2 instances from different data centers.
0
0
1
1
2010-12-25T09:37:00.000
4
0.049958
false
4,529,913
0
0
1
2
I am building a GAE site that uses AJAX/JSON for almost all its tasks including building the UI elements, all interactions and client-server requests. What is a good way to test it for highloads so that I could have some statistics about how much resources 1000 average users per some period of time would take. I think I can create some Python functions for this purpose. What can you advise? Thanks.
How to test my GAE site for performance
4,547,737
0
2
193
0
python,google-app-engine,load-testing
If you have the budget for it, a professional load testing tool will save you a lot of time and produce more accurate results. Some of those tools handle AJAX apps better than others. I will naturally recommend our product (Web Performance Load Tester) and one of our engineers will help you get it working with your site. You should, of course, evaluate other products to see what works best for your site. Load Impact and Browser Mob are online services that in many cases handle AJAX better than the more traditional tools (except ours!), but they also have downsides.
0
0
1
1
2010-12-25T09:37:00.000
4
0
false
4,529,913
0
0
1
2
I am building a GAE site that uses AJAX/JSON for almost all its tasks including building the UI elements, all interactions and client-server requests. What is a good way to test it for highloads so that I could have some statistics about how much resources 1000 average users per some period of time would take. I think I can create some Python functions for this purpose. What can you advise? Thanks.
Python Eggs on Google App Engine
4,530,218
0
0
883
0
python,google-app-engine,virtualenv,pip
If you use easy_install instead of pip you can run it with the --install-dir argument to specify a non-default installation directory.
0
1
0
0
2010-12-25T11:51:00.000
2
0
false
4,530,183
1
0
1
1
Usually I would use virtualenv and pip for deployment of web applications. With Google App Engine this doesn't work, because all import statement are relative to directory of the application. The most common approach I saw was to simply copy the packages from site-packages to the directory of the application. This involves manual work and is error-prone. Another approach was to changes install_lib and install_scripts in ~/.pydisutils.cfg, but this doesn't allow me to use pip in my home directory simultaneously. Do you have any suggestions for this?
Python Web Framework with best Mongo support
50,201,839
0
17
9,196
1
python,mongodb
There is no stable support for mongodb using django framework. I tried using mongoengine, but unlike models, provided for admin in django framework, there is no support for mongoengine. Correct if I am wrong.
0
0
0
0
2010-12-26T17:14:00.000
4
0
false
4,534,684
0
0
1
1
I'm looking to write a small web app to utilise a dataset I already have stored in a MongoDB collection. I've been writing more Python than other languages lately and would like to broaden my repertoire and write a Python web app. It seems however that most if not all of the current popular Python web development frameworks favour MySQL and others with no mention given to MongoDB. I am aware that there are more than likely plugins written to allow Mongo be used with existing frameworks but so far have found little as to documentation that compares and contrasts them. I was wondering what in people's experience is the Python web development framework with the best MongoDB support? Many thanks in advance, Patrick
Django Asynchronous Processing
4,536,676
14
8
9,924
0
python,django,asynchronous,celery,cython
Celery would be perfect for this. Since what you're doing is relatively simple (read: you don't need complex rules about how tasks should be routed), you could probably get away with using the Redis backend, which means you don't need to setup/configure RabbitMQ (which, in my experience, is more difficult). I use Redis with the most a dev build of Celery, and here are the relevant bits of my config: # Use redis as a queue BROKER_BACKEND = "kombu.transport.pyredis.Transport" BROKER_HOST = "localhost" BROKER_PORT = 6379 BROKER_VHOST = "0" # Store results in redis CELERY_RESULT_BACKEND = "redis" REDIS_HOST = "localhost" REDIS_PORT = 6379 REDIS_DB = "0" I'm also using django-celery, which makes the integration with Django happy. Comment if you need any more specific advice.
0
1
0
0
2010-12-26T21:45:00.000
2
1.2
true
4,535,540
0
0
1
1
I have a bunch of Django requests which executes some mathematical computations ( written in C and executed via a Cython module ) which may take an indeterminate amount ( on the order of 1 second ) of time to execute. Also the requests don't need to access the database and are all independent of each other and Django. Right now everything is synchronous ( using Gunicorn with sync worker types ) but I'd like to make this asynchronous and nonblocking. In short I'd like to do something: Receive the AJAX request Allocate task to an available worker ( without blocking the main Django web application ) Worker executes task in some unknown amount of time Django returns the result of the computation (a list of strings) as JSON whenever the task completes I am very new to asynchronous Django, and so my question is what is the best stack for doing this. Is this sort of process something a task queue is well suited for? Would anyone recommend Tornado + Celery + RabbitMQ, or perhaps something else? Thanks in advance!
Creating a Better Tabbed Interface in Django
4,536,356
0
0
719
0
javascript,jquery,python,css,django
I usually just pass in the selected tab in the context in each view that utilizes the tabs, and select the tab in a common header based on that value.
0
0
0
0
2010-12-27T02:46:00.000
2
0
false
4,536,346
0
0
1
1
I've been trying to create a tabbed interface using Django. The current effort (which works fine) is having each template have the header hard-coded in, with the selected tab given the "selected" CSS attribute. Of course, this is a massive violation of DRY and I'm looking to remedy it. My current idea is adding a jQuery script to the page that looks at all the tabs and sets one to "selected" if it's text matches the beginning of the title for the page. Is there a better way to do this without using JavaScript and just pure CSS?
WSGI server that processes request despite client disconnecting? - Python
4,540,187
1
0
672
0
python,django,wsgi,uwsgi,gevent
almost all wsgi servers do that. I'm not sure what you mean. gunicorn paste cherrypy twisted.web apache with mod_wsgi werkzeug ...
0
1
0
0
2010-12-27T16:24:00.000
1
0.197375
false
4,540,089
0
0
1
1
I need to find a stable wsgi server that won't stop processing requests when client disconnect. I'm not sure if uWSGI or gunicorn would fit this criteria. Forgot to add this: I am also trying to return a response before the request gets processed. Any ideas?
Recommended python library/framework for local web app?
4,543,622
0
13
7,559
0
python,windows,web-applications
Pylons is extremely easy to use once you get some simple configuration set up, you'll have to have a good idea of what you want though.
0
0
0
0
2010-12-28T04:14:00.000
10
0
false
4,543,604
0
0
1
4
I want to create a simple LOCAL web app in Python. The web server and "back-end" code will run on the same system (initially, Windows system) as the UI. I doubt it matters, but the UI will be a typical webish combo of Google Chrome, HTML, CSS, JavaScript, and jQuery. There are a TON of Python-based web programming frameworks, but they all seem designed for building sophisticated, large-scale apps with lots of back-end infrastructure. I want the opposite: Something very simple, lightweight, and easily self-contained--just enough web server and framework to create/support a local web app. Suggestions?
Recommended python library/framework for local web app?
4,544,013
0
13
7,559
0
python,windows,web-applications
Django comes with a built-in web server that allows you to fully test your application locally (via localhost:8080 or something of the sort). As a matter of fact, I've used it more than once to run a complete web-application locally prior to deploying it to a server. I see no reason you can't use it for your own local web-app purposes. Although it may seem that Django is big and complex, this solution is self-contained and simple to run: Install Django Go through the great tutorial, which very soon shows you how to run the web-server Write your code That's about it. Deploying it to other machines is also simple to do, especially with something like virtualenv. If you don't want a large web-framework at all, I'll have to join Greg's advice to use BaseHTTPServer. I've used it before for specialized local applications and it's working well, doing what's expected from it and not much more. It's a very flexible solution allowing you to build something quite custom if you need it.
0
0
0
0
2010-12-28T04:14:00.000
10
0
false
4,543,604
0
0
1
4
I want to create a simple LOCAL web app in Python. The web server and "back-end" code will run on the same system (initially, Windows system) as the UI. I doubt it matters, but the UI will be a typical webish combo of Google Chrome, HTML, CSS, JavaScript, and jQuery. There are a TON of Python-based web programming frameworks, but they all seem designed for building sophisticated, large-scale apps with lots of back-end infrastructure. I want the opposite: Something very simple, lightweight, and easily self-contained--just enough web server and framework to create/support a local web app. Suggestions?
Recommended python library/framework for local web app?
4,544,175
0
13
7,559
0
python,windows,web-applications
chances are, you want an admin interface for basic CRUD operations on some database tables. Then Django is your best choice.
0
0
0
0
2010-12-28T04:14:00.000
10
0
false
4,543,604
0
0
1
4
I want to create a simple LOCAL web app in Python. The web server and "back-end" code will run on the same system (initially, Windows system) as the UI. I doubt it matters, but the UI will be a typical webish combo of Google Chrome, HTML, CSS, JavaScript, and jQuery. There are a TON of Python-based web programming frameworks, but they all seem designed for building sophisticated, large-scale apps with lots of back-end infrastructure. I want the opposite: Something very simple, lightweight, and easily self-contained--just enough web server and framework to create/support a local web app. Suggestions?
Recommended python library/framework for local web app?
4,544,317
0
13
7,559
0
python,windows,web-applications
Any framework will do this. Django certainly will do, but since you want something smaller, I'd recommend will BFG/Pyramid, which is very lightweight, extremely extensible and flexible and fun to use. But there are loads of others, and as mentioned, the built in wsgiref is as lightweight as you get. :-)
0
0
0
0
2010-12-28T04:14:00.000
10
0
false
4,543,604
0
0
1
4
I want to create a simple LOCAL web app in Python. The web server and "back-end" code will run on the same system (initially, Windows system) as the UI. I doubt it matters, but the UI will be a typical webish combo of Google Chrome, HTML, CSS, JavaScript, and jQuery. There are a TON of Python-based web programming frameworks, but they all seem designed for building sophisticated, large-scale apps with lots of back-end infrastructure. I want the opposite: Something very simple, lightweight, and easily self-contained--just enough web server and framework to create/support a local web app. Suggestions?
Python-like decorators in Java?
4,551,485
8
27
12,568
0
java,python
The simplest thing to do is to write a method like "assertCredentials" and call that method at the start of every method that needs credentials. If credentials are not set, the method should throw an exception, which will abort the parent method. Java has annotations that can be used to decorate methods, etc., but I don't think using annotations in this case would simplify things.
0
0
0
1
2010-12-29T04:22:00.000
3
1
false
4,551,457
1
0
1
1
I spend most of my time programming in Python, so forgive me if my approach to this problem is short-sited: I want to have certain methods of a class require login credentials. Simply, each method should check whether the class variable user is set, and if so, continue, but if not, spit out a "you need to login" message. In Python, I would just write a decorator to do this. How can I accomplish the same thing in java with as little redundant code as possible? Thanks!
Options for creating forms, distributing them and collecting info
4,553,233
0
0
59
0
python
So you have a requirement to NOT use a website for this? That's strange. But PDF forms is OK? And it's potentially a large amount of people? You realize the only way to collect that data is that people fill in the PDF form, save it and e-mail it. Or well, a lot of people will print the form out and send it by snail mail of course. In which case you might want to just send out the forms in paper in the first place. Nothing wrong with that, but you'll have to hire people to type all the forms in. Although it is perfectly possible to save all the incoming PDF's in a directory (but be careful to not save duplicates or overwrite anything, so good luck in keeping track of that) and then extract the data from the PDF's, it's really better to have some sort of application that does this. Of course you could make an EXE file and send out, but then what about OS X and Linux users? No, make an application. But make it web-based. And yeah, that means HTML forms, and if your boss says "no" to that, then explain to him why he is wrong. It's really the only sane way. If you fail, then make the HTML forms very dynamic with Javascript, and call the "Ajax forms" instead. It will be 99% likely to fool whoever came up with that strange requirement. :-)
0
0
0
0
2010-12-29T09:48:00.000
1
0
false
4,553,034
0
0
1
1
What options do I have for creating a form intended for collecting data from a potentially big amount of people? (Preferably in Python) I am looking for options other than HTML forms. PDF Forms seem to be an option, but my tendency until now has been to avoid them. Standard desktop app seems to be the way to go, but it means a new application has to be installed on each computer that wants to fill the form. It could be a standalone executable that does not need installation. If you want to collect this info, you need to provide some means of saving the data into some file and then some way to import that info into another tool that does the data collection and analysis. I feel like I am reinventing the wheel. Isn't there some other way of doing this type of job? Regards
which Forms libaray to use with Flask and SQLAlchemy
4,559,302
1
3
2,942
0
python,forms,sqlalchemy,flask
You can also use "deform" which currently powers repoze.BFG aka Pylons2. It has some nice "magical" methods for creating collection of forms and adding more forms on the fly. If you liked django then deform may be a good choice.
0
0
0
0
2010-12-29T15:05:00.000
2
0.099668
false
4,555,188
0
0
1
1
I am working on a web app based on Flask and SQLAlchemy. Most of forms/models are related and therefore need to use a library that's flexible enough to handle multiple forms and allows easy overriding [or creation] of default widgets. Can someone recommend a good forms library (other than formalchemy). I really liked django forms but wondering if there's an alternative.
Is there a way to do runtime inspection for django apps? (Any IDE that does this?)
4,556,856
1
2
305
0
python,django,ide
You can do that with PyCharm from JetBrains.
0
0
0
0
2010-12-29T18:41:00.000
2
0.099668
false
4,556,847
0
0
1
1
I want to do runtime inspection for django apps, meaning, I want to run an app and be able to break/step through/inspect runtime variables. Is there any IDE that support this or anyway to commandline run django to do this? I know that the Django shell exists, however, that just sets up an environment and doesn't provide inspection of running code. Thanks you
Easiest non-Java way to write HBase MapReduce on CDH3?
4,567,653
0
1
1,322
0
python,hadoop,mapreduce,hbase
It's not precisely an answer, but it's the closest I got -- I asked in #hbase on irc.freenode.net yesterday, and one of the Cloudera employees responded. The "Input Splits" problem I'm having with Pig is specific to Pig 0.7, and Pig 0.8 will be bundled with Cloudera CDH3 Beta 4 (no ETA on that). Therefore, what I want to do (easily write M/R jobs using HBase tables as both sink and source) will be possible in their next release. It also seems that the HBaseStorage class will be generally improved to help with read/write operations from ANY JVM language, as well, making Jython, JRuby, Scala and Clojure all much more feasible as well. So the answer to the question, at this time, is "Wait for CDH3 Beta 4", or if you're impatient, "Download the latest version of Pig and pray that it's compatible with your HBase"
0
1
0
0
2010-12-29T19:12:00.000
1
1.2
true
4,557,045
0
1
1
1
I've been working on this for a long time, and I feel very worn out; I'm hoping for an [obvious?] insight from SO community that might get my pet project back on the move, so I can stop kicking myself. I'm using Cloudera CDH3, HBase .89 and Hadoop .20. I have a Python/Django app that writes data to a single HBase table using the Thrift interface, and that works great. Now I want to Map/Reduce it into some more HBase tables. The obvious answer here is either Dumbo or Apache PIG, but with Pig, the HBaseStorage adapter support isn't available for my version yet (Pig is able to load the classes and definitions, but freezes at the "Map" step, complaining about "Input Splits"; Pig mailing lists suggest this is fixed in Pig 0.8, which is incompatible with CDH3 Hadoop, so I'd have to use edge versions of everything [i think]). I can't find any information on how to make Dumbo use HBaseStorage as a data sink. I don't care if it's Python, Ruby, Scala, Clojure, Jython, JRuby or even PHP, I just really don't want to write Java (for lots of reasons, most of them involving the sinking feeling I get every time I have to convert an Int() to IntWritable() etc). I've tried literally every last solution and example I can find (for the last 4 weeks) for writing HBase Map/Reduce jobs in alternative languages, but everything seems to be either outdated or incomplete. Please, Stack Overflow, save me from my own devices!
Using builtin 'str' function in web.py templates: global name not found
58,953,916
0
2
1,084
0
python,web.py
Or you can use the construct "%d" to convert ints to string, as: stringified_int="%d" % n or in the template style using your question: $ filename="img[0-%d]" % n I don't know if this works for python2, but for python3 it works.
0
0
0
0
2010-12-29T20:33:00.000
2
0
false
4,557,635
0
0
1
1
I've spent way too much time trying to figure this out: I'm passing a template a number like so and trying to make it a string: $def with (num) $(str(num)) or $str(num) This generates an error saying global name "str" not found. Edit & Solution: I'm doing this so I can refer to "img[0-n].png". If num is passed as a number, you can make this string by just saying "img$(num).png". No need to convert num to string explicitly.
From asp.net to python/ruby/php
11,289,391
0
0
1,531
0
php,python,ruby
PHP and use codecanyon.net to get things up and running quick. I got INRtracker.com running in under 2 months with what I just mentioned. If you're going to use php, then get wamp and then after you install it, restart your computer. Then click on the Wampserver short cut on your desktop to start it up and then click on the icon in the bottom right of your desktop (you might have to click a little arrow) and then click start all services, then you can put php files in your wamp/www folder (you should be able to get to that from your C drive). Then you test them by going to http://localhost/filename.php in your browser. Have fun dude!
0
0
0
1
2010-12-30T10:39:00.000
5
0
false
4,561,909
0
0
1
1
I've done a lot of web development in JSP/JSF, and lately quite a lot in ASP.NET. I would like to learn one of the following: ruby/python/php, for quick and simple projects. I don't really care which one it is as long as it meets following demands: - decent IDE (forget the notepad/pspad etc.), something with code completition (like eclipse/visual studio/netbeans) - it has to be able to run on windows (IDE and environment) Thanks for suggestions Cheers
Creating readable html with django templates
4,567,219
0
15
5,075
0
python,html,django,templates
The readability of HTML doesn't matter. In a system like Django or Rails, HTML is an output format, not a source format. When people edit HTML by hand, they are right to be concerned about indentation and spacing, because it is a source format, and someone will have to edit it in the future. But the output of templates is just that: output. The browser doesn't care about the indentation. At this point the only people who read the HTML are people looking at View - Source.
0
0
0
0
2010-12-30T23:20:00.000
6
0
false
4,567,031
0
0
1
1
When using Django for html templating how do I create good html markup formatting. I am trying to make use of content blocks. But the content blocks show up at different levels of indentation in different templates. How do I get the content blocks to show indented like it would be if someone was to hand write the html. I am having the same problem with newlines; I can smash all the blocks together in the template. At that point the html looks better, but the templates are unmaintainable. I guess the question is how to you create pretty html markup with the django templating system? I am surprised by the answers so far. I find that nicely formatted HTML aids in writing the corresponding CSS and JavaScript. As well as making it easier to add content later on.
Multiple inheritance in Python; how to do so in Java?
4,567,713
0
1
474
0
java,python,multiple-inheritance
You can define the abilities in interfaces and implement them in your classes.
0
0
0
0
2010-12-31T02:30:00.000
8
0
false
4,567,692
1
0
1
4
I'm porting some Python code to Java, and I am having trouble dealing with the following problem: I have some classes which need to have abilities A, B, or C. Class 1 needs ability A, class 2 needs A, B and C, and class 3 needs B and C. Most importantly, I want to easily be able to change what class can have what ability in the future. I solved this problem pretty easily with multiple inheritance in Python. I'm trying to figure out the best way to do it in Java, but I can't come up with as good of a solution. I know multiple inheritance is frowned-upon, so I'd appreciate being taught a better way. Thanks!
Multiple inheritance in Python; how to do so in Java?
4,567,774
0
1
474
0
java,python,multiple-inheritance
If what you need is interface inheritance, then as mentioned before, you can always implement multiple interfaces. If you're looking for implementation inheritance, you're somewhat out of luck. The best solution is probably to use delegation — replace the extra superclasses with fields, and implement methods that just delegate to those fields. It does require writing a lot of repetitive delegation methods, but it's rather unavoidable in Java (without resorting to AspectJ or other bytecode-munging tricks; careful, this way madness lies …).
0
0
0
0
2010-12-31T02:30:00.000
8
0
false
4,567,692
1
0
1
4
I'm porting some Python code to Java, and I am having trouble dealing with the following problem: I have some classes which need to have abilities A, B, or C. Class 1 needs ability A, class 2 needs A, B and C, and class 3 needs B and C. Most importantly, I want to easily be able to change what class can have what ability in the future. I solved this problem pretty easily with multiple inheritance in Python. I'm trying to figure out the best way to do it in Java, but I can't come up with as good of a solution. I know multiple inheritance is frowned-upon, so I'd appreciate being taught a better way. Thanks!
Multiple inheritance in Python; how to do so in Java?
4,567,861
0
1
474
0
java,python,multiple-inheritance
This is a bit tangential, but you can have python code running in Java via Jython (http://www.jython.org/). This addresses the porting to Java part, not the solving multiple inheritance part (I think you need to determine which is relevant)
0
0
0
0
2010-12-31T02:30:00.000
8
0
false
4,567,692
1
0
1
4
I'm porting some Python code to Java, and I am having trouble dealing with the following problem: I have some classes which need to have abilities A, B, or C. Class 1 needs ability A, class 2 needs A, B and C, and class 3 needs B and C. Most importantly, I want to easily be able to change what class can have what ability in the future. I solved this problem pretty easily with multiple inheritance in Python. I'm trying to figure out the best way to do it in Java, but I can't come up with as good of a solution. I know multiple inheritance is frowned-upon, so I'd appreciate being taught a better way. Thanks!
Multiple inheritance in Python; how to do so in Java?
4,567,720
0
1
474
0
java,python,multiple-inheritance
In java you don't have multiple inheritance, instead you can implement multiple interfaces. So your class 1 will implement interface A and B. Class 2 will implement interface A, B and C. Class 3 will implement B and C.
0
0
0
0
2010-12-31T02:30:00.000
8
0
false
4,567,692
1
0
1
4
I'm porting some Python code to Java, and I am having trouble dealing with the following problem: I have some classes which need to have abilities A, B, or C. Class 1 needs ability A, class 2 needs A, B and C, and class 3 needs B and C. Most importantly, I want to easily be able to change what class can have what ability in the future. I solved this problem pretty easily with multiple inheritance in Python. I'm trying to figure out the best way to do it in Java, but I can't come up with as good of a solution. I know multiple inheritance is frowned-upon, so I'd appreciate being taught a better way. Thanks!
Deliver to a specific version via Inbound Mail service
4,653,923
0
5
129
0
python,google-app-engine,email
There is an easier way to do this than writing code that routes between different versions using URLFetch. If you have a large body of code that is email oriented and you need to have a development version, simply use one of your ten applications as the development application (version). This allows you to do things like have test-specific entities in the development application Datastore and you can test as much as you want running on appengine live. The only constraints are: because the application has a different name, for email sending from the application, you either need to send from your gmail account or have a configuration that switches the application name sending test email to the application will have a slightly different email address (not a big issue I think) keep an app.yaml with a different application name you burn another one of your ten possible apps Most RCS will allow you to have the same project checked out into different directories. Once you are ready for launch (all development code is committed and testing done), update the 'production' directory (except for app.yaml) and then deploy.
0
1
0
0
2010-12-31T02:53:00.000
2
0
false
4,567,769
0
0
1
2
I have an app that services inbound mail and I have deployed a new development version to Google App Engine. The default is currently set to the previous version. Is there a way to specify that inbound mail should be delivered to a particular version? This is well documented using URLs but I can't find any reference to version support in the inbound mail service...
Deliver to a specific version via Inbound Mail service
4,568,426
5
5
129
0
python,google-app-engine,email
No, this isn't currently supported. You could write some code for your default version that routes mail to other versions via URLFetch, though.
0
1
0
0
2010-12-31T02:53:00.000
2
1.2
true
4,567,769
0
0
1
2
I have an app that services inbound mail and I have deployed a new development version to Google App Engine. The default is currently set to the previous version. Is there a way to specify that inbound mail should be delivered to a particular version? This is well documented using URLs but I can't find any reference to version support in the inbound mail service...
What is good practice for writing web applications that control daemons (and their config files)
4,573,569
1
5
332
0
php,python,ruby-on-rails,system-administration,database-administration
I'm not a Unix security guru, but some basic things to think of: Make sure your web app runs as a specific user, and make sure that user has privileged rights only to those files which it is supposed to modify. Do not allow arbitrary inputs to be added to the files, have strict forms where each field is validated to contain only things it should contain, like a-z and 0-9 only, etc. Use HTTPS to access the site. I'm sure there is more to come from the real gurus.
0
1
0
0
2011-01-01T07:34:00.000
2
0.099668
false
4,573,468
0
0
1
1
Can someone suggest some basic advice on dealing with web applications that interact with configuration files like httpd.conf, bind zone files, etc. I understand that it's bad practice, in fact very dangerous to allow arbitrary execution of code without fully validating it and so on. But say you are tasked to write a small app that allows one to add vhosts to an apache configuration. Do you have your code execute with full privileges, do you write future variables into a database and have a cron job (with full privileges) execute a script that pulls the vars from the database and throws them into a template config file, etc. Some thoughts & contributions on this issue would be appreciated. tl;dr - how can you securely write a web app to update/create entries in a config file like apache's httpd.conf, etc.
python web app in prod
4,574,831
1
1
312
0
python,apache,ajp,flup
That setup will work, if you already know flup. There are about a million other configs, including using some pure python server (and Apache ProxyPass). If you need Tomcat, then this is totally reasonable. I recommend adding paste into the mix for managing the configuration.
0
0
0
0
2011-01-01T12:00:00.000
4
0.049958
false
4,573,980
1
0
1
2
I am considering to use python serving json based web services, my priorities are, in order: maintainability easy of coding high availability performance Apache->AJP->Flup->Python seems ok to me, would you recommend another setup or is this ok ?
python web app in prod
4,574,382
0
1
312
0
python,apache,ajp,flup
You don't give enough information to answer this question. What is your web service doing (apart from serving JSON)? Where does the data come from? How many different types of output are there? How dynamic is it? What sort of processing is required? Does it need authentication? Does it need a database connection? Will it be REST? Does it need to handle POSTs as well as just GETs? And so on, and on. Your proposed solution might be good (although like Lennart I don't understand what AJP is doing in there), if you just very simple requirements to serve a few different types of content on a read-only basis. Again, though, if you have anything more complex you may want to look into Django + Piston, running on Apache + mod_wsgi.
0
0
0
0
2011-01-01T12:00:00.000
4
0
false
4,573,980
1
0
1
2
I am considering to use python serving json based web services, my priorities are, in order: maintainability easy of coding high availability performance Apache->AJP->Flup->Python seems ok to me, would you recommend another setup or is this ok ?
most widely used python web app deployment style
4,576,197
0
0
504
0
python,apache,nginx,wsgi,fastcgi
100 req/s is not that hard to achieve these days. Consider the deployment that your framework recommends. Zope for instance, has a decent webserver built in, so mod_proxy_http is good deployment. Since wsgi came to fruition, it has become the preferred mechanism for many frameworks, and they now the builtin web servers are only suitable for development. Regardless of what you deploy with now, it's important to be able to switch/add parts of the stack as necessary - do you want a reverse proxy for static content in there somwhere? You may not need one if you use nginx as it can serve static content from memcached quite well. Summary: use wsgi
0
1
0
0
2011-01-01T20:49:00.000
2
1.2
true
4,575,709
0
0
1
2
I wonder which option is more stable (leaving performance aside) and is more widely used (I assume the widely used one is the most stable): apache -> mod_wsgi apache -> mod_fcgid apache -> mod_proxy_ajp apache -> mod_proxy_http for a project that will serve REST services with small json formatted input and output messages and web pages, up to 100 req/s. Please comment on apache if you think nginx etc. is more suitable. Thanks.
most widely used python web app deployment style
4,575,875
2
0
504
0
python,apache,nginx,wsgi,fastcgi
apache -> mod-wsgi is currently the "recommended" solution. But it also depends on your needs quite a bit. There is quite a difference between running 1 heavy application versus 1 light aplication or many light applications. Personally my preferred setup is still nginx -> apache -> mod_wsgi with multiple apache servers for heavy sites.
0
1
0
0
2011-01-01T20:49:00.000
2
0.197375
false
4,575,709
0
0
1
2
I wonder which option is more stable (leaving performance aside) and is more widely used (I assume the widely used one is the most stable): apache -> mod_wsgi apache -> mod_fcgid apache -> mod_proxy_ajp apache -> mod_proxy_http for a project that will serve REST services with small json formatted input and output messages and web pages, up to 100 req/s. Please comment on apache if you think nginx etc. is more suitable. Thanks.
Making a somehow complex application: Ruby vs Python
4,577,169
1
0
955
0
python,ruby,user-interface
I've never used Ruby but I'm sure there is virtually no difference between the 2 when it comes to libraries. I know what you want can be done with Python using wxPython or pygame (or the combination of two). But I'm sure there are similar libs for Ruby. So just look at both languages and use the one you like better.
1
0
0
1
2011-01-02T04:38:00.000
2
0.099668
false
4,577,156
0
0
1
2
I want to create a somehow complex application: It is a game level editor. You can put in tiles and other objects for a level. Then "compress" the level data into a file. With another application, it will read the file's data and play the game. The application is for Windows mainly. Other platforms are yet to be considered. So I need help deciding: If you were to do something like what I described, which programming language would you choose? I want to decide between Ruby or Python. I want you to help me choose depending on my following needs: Easy GUI platform for making the editor. Can show sprites, move, transform them etc. Can play audio. Can compress data, graphics and audio. The compressed file can only be read by another application I make.
Making a somehow complex application: Ruby vs Python
4,577,168
4
0
955
0
python,ruby,user-interface
Python + PyGame. Hands down. You will benefit from: Good docs for both the language and PyGame GUI, sprites, and audio all in one, again with PyGame Better Windows support than Ruby (you can install both Python and PyGame from .exes) Desktop applications (esp. for Windows) aren't really Ruby's sweet spot. PyGame will serve your purposes perfectly, though. That's not to say you couldn't do it with Ruby; you could write this in any language. But for ease of use, Python is the way to go.
1
0
0
1
2011-01-02T04:38:00.000
2
1.2
true
4,577,156
0
0
1
2
I want to create a somehow complex application: It is a game level editor. You can put in tiles and other objects for a level. Then "compress" the level data into a file. With another application, it will read the file's data and play the game. The application is for Windows mainly. Other platforms are yet to be considered. So I need help deciding: If you were to do something like what I described, which programming language would you choose? I want to decide between Ruby or Python. I want you to help me choose depending on my following needs: Easy GUI platform for making the editor. Can show sprites, move, transform them etc. Can play audio. Can compress data, graphics and audio. The compressed file can only be read by another application I make.
What web programming languages are capable of making this web app?
4,577,421
4
2
1,046
0
python,web-applications,jsf,jsf-2,primefaces
The best approach is whatever is best for you. If Python isn't your strength but Java is, then use Java. If you're a Python expert and know little Java, use Python. There are so many resources on the Internet supporting so many platforms that the decision really comes down to what works best for you.
0
0
0
0
2011-01-02T06:22:00.000
3
0.26052
false
4,577,414
0
0
1
3
I'm exploring many technologies, but I would like your input on which web framework would make this the easiest/ most possible. I'm currently looking to JSP/JSF/Primefaces, but I'm not sure if that is capable of this app. Here's a basic description of the app: Users log in with their username and password (maybe I can somehow incorporate OPENID)? With a really nice UI, they will be presented a large list of questions specific to a certain category, for example, "Cooking". (I will manually compile this list and make it available.) When they click on any of these questions, a little input box opens up below it to allow the user to put in a link/URL. If the link they enter has the same question on that webpage the URL points to, they will be awarded one point. This question then disappears and gets added to a different page that has a list of all correctly linked questions. On the right side of the screen, there will be a leaderboard with the usernames of the people with the top ten points. The idea is relatively simple - to be able to compile links to external websites for specific questions by allowing many people to contribute. I know I can build the UI easily with Primefaces. [B]What I'm not sure is if JSP/JSF gives the ability to parse HTML at a certain URL to see if it contains words.[/B] I can do this with python easily by using urllib, but I can't use python for web GUI building (it is very difficult). What is the best approach? Any help would be appreciated!!! Thanks!
What web programming languages are capable of making this web app?
4,577,777
2
2
1,046
0
python,web-applications,jsf,jsf-2,primefaces
For starters, forget about JSP/JSF. This is an old combination that had many problems. Please consider Facelets/JSF. Facelets is the default templating language in the current version of JSF, while JSP is there only for backwards compatibility. What I'm not sure is if JSP/JSF gives the ability to parse HTML at a certain URL to see if it contains words. Yes it does, although the actual fetching of data and parsing of its content will be done by plain Java code. This itself has nothing to do with the JSF APIs. With JSF you create a Facelet containing your UI (input fields, buttons, etc). Then still using JSF you bind this to a so-called backing bean, which is primarily a normal Java class with only one or two JSF specific annotations applied to it (e.g. @ManagedBean). When the user enters the URL and presses some button, JSF takes care of calling some action method in your Java class (backing bean). In this action method you now have access to the URL the user entered, and from here on plain Java coding starts and JSF specifics end. You can put the code that fetches the URL and does the parsing you require in a separate helper class (separation of concerns), or at your discretion directly in the backing bean. The choice is yours. Incidentally we had a very junior programmer at our office use JSF for something not unlike what you are requesting here and he succeeded in doing it in a short time. It thus really isn't that hard ;)
0
0
0
0
2011-01-02T06:22:00.000
3
0.132549
false
4,577,414
0
0
1
3
I'm exploring many technologies, but I would like your input on which web framework would make this the easiest/ most possible. I'm currently looking to JSP/JSF/Primefaces, but I'm not sure if that is capable of this app. Here's a basic description of the app: Users log in with their username and password (maybe I can somehow incorporate OPENID)? With a really nice UI, they will be presented a large list of questions specific to a certain category, for example, "Cooking". (I will manually compile this list and make it available.) When they click on any of these questions, a little input box opens up below it to allow the user to put in a link/URL. If the link they enter has the same question on that webpage the URL points to, they will be awarded one point. This question then disappears and gets added to a different page that has a list of all correctly linked questions. On the right side of the screen, there will be a leaderboard with the usernames of the people with the top ten points. The idea is relatively simple - to be able to compile links to external websites for specific questions by allowing many people to contribute. I know I can build the UI easily with Primefaces. [B]What I'm not sure is if JSP/JSF gives the ability to parse HTML at a certain URL to see if it contains words.[/B] I can do this with python easily by using urllib, but I can't use python for web GUI building (it is very difficult). What is the best approach? Any help would be appreciated!!! Thanks!
What web programming languages are capable of making this web app?
4,578,505
1
2
1,046
0
python,web-applications,jsf,jsf-2,primefaces
No web technology does what you want. Parsing documents found at certain urls is out of the scope of building web interfaces. However, each of Java's web technologies will give you, without limits, access to a rich and varied (if not too rich and much too varied) set of libraries and frameworks running on JVM. You could safely say that if there is a library for doing something, there will be a Java version available. Downloading and parsing a document will not require more than what is available in the standard library (unless you insist on injecting your dependencies or crosscutting your concerns), so no problems with doing your project with JSP, or JSF/Primefaces, or whatever. Since you claim to already know Python, and since you will have to add some HTML/CSS anyway, I suggest you try Django. It's dead simple, has a set of OpenID plugins to choose from, will give you admin interface for free (so you can prime the pump with the first set of links).
0
0
0
0
2011-01-02T06:22:00.000
3
0.066568
false
4,577,414
0
0
1
3
I'm exploring many technologies, but I would like your input on which web framework would make this the easiest/ most possible. I'm currently looking to JSP/JSF/Primefaces, but I'm not sure if that is capable of this app. Here's a basic description of the app: Users log in with their username and password (maybe I can somehow incorporate OPENID)? With a really nice UI, they will be presented a large list of questions specific to a certain category, for example, "Cooking". (I will manually compile this list and make it available.) When they click on any of these questions, a little input box opens up below it to allow the user to put in a link/URL. If the link they enter has the same question on that webpage the URL points to, they will be awarded one point. This question then disappears and gets added to a different page that has a list of all correctly linked questions. On the right side of the screen, there will be a leaderboard with the usernames of the people with the top ten points. The idea is relatively simple - to be able to compile links to external websites for specific questions by allowing many people to contribute. I know I can build the UI easily with Primefaces. [B]What I'm not sure is if JSP/JSF gives the ability to parse HTML at a certain URL to see if it contains words.[/B] I can do this with python easily by using urllib, but I can't use python for web GUI building (it is very difficult). What is the best approach? Any help would be appreciated!!! Thanks!
AppEngine social application
5,873,214
1
1
261
0
java,python,google-app-engine
If you decide to use python, try a look to vikuit social. It runs over Google Appengine , it's open source ( GNU3) and perhaps it's a good base to your development.
0
1
0
0
2011-01-02T14:14:00.000
2
0.099668
false
4,578,729
0
0
1
1
I started developing my application in AppEngine Java, however I noticed that Facebook has officially discontinued the support for the Java API and the third party API was last updated a year ago. Does anybody use Java + Social plugins? How has it been going so far? Should I switch to Python, I'd not want to since, I'm not very great with Python and have written significant amounts of code in Java already.
Switching from web to desktop development
4,580,914
-1
3
731
0
python,orm,air
Is the target platform windows? If so, consider C# with WPF. The UI is constructed using XAML which is very similar to HTML/CSS. C# uses the .NET framework, so while it is a much different programming language than PHP, the transition should not be too difficult.
0
0
0
0
2011-01-02T15:10:00.000
5
-0.039979
false
4,578,957
0
0
1
3
Being a web developer (php, symfony, doctrine) for 2 years now, I was recently asked by a friend to come up with a desktop solution. So I developed a project, installed a LAMP on his machine and he is mostly happy using it now. But I'm not. It just doesn't seem right to wait for a server response from a localhost. Obviously php isn't suited for desktop development. So, my question is: what language \ framework would you advice a php programmer if he was going to develop a desktop application (something that you can install, that has it's own gui, but utilizes the similar concepts of web apps: css, javascript, orm). I would like to bring up Python as a possible answer to my question. Does anyone have an experience of developing a desktop app with Python, utilizing an ORM and(or) HTML-based GUI?
Switching from web to desktop development
4,662,716
0
3
731
0
python,orm,air
I've recently come across a project called Titanium. It's a platform for developing native desktop (and mobile) applications using web technology (html/css, javascript and server-side languages like python, ruby and PHP! That's exactly what I was looking for. However, I haven't found no decent documentation or examples, community is small, so it seems to be underdeveloped right now. It mostly aims at mobile development rather that desktop. Apart from Titanium, I currently don't see a better way for a web developer to go.
0
0
0
0
2011-01-02T15:10:00.000
5
0
false
4,578,957
0
0
1
3
Being a web developer (php, symfony, doctrine) for 2 years now, I was recently asked by a friend to come up with a desktop solution. So I developed a project, installed a LAMP on his machine and he is mostly happy using it now. But I'm not. It just doesn't seem right to wait for a server response from a localhost. Obviously php isn't suited for desktop development. So, my question is: what language \ framework would you advice a php programmer if he was going to develop a desktop application (something that you can install, that has it's own gui, but utilizes the similar concepts of web apps: css, javascript, orm). I would like to bring up Python as a possible answer to my question. Does anyone have an experience of developing a desktop app with Python, utilizing an ORM and(or) HTML-based GUI?
Switching from web to desktop development
4,580,946
1
3
731
0
python,orm,air
It just doesn't seem right to wait for a server response from a localhost Exactly! Did you profile your app, both on server side and in browser? There's no reason for a local web app to be slow, except if it is designed or implemented suboptimally. Same applies to a desktop app, which is generally harder to create. So, fire up your Firebug, do explain plan to every database query your app issues, add whatever profiling your PHP settings allow, and see where the problem lies. Most probably, it's not in the choice of language.
0
0
0
0
2011-01-02T15:10:00.000
5
0.039979
false
4,578,957
0
0
1
3
Being a web developer (php, symfony, doctrine) for 2 years now, I was recently asked by a friend to come up with a desktop solution. So I developed a project, installed a LAMP on his machine and he is mostly happy using it now. But I'm not. It just doesn't seem right to wait for a server response from a localhost. Obviously php isn't suited for desktop development. So, my question is: what language \ framework would you advice a php programmer if he was going to develop a desktop application (something that you can install, that has it's own gui, but utilizes the similar concepts of web apps: css, javascript, orm). I would like to bring up Python as a possible answer to my question. Does anyone have an experience of developing a desktop app with Python, utilizing an ORM and(or) HTML-based GUI?
Django signals as IPC
4,579,082
2
1
736
0
python,django,ipc,twisted
No. Django signals are restricted to a single Python interpreter. You'll need to put together something else (sockets, JSON-RPC, XMPP, etc.) in order to perform IPC.
0
0
0
0
2011-01-02T15:32:00.000
1
0.379949
false
4,579,051
0
0
1
1
So I have written a websocket application in Twisted. The application is a basic game between a number of users, but trying to use the web socket for setup and record saving is painful, so I was looking into using Django based rendering for the supplementary information (as in standings, game setup, lobby list, etc) and leave the websockets for the real action. I know I can use some basic IPC functionality to have the Django requests signal the Twisted application, but I was curious if the Django signal system would also work across applications as a simple form of IPC...
Webscraping Techniques using PHP or Python
4,586,678
0
3
4,219
0
php,python,screen-scraping
We do something sort of like this with RSS feeds using Python -- we use ElementTree since RSS is usually guaranteed to be well-formed. Beautiful Soup is probably better suited for parsing HTML. Insofar as dealing with 100 different sites, try to write an abstraction that works on most of them and transforms the page into a common data-structure you can work with. Then override parts of the abstraction to handle individual sites which differ from the norm. Scrapers are usually I/O bound -- look into coroutine libraries like eventlet or gevent to exploit some I/O parallelism and speed up the whole process.
0
0
1
1
2011-01-03T14:59:00.000
4
0
false
4,585,490
0
0
1
2
I need to scrape about 100 websites that are very similar in the content that they provide. My first doubt. Should be possible to write a generic script to scrape all the 100 websites or in scraping techniques is only possible to write scripts for particular websites. (Dumb question.). I think I should ask what possibility is easier. Write 100 different scripts for each website is hard. Second question. My primary language is PHP, but after searching here on Stackoverflow I found that one of the most advanced scrapers is "Beautiful Soup" in Python. Should be possible to make calls in PHP to "Beautiful Soup" in Python? Or should be better to do all the script in Python? Give me some clues on how should I go. Sorry for my weak english. Best Regards,
Webscraping Techniques using PHP or Python
4,585,784
0
3
4,219
0
php,python,screen-scraping
I've done this a few ways. 1: with grep, sed, and awk. This is about the same as 2: regex. These methods are very direct, but fail whenever the HTML structure of the site changes. 3: PHP's XML/HTML parser DomDocument. This is far more reliable than regex, but I found it annoying to work with (I hate the mixture of PHP arrays and objects). If you want to use PHP, PHPQuery is probably a good solution, as Thai suggested. 4: Python and BeautifulSoup. I can't say enough good things about BeautifulSoup, and this is the method I recommend. I found my code feels cleaner in Python, and BeautifulSoup was very easy and efficient to work with. Good documentation, too. You will have to specialize your script for each site. It depends on what sort of information you wish to extract. If it was something standard like body title, of course you wouldn't have to change anything, but it's likely the info you want is more specific?
0
0
1
1
2011-01-03T14:59:00.000
4
0
false
4,585,490
0
0
1
2
I need to scrape about 100 websites that are very similar in the content that they provide. My first doubt. Should be possible to write a generic script to scrape all the 100 websites or in scraping techniques is only possible to write scripts for particular websites. (Dumb question.). I think I should ask what possibility is easier. Write 100 different scripts for each website is hard. Second question. My primary language is PHP, but after searching here on Stackoverflow I found that one of the most advanced scrapers is "Beautiful Soup" in Python. Should be possible to make calls in PHP to "Beautiful Soup" in Python? Or should be better to do all the script in Python? Give me some clues on how should I go. Sorry for my weak english. Best Regards,
How can/should I break an html document into parts using Python? (Techno- and logically)
4,588,436
2
1
214
0
python,html,beautifulsoup
Yes, you use BeautifulSoup or lxml. Both have methods to find the nodes you want to extract. You can then also recreate HTML from the node objects, and hence save that HTML to new files.
0
0
1
0
2011-01-03T21:03:00.000
1
0.379949
false
4,588,345
0
0
1
1
I've an HTML document I'm trying to break into separate, smaller chunks. Say, take each < h3 > header and turn into its own separate file, using only the HTML encoded within that chunk (along with html, head, body, tags). I am using Python's Beautiful Soup which I am new to, but seems easy to use for easy tasks such as this (Any better suggestions like lxml or Mini-dom?). So: 1) How do I go, 'parse all < h3 >s and turn each into a separate doc'? Anything from pointers to the right direction to code snippets to online documentation (found quite little for Soup) will be appreciated. 2) Logically, finding the tag won't be enough - I need to physically 'cut it out' and put it in a separate file (and remove it from original). Perhaps parsing the text lines instead of nodes would be easier (albeit super-ugly, parsing raw text from a formed structure...?) 3) Similarly related - suppose I want to delete a certain attribute from all tags of a type (like, delete the alignment attribute of all images). This seems easy but I've failed - any help will be appreciated! Thanks for any help!
Django Python Garbage Collection woes
4,595,172
1
11
4,978
0
python,django,garbage-collection
An alternative might be to disable GC altogether, and configure mod_wsgi (or whatever you're using) to kill and restart processes more frequently.
0
0
0
0
2011-01-04T14:12:00.000
5
0.039979
false
4,594,522
0
0
1
1
After 2 days of debug, I nailed down my time-hog: the Python garbage collector. My application holds a lot of objects in memory. And it works well. The GC does the usual rounds (I have not played with the default thresholds of (700, 10, 10)). Once in a while, in the middle of an important transaction, the 2nd generation sweep kicks in and reviews my ~1.5M generation 2 objects. This takes 2 seconds! The nominal transaction takes less than 0.1 seconds. My question is what should I do? I can turn off generation 2 sweeps (by setting a very high threshold - is this the right way?) and the GC is obedient. When should I turn them on? We implemented a web service using Django, and each user request takes about 0.1 seconds. Optimally, I will run these GC gen 2 cycles between user API requests. But how do I do that? My view ends with return HttpResponse(), AFTER which I would like to run a gen 2 GC sweep. How do I do that? Does this approach even make sense? Can I mark the object that NEVER need to be garbage collected so the GC will not test them every 2nd gen cycle? How can I configure the GC to run full sweeps when the Django server is relatively idle? Python 2.6.6 on multiple platforms (Windows / Linux).
Same question to multiple remote users with different login
4,601,330
0
1
132
0
python,django,google-app-engine
Yes, this should be possible. Your solution might look something like this: A user creates a new group. You generate some random questions and store them in a list for that group. More users join that group. You start showing the questions to the users by selecting the first question in that groups list. Once all users have correctly answered the question, you remove the question from the groups list and show the next question.
0
1
0
0
2011-01-04T16:46:00.000
1
1.2
true
4,596,093
0
0
1
1
I am very new to Google App Engine and Python. I am building a web application using Python and Django which is based on questions and multiple answers. Once the users are logged in to the website, they will be provided with random questions from a datastore. What my requirement is, if certain users want to form a group so that they all can get the same random questions at the same time to answer, is this possible? Without forming the group, each user gets different random questions on their end.
Django - some permissions are missing in admin tool
4,596,968
3
2
2,169
0
python,django,eclipse,django-admin,django-permissions
Where did it go? When you incrementally change your database by dropping tables and running syncdb, the PK of the application table are reflected in the auth_permission table can change. Don't do "incremental" surgery if you can avoid it. Extract your data. Drop your database. Rerun syncdb to rebuild it. Reload your data. You'll be much happier.
0
0
0
0
2011-01-04T18:04:00.000
1
1.2
true
4,596,817
0
0
1
1
I'm not quite sure what to make of this. I'm using Django in eclipse. I made a new django project, and copied the code from a previous django project into this one. I ran syncdb to set up the database. I went to the admin page to recreate my groups, but I noticed that some of the permissions were missing from the list of Available permissions. In the previous project, there was a permission to let me "access" a profile. In this project, that permission isn't on the list, but it's also the permission that I need. Where did it go?
Django: how can I update more than one record at once?
4,601,203
6
1
6,395
1
python,django
If you have to update each record with a different value, then of couse you have to iterate over each record. If you wish to do update them all with the same value, then just use the update method of the queryset.
0
0
0
0
2011-01-05T04:53:00.000
3
1.2
true
4,600,938
0
0
1
1
How can I update multiple records in a queryset efficiently? Do I just loop over the queryset, edit , and call save() for each one of them? Is it equivalent to psycopg2's executemany?
How can I create a single log-in and profile for a network of three sites using Django?
4,601,235
1
3
121
0
python,django,pinax
Depends on your server(s). Do all the sites have access to the same DB? Then use dcrodjer's answer. If not, you can implement a OAuth style Single Signon Service, that the other sites authenticate against. Ex: site1.example.com site2.example.com site3.example.com siteN.example.com Would auth against oauth.example.com
0
0
0
0
2011-01-05T05:37:00.000
3
0.066568
false
4,601,148
0
0
1
1
How can I create a single log-in and profile for a network of three sites using Django? I have a network of three sites and instead of having the user create a profile at each of the three sites, I'd like the user to only need to register one time, and then be able to use all three. Is there an elegant solution to this problem?
Are there such things as Django gems - plugins , like there are Ruby gems
4,609,941
5
7
2,981
0
python,django
To add a little more detail to the other answers, the equivalent of Ruby gems are Python "eggs". I don't know Ruby so I'm not sure how exact that equivalence is, but eggs are basically the install files for Python packages - they give Python information about which packages are installed. The egg is typically created by running ./setup.py install from within the package directory or by using setuptools, i.e. pip install NAME-OF-PACKAGE (the latter method is usually easier as it will download the files for you and install all the needed dependencies). It should be noted that any package (any folder with an __init__.py file in it) or module that is placed on the PYTHONPATH can be imported by Python; installing them just helps keep track of which packages are being used and makes it easier to work with complicated packages that have a lot of dependencies. In Django, as @EinLama mentioned, these add-on packages function as Apps (they typically include files like models.py, views.py, urls.py, etc). Some of them are actually installed by Python as described above, and some are just folders that should be put on your PYTHONPATH (in both cases you also have to add them to the installed apps in your settings.py file so Django knows about them). In addition, I often come across (open source) packages that do almost what I want, but not exactly, or that are designed in such a way that the details which must be changed to integrate the app into my project are hard-coded. In these cases, I often put the app directly in my project folder, where I can make changes as necessary and access it as if it's any of my other apps. In this case the package is, of course, confined to that particular Django project - it is never installed by Python and no egg is created. Hope that clarifies things a bit.
0
0
0
0
2011-01-05T07:38:00.000
3
0.321513
false
4,601,788
0
0
1
1
Are there such things as Django gems - plugins , like there are Ruby gems , like auth management plugin, etc.
Django Model Field Default to Null
4,604,988
40
79
80,656
0
python,django,django-models
If you specify null=True on the model field then the value will be stored as NULL in the database if the user does not provide a value.
0
0
0
0
2011-01-05T13:56:00.000
3
1
false
4,604,814
0
0
1
3
I need to have my Django application allow me to have a default value of NULL set for a certain model field. I've looked over the null, blank, and default parameters, but it's not very clear what combination of the three I need to use to get the desired effect. I've tried setting default=NULL but it threw an error. If I specify blank=True, null=True and no default, will it just default back to NULL come runtime?
Django Model Field Default to Null
4,604,826
134
79
80,656
0
python,django,django-models
Try default=None. There is no NULL in python.
0
0
0
0
2011-01-05T13:56:00.000
3
1.2
true
4,604,814
0
0
1
3
I need to have my Django application allow me to have a default value of NULL set for a certain model field. I've looked over the null, blank, and default parameters, but it's not very clear what combination of the three I need to use to get the desired effect. I've tried setting default=NULL but it threw an error. If I specify blank=True, null=True and no default, will it just default back to NULL come runtime?
Django Model Field Default to Null
55,348,386
20
79
80,656
0
python,django,django-models
blank=True allows you to input nothing (i.e "", None) and keep it empty. null=True means the database row is allowed to be NULL. default=None sets the field to None if no other value is given.
0
0
0
0
2011-01-05T13:56:00.000
3
1
false
4,604,814
0
0
1
3
I need to have my Django application allow me to have a default value of NULL set for a certain model field. I've looked over the null, blank, and default parameters, but it's not very clear what combination of the three I need to use to get the desired effect. I've tried setting default=NULL but it threw an error. If I specify blank=True, null=True and no default, will it just default back to NULL come runtime?
Is it possible to use different technologies in one website
4,605,453
0
0
99
0
python,web,yahoo
If they're different pages, they can easily be created by different software. So if a mail application written in Java offers a link to an address book, the address book can easily be Python--that's just a matter of configuring the server. If you need an addressbook component within the mail application, that's a bit more complicated, but still doable. Especially with Java and .NET it's possible to run various languages on the same platform (e.g. Jython and Ironpython run Python on the JAVA and .NET VMs respectively).
0
0
0
1
2011-01-05T14:37:00.000
6
0
false
4,605,243
0
0
1
4
I was watching the tutorials for python and the guy told that he coded the Address books and spell checker for yahoo mail in python. Now initially i was thinking that if i build the website then i have to use one language either php or java or asp or anything. But i am confused how can we make make separate modules in diff languages and combine to make one website Any ideas
Is it possible to use different technologies in one website
4,605,394
2
0
99
0
python,web,yahoo
Phisical architecture of web application can be different from the logical one visible through browser. Basically it is achieved by putting front web server (think of apache with mod_proxy, but it can be any other moder web server supporting reverse proxying) and mounting web application servers (java/python/whatever) to different paths (like /app1 for java app, /app1/subapp for python app, /app2 for php app). Of course those applications work independently by default, so if you want to pass some data between you have to establish some communication between (direct socket-to-socket or indirect with some messaging middleware or database). In general it is very broad topic, so if you're interested, try with some basic keywords: application servers, load balancing, reverse proxy, url rewriting.
0
0
0
1
2011-01-05T14:37:00.000
6
1.2
true
4,605,243
0
0
1
4
I was watching the tutorials for python and the guy told that he coded the Address books and spell checker for yahoo mail in python. Now initially i was thinking that if i build the website then i have to use one language either php or java or asp or anything. But i am confused how can we make make separate modules in diff languages and combine to make one website Any ideas
Is it possible to use different technologies in one website
4,605,290
0
0
99
0
python,web,yahoo
I know in Ruby on Rails, you can execute bash commands. Example: puts ls
0
0
0
1
2011-01-05T14:37:00.000
6
0
false
4,605,243
0
0
1
4
I was watching the tutorials for python and the guy told that he coded the Address books and spell checker for yahoo mail in python. Now initially i was thinking that if i build the website then i have to use one language either php or java or asp or anything. But i am confused how can we make make separate modules in diff languages and combine to make one website Any ideas
Is it possible to use different technologies in one website
4,605,266
1
0
99
0
python,web,yahoo
You can use any language to provide a web service, so you can for example provide a REST/SOAP web service that returns JSON or XML. The web service can be written in any language, and the language used to interact with the web service can be any language, as all languages nowadays have JSON and XML parsers. You can setup different subdomains to be used by different servers and setup those applications in any language you'd like.
0
0
0
1
2011-01-05T14:37:00.000
6
0.033321
false
4,605,243
0
0
1
4
I was watching the tutorials for python and the guy told that he coded the Address books and spell checker for yahoo mail in python. Now initially i was thinking that if i build the website then i have to use one language either php or java or asp or anything. But i am confused how can we make make separate modules in diff languages and combine to make one website Any ideas
access to sms inbox
4,612,488
2
2
939
0
c++,python,java-me,symbian,inbox
Reading message from inbox in j2me is not possible if you want to read sms then you can send message using particular port and your j2me application should listen on that port otherwise you can go with symbian c++ where it is possible.
0
0
0
1
2011-01-05T22:43:00.000
3
1.2
true
4,609,956
0
0
1
2
How can I access the SMS inbox from an application (on Symbian s60)? Us it possible with j2me? How about C++ or Python?
access to sms inbox
4,611,971
2
2
939
0
c++,python,java-me,symbian,inbox
In j2me, you can't access the native message box related stuff like Inbox, Sent Message or etc. But it is possible in c++. I don't know about python.
0
0
0
1
2011-01-05T22:43:00.000
3
0.132549
false
4,609,956
0
0
1
2
How can I access the SMS inbox from an application (on Symbian s60)? Us it possible with j2me? How about C++ or Python?
Help needed with db structure
4,613,300
3
0
81
1
python,django,data-structures
You don't need a table per stock symbol, you just need one of the fields in the table to be the stock symbol. The table might be called StockPrices and its fields might be ticker_symbol - the stock ticker symbol time - the time of the stock quote price - the price of the stock at that time As long as ticker_symbol is an indexed field you can do powerful queries like SELECT time,price FROM StockPrices WHERE ticker_symbol='GOOG' ORDER BY time DESC and they will be very efficient. You can also store as many symbols as you like in this table. You could add other tables for dividends, volume information and such. In all cases you probably have a composite key of ticker_symbol and time.
0
0
0
0
2011-01-06T09:02:00.000
2
1.2
true
4,613,251
0
0
1
1
I'm developing a web app that uses stock data. The stock data can be stored in: Files DB The structure of the data is simple: there's a daily set and a weekly set. If files are used, then I can store a file per symbol/set, such as GOOGLE_DAILY and GOOGLE_WEEKLY. Each set includes a simple list of (Date, open/hight/low/close, volume, dividend) fields. But how can I do it with DB? Should I use relational or other db? I thought about using 2 tables per each symbol, but that would generate thousands of tables, which doesn't feel right. Thanks.
Has anyone gotten distribute to work correctly with github, specifically private repositories?
4,615,208
3
2
816
0
python,github,distribution,distutils,easy-install
If you know, that "pip" works, why don't you just use "pip"? "pip" can not only install from a package index, but also from a local source directory. Just use pip install . instead of python setup.py install. Concerning your impression, it is indeed wrong. "pip" and "distribute" are altogether different projects with different aims. "pip" is a frontend to the distutils/setuptools API, trying to replace the rather weird "easy_install" frontend, whereas "distribute" is an alternative implementation of the backend "setuptools" API (which only includes an "easy_install" implementation for the sake of compatibility). "pip" isn't tied to "distribute" and also works with the old "setuptools" implementation. I'd therefore recommend to always use "pip" for all package installations, and to never use "easy_install" or "python setup.py install". "pip" just works, whereas the other two are somewhat strange.
0
1
0
1
2011-01-06T11:46:00.000
1
1.2
true
4,614,552
0
0
1
1
I built a small micro framework for our web service / web app and have it hosted it in a private repository on github. I've added the private github repo in the dependency_links and have verified that it exists in dependency_links.txt When I execute python setup.py install, I get unknown url type: git+ssh, so I looked deeper into the code and realized that distribute only has support for svn+ url types. I was under the (apparently wrong) impression that distribute used pip under the hood, but looks like it still uses easy_install. Has anyone found a solution to using distutils / distribute to install private github repos as dependencies?
Video website on google application engine
4,625,277
3
4
2,593
0
python,google-app-engine,google-cloud-datastore
As Nick pointed out, it can be done and it won't be a straight forward implementation. I would suggest using the Amazon EC2 service for video conversion and Amazon S3 for storing of videos while using App Engine for creating a fast reliable and unbelievably scalable front-end.
0
1
0
0
2011-01-06T16:06:00.000
3
0.197375
false
4,616,934
0
0
1
1
I am going to work on a video website where users/admin will be able to upload the videos and play them using some opensource javascript player. However, I want to know if it is a good idea to start this kind of project on google app engine considering its limitations to server and store the data. What are the issues which I may have to encounter on Google application engine and if there are any possible solutions for those issues. Currently, I have doubts on converting the videos while uploading, creating images from the videos uploaded (something like ffmpeg for google app engine) and whether google app engine will allow streaming for large videos considering its request and response constraints. Please suggest. Thanks in advance.
Django installed apps location for classes on system path
4,622,144
1
0
651
0
python,django,path
I'm guessing when you include a class in the django installed apps it's copied somewhere, but where? That's completely a wrong guess. A better guess is that your download directory is on your Python path. Somehow you had two copies (or more) of the module. You've deleted some, but not all of the copies. Keep searching on your PYTHONPATH for all the others. Search every directory in sys.path. Note that .pth files in your site-packages directory are also part of your PATH.
0
0
0
0
2011-01-07T01:26:00.000
3
0.066568
false
4,621,726
0
0
1
2
I'm using the Django Registration class, it's great, but the last version shipped with an issue and it's no longer updated I've installed it on my path (downloaded it then python setup.py install) then added it to my projects installed apps I'm on debian, and It's copied itself to /usr/lib/python2.5/site-packages/registration So far so great, but editing (hell, even deleting) has NO effect on my project I'm guessing when you include a class in the django installed apps it's copied somewhere, but where? As always, thanks for your time!
Django installed apps location for classes on system path
4,623,663
1
0
651
0
python,django,path
I would suggest that you try the following workflow: Create a new virtualenv for every project you start (use --no-site-packages) Install all your dependencies (including django) in the project's virtualenv Use pip install -e to install things you need to have an editable version of. Alternatively, fork the project, and install using pip install -e hg+http://...
0
0
0
0
2011-01-07T01:26:00.000
3
1.2
true
4,621,726
0
0
1
2
I'm using the Django Registration class, it's great, but the last version shipped with an issue and it's no longer updated I've installed it on my path (downloaded it then python setup.py install) then added it to my projects installed apps I'm on debian, and It's copied itself to /usr/lib/python2.5/site-packages/registration So far so great, but editing (hell, even deleting) has NO effect on my project I'm guessing when you include a class in the django installed apps it's copied somewhere, but where? As always, thanks for your time!
how can i optimize a django oracle connection?
6,583,775
2
2
305
1
python,django,oracle,django-models,model
The solution was to add an index.
0
0
0
0
2011-01-07T13:18:00.000
1
1.2
true
4,625,835
0
0
1
1
I work with Oracle Database and lastest Django but when i use the default user model is the query very slow what can i do?
Accessing database objects in Django form cleaner
4,630,577
2
0
90
0
python,django,django-forms
Yes - take a look at self.instance from inside your form's clean method.
0
0
0
0
2011-01-07T21:41:00.000
1
1.2
true
4,630,564
0
0
1
1
Is there a way to access the database object from the django form cleaner? Or at least the URL to which the form data was posted? If I can get the URL, I can query for the database object. My use case is that, I have a form that should raise an error if the database object from which the form was generated is in some particular state.
Async spawing of processes: design question - Celery or Twisted
4,635,379
5
6
1,689
0
python,django,asynchronous,twisted
On my system, RabbitMQ running with pretty reasonable defaults is using about 2MB of RAM. Celeryd uses a bit more, but not an excessive amount. In my opinion, the overhead of RabbitMQ and celery are pretty much negligible compared to the rest of the stack. If you're processing jobs that are going to take several minutes to complete, those jobs are what will overwhelm your 512MB server as soon as your traffic increases, not RabbitMQ. Starting off with RabbitMQ and Celery will at least set you up nicely to scale those jobs out horizontally though, so you're definitely on the right track there. Sure, you could write your own job control in Twisted, but I don't see it gaining you much. Twisted has pretty good performance, but I wouldn't expect it to outperform RabbitMQ by enough to justify the time and potential for introducing bugs and architectural limitations. Mostly, it just seems like the wrong spot to worry about optimizing. Take the time that you would've spent re-writing RabbitMQ and work on reducing those three minute jobs by 20% or something. Or just spend an extra $20/month and double your capacity.
0
1
0
0
2011-01-08T17:08:00.000
3
1.2
true
4,635,033
0
0
1
2
All: I'm seeking input/guidance/and design ideas. My goal is to find a lean but reliable way to take XML payload from an HTTP POST (no problems with this part), parse it, and spawn a relatively long-lived process asynchronously. The spawned process is CPU intensive and will last for roughly three minutes. I don't expect much load at first, but there's a definite possibility that I will need to scale this out horizontally across servers as traffic hopefully increases. I really like the Celery/Django stack for this use: it's very intuitive and has all of the built-in framework to accomplish exactly what I need. I started down that path with zeal, but I soon found my little 512MB RAM cloud server had only 100MB of free memory and I started sensing that I was headed for trouble once I went live with all of my processes running full-tilt. Also, it's got several moving parts: RabbitMQ, MySQL, cerleryd, ligthttpd and the django container. I can absolutely increase the size of my server, but I'm hoping to keep my costs down to a minimum at this early phase of this project. As an alternative, I'm considering using twisted for the process management, as well as perspective broker for the remote systems, should they be needed. But for me at least, while twisted is brilliant, I feel like I'm signing up for a lot going down that path: writing protocols, callback management, keeping track of job states, etc. The benefits here are pretty obvious - excellent performance, far fewer moving parts, and a smaller memory footprint (note: I need to verify the memory part). I'm heavily skewed toward Python for this - it's much more enjoyable for me than the alternatives :) I'd greatly appreciate any perspective on this. I'm concerned about starting things off on the wrong track, and redoing this later with production traffic will be painful. -Matt
Async spawing of processes: design question - Celery or Twisted
4,635,409
0
6
1,689
0
python,django,asynchronous,twisted
I'll answer this question as though I was the one doing the project and hopefully that might give you some insight. I'm working on a project that will require the use of a queue, a web server for the public facing web application and several job clients. The idea is to have the web server continuously running (no need for a very powerful machine here). However, the work is handled by these job clients which are more powerful machines that can be started and stopped at will. The job queue will also reside on the same machine as the web application. When a job gets inserted into the queue, a process that starts the job clients will kick into action and spin the first client. Using a load balancer that can start new servers as the load increases, I don't have to bother about managing the number of servers running to process jobs in the queue. If there are no jobs in the queue after a while, all job clients can be terminated. I will suggest using a setup similar to this. You don't want job execution to affect the performance of your web application.
0
1
0
0
2011-01-08T17:08:00.000
3
0
false
4,635,033
0
0
1
2
All: I'm seeking input/guidance/and design ideas. My goal is to find a lean but reliable way to take XML payload from an HTTP POST (no problems with this part), parse it, and spawn a relatively long-lived process asynchronously. The spawned process is CPU intensive and will last for roughly three minutes. I don't expect much load at first, but there's a definite possibility that I will need to scale this out horizontally across servers as traffic hopefully increases. I really like the Celery/Django stack for this use: it's very intuitive and has all of the built-in framework to accomplish exactly what I need. I started down that path with zeal, but I soon found my little 512MB RAM cloud server had only 100MB of free memory and I started sensing that I was headed for trouble once I went live with all of my processes running full-tilt. Also, it's got several moving parts: RabbitMQ, MySQL, cerleryd, ligthttpd and the django container. I can absolutely increase the size of my server, but I'm hoping to keep my costs down to a minimum at this early phase of this project. As an alternative, I'm considering using twisted for the process management, as well as perspective broker for the remote systems, should they be needed. But for me at least, while twisted is brilliant, I feel like I'm signing up for a lot going down that path: writing protocols, callback management, keeping track of job states, etc. The benefits here are pretty obvious - excellent performance, far fewer moving parts, and a smaller memory footprint (note: I need to verify the memory part). I'm heavily skewed toward Python for this - it's much more enjoyable for me than the alternatives :) I'd greatly appreciate any perspective on this. I'm concerned about starting things off on the wrong track, and redoing this later with production traffic will be painful. -Matt
PHP or Python for Image Processing?
4,641,208
1
3
2,343
0
php,python,image,image-processing,image-manipulation
Possibly neither; it depends on what you want to do. Both PHP and Python are scripting languages, and are therefore not suited for high-performance numerical routines (which most image processing requires). However, they both have a number of image-processing libraries available for them, the innards of which are probably written in C. These will be fast. If these libraries do what you want, then fine. If you need to so something custom, then you're probably better off with C or C++ (or Pascal, or whatever) if speed of execution is of concern.
0
0
0
1
2011-01-09T19:19:00.000
5
0.039979
false
4,641,187
1
0
1
4
I am writing an application for image processing. I am just wondering which programming language would be the best fit. Python or PHP. This process is system based not web based so I am just thinking if Python could be of more help. Let me know your thoughts!
PHP or Python for Image Processing?
4,641,228
2
3
2,343
0
php,python,image,image-processing,image-manipulation
One cannot suggest much without knowing the kind of image processing you have in mind. If you just want to do some generic rotate/resize/etc then I guess there isn't much difference. If you want to do something more complex, then study the libraries and decide which fits best for your particular task. If you want to do something really custom, then C or similar language might be a better fit for the task.
0
0
0
1
2011-01-09T19:19:00.000
5
0.07983
false
4,641,187
1
0
1
4
I am writing an application for image processing. I am just wondering which programming language would be the best fit. Python or PHP. This process is system based not web based so I am just thinking if Python could be of more help. Let me know your thoughts!
PHP or Python for Image Processing?
4,641,242
0
3
2,343
0
php,python,image,image-processing,image-manipulation
It really depends on what you want to do with the images. You probably should just use a batch or similar script to run a command that does the processing your looking for. Between the two languages, I would go with python. The command line interface for php is only a recent addition, while python was designed primarily as a scripting language, not for serving pages. For a console application, python is a better fit.
0
0
0
1
2011-01-09T19:19:00.000
5
0
false
4,641,187
1
0
1
4
I am writing an application for image processing. I am just wondering which programming language would be the best fit. Python or PHP. This process is system based not web based so I am just thinking if Python could be of more help. Let me know your thoughts!