Search Results

Search found 3554 results on 143 pages for 'django modelforms'.

Page 135/143 | < Previous Page | 131 132 133 134 135 136 137 138 139 140 141 142  | Next Page >

  • Port a live system from App Engine Helper to App Engine Patch

    - by Alexander
    I am running a live system that is currently serving about 20K pages a day which is based on App Engine Helper (Python) with session support provided by AppEngine utilities. One problem that I have been having is that sessions are occasionally randomly logging out. I would like to try using the App Engine Patch, since it has "native" django session support, but I am worried that this is possibly going to be like doing a brain transplant. Specifically, current database models are all inhereted from BaseModel provided by the App Engine Helper. While, App Engine Patch does not have this inheritance. Does anyone know if it is possible to migrate a live system from App Engine Helper to App Engine Patch? If so, do you have any advice or warnings that I should heed, before attempting this transition? Thank you and kind regards Alex

    Read the article

  • CoffeeScript on Windows?

    - by Nick Perkins
    How can I try CoffeeScript on Windows? The installation instructions are only for *nix: http://jashkenas.github.com/coffee-script/#installation EDIT: I don't think I need node.js -- I am just writing javascript for web pages, (using some jQuery, etc)...So all I really want is simple way to write CoffeeScript and "compile" it down to JavaScript. Isn't there a Ruby program that would do it? Or even better, a windows exe? (i dont use ASP.NET either...i use Python/Django) FINAL EDIT: Thanks for the help -- In the end I installed VirtualBox and created a virtual Linux machine which I now use to program coffeescript with node.js. (It was surprisingly easy to start using VirtualBox -- easier than doing the Cygwin thing). I run jEdit (for which you can get a CoffeeScript syntax highlighter) and I put the corresponding js file side-by-side with the coffeescript file. When I compile the coffeescript to js, the editor automatically re-loads the new javascript, which allows me to check that it has compiled the way I expect (which is a good thing while learning the coffeescript syntax).

    Read the article

  • Python - do big doc strings waste memory?

    - by orokusaki
    I understand that in Python a string is simply an expression and a string by itself would be garbage collected immediately upon return of control to a code's caller, but... Large class/method doc strings in your code: do they waste memory by building the string objects up? Module level doc strings: are they stored infinitely by the interpreter? Does this even matter? My only concern came from the idea that if I'm using a large framework like Django, or multiple large open source libraries, they tend to be very well documented with potentially multiple megabytes of text. In these cases are the doc strings loaded into memory for code that's used along the way, and then kept there, or is it collected immediately like normal strings?

    Read the article

  • IE8 AJAX GET setRequestHeaders not working unless params provided in URL

    - by bobthabuilda
    I'm trying to create an AJAX request in IE8. var xhr = new ActiveXObject( 'Msxml2.XMLHTTP' ); xhr.open( 'GET', '/ajax/' ); // Required header for Django to detect AJAX request xhr.setRequestHeader( 'X-Requested-With', 'XMLHttpRequest' ); xhr.onreadystatechange = function() { if ( this.readyState == 4 ) console.log(this.responseText); } xhr.send( null ); This works perfectly fine in Firefox, Chrome, Safari. In IE8 however, all of my AJAX test requests work EXCEPT for ones where I'm performing GETs without any query string params (such as the one above). POSTs work without question, and GET requests only work whenever I include query strings in the URL, like this: xhr.open( 'GET', '/ajax/?foo=bar' ) I'm also 110% positive that my server code is handling these requests appropriately, so, this stumps me completely. Does anyone have any clue as to what might be causing this?

    Read the article

  • Why a very good PHP framework - Qcodo (or Qcubed - its branch) - is so unpopular?

    - by Pawel
    I am wondering why this framework (QCodo) is almost forgotten and totally unpopular. I've started using it a few years ago and it is the only thing that keeps me with PHP. Yeah ... its development is stuck (that's why there is now more active branch Qcubed) but it is still very good piece of software. Its main advantages: Event driven (something like asp.net) no spaghetti code Powerful code generation good ORM follows DRY very simple AJAX support is fun to write Since then I wanted to be trendy and checked Django but I cannot write normal request-based web application (it just doesn't feel right). Don't believe? chess.com is written with it and surely there are plenty others. My 2 questions are: Have you heard of it (PHP people)? If you are using it what is your opinion about it (show us examples of your work) Thanks

    Read the article

  • Can zlib.crc32 or zlib.adler32 be safely used to mask primary keys in URLs?

    - by David Eyk
    In Django Design Patterns, the author recommends using zlib.crc32 to mask primary keys in URLs. After some quick testing, I noticed that crc32 produces negative integers about half the time, which seems undesirable for use in a URL. zlib.adler32 does not appear to produce negatives, but is described as "weaker" than CRC. Is this method (either CRC or Adler-32) safe for usage in a URL as an alternate to a primary key? (i.e. is it collision-safe?) Is the "weaker" Adler-32 a satisfactory alternative for this task? How the heck do you reverse this?! That is, how do you determine the original primary key from the checksum?

    Read the article

  • Language of variable names? (native foreign language speakers)

    - by Jj
    We are a spanish speaking development team, we code in django and we all are pretty fluent in english, as all documentation, sample code, APIs, etc come in english. On our last project we chose to name all the variables, class names, modules, files and such in english, even though the whole application was in spanish, we kept a strings file where all our spanish was stored. We did this because it seemed more natural to read the whole code in one language, since keywords, constructs and dependencies have names in english. On new projects we are starting, we are having second thoughts about other teams mantaining our code or just having 3rd parties having to deal with templates or context in spanish. Do you know of any best practice on this matter?

    Read the article

  • Starting Tornado Web

    - by picklepete
    Hi, I'm quite new to using Tornado Web as a web server, and am having a little difficulty keeping it running. I normally use Django and Nginx, and am used to start/stop/restarting the server. However with Tornado I'm having trouble telling it to "run" without directly executing my main python file for the site, ie "python ~/path/to/server.py". I'm sure I'm getting this completely wrong - is there a way of 'bootstrapping' my script so that when Nginx starts, Tornado starts? Any help would be appreciated!

    Read the article

  • What every web developer should know?

    - by arikfr
    Let's say you got a new intern, who's a third-year CS student. He has firm knowledge of the basics, has some experience with C/Java from the courses he took and a lot of desire to learn more. What would you teach him in order to become a good web developer? What I had in mind is: HTML/CSS and the importance of writing semantic markup Javascript, some JS framework (jQuery), JSON Basics of Git/Subversion (whatever you use) The language we use (Ruby, Python, PHP, C#, whatever) Introduction the web framework we use (Rails, Django, ASP.NET MVC...) MVC - what/why/who RESTful web services - how to consume them and how to create one What's on your list?

    Read the article

  • python: how to convert list of lists into a single nested list

    - by Bhuski
    I have a python list of lists as shown below: mylist=[ [['orphan1', ['some value1']]], [['parent1', ['child1', ['child', ['some value2']]]]], [['parent1', ['child2', ['child', ['some value3']]]]] ] I need to convert the above list to some thing like this: result=[ ['orphan1', ['some value1']], ['parent1', ['child1', ['child', ['some value2']]], ['child2', ['child', ['some value3']]]] ] Kindly help me approach this problem. I have given only simple list. In actual scenario here, in my list, even grand parents/grand childs are there. How much ever deep the input nested list is, I need to convert it to a single nested list, with common list elements (parents and grand parents) appearing only once. (but the next to innermost list element('child' in above example) should appear as many times it occurs in the input list. I have been trying to do this last two days, but did not end up with working solution :(. I need to use the output in django template filter: unordered_list so that the resultant nested list appears as a nested unordered list in my html page ..

    Read the article

  • Python utf-8 decoding issue with hashlib.digest() method

    - by Sorw
    Hello StackOverflow community, Using Google App Engine, I wrote a keyToSha256() method within a model class (extending db.Model) : class Car(db.Model): def keyToSha256(self): keyhash = hashlib.sha256(str(self.key())).digest() return keyhash When displaying the output (ultimately within a Django template), I get garbled text, for example : ?????_??!`?I?!?;?QeqN??Al?'2 I was expecting something more in line with this : 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 Am I missing something important ? Despite reading several guides on ASCII, Unicode, utf-8 and the like, I think I'm still far from mastering the secrets of string encoding/decoding. After browsing StackOverflow and searching for insights via Google, I figured out I should ask the question here. Any idea ? Thanks !

    Read the article

  • Update facebook status using pyfacebook offline access

    - by Alon Carmel
    Hey, I'm trying to update a user status from a django python app. The user went thru facebook connect and registers to the app. I got sessionkey and fbuid. fb = Facebook(FACEBOOK_API_KEY, FACEBOOK_SECRET_KEY) if fbsessionkey: fb.session_key = fbsessionkey fb.uid = fbuid fb.auth.createToken() fb.auth.getSession() #update the facebook status fb.users.setStatus(status="testing",clear=False) else: pass What am i doing wrong? im getting: Error 104: Incorrect signature Please note the user already granted offline access also. Please help...

    Read the article

  • Geodjango: importing data from OSGB_1936, displaying in WGS84?

    - by AP257
    I have some polygon data saved in a PostGIS database with projection SRID 27700. geom = models.MultiPolygonField(srid=27700) I want to display the shapes on OpenStreetMap, i.e. with SRID 900913 (I think?). So, two questions: How do I change the code below to output with the right SRID for OpenStreetMap? How can I change the Django code below to give me a nice json object, ready to display as a polygon? area = get_object_or_404(soa.objects, code=my_code) polygon = area.geom return render_to_response('area.html', { 'area': area }, context_instance = RequestContext(request)) Apologies if this question doesn't make sense - I'm pretty new to GeoDjango.

    Read the article

  • Reverse engineer an ORM

    - by Oren Mazor
    Given a [mysql] database with a given schema, is it possible to generate an ORM interface for it? doesn't matter if its php, python or perl. in other words, I have a database and I have to ask it a few questions. while I could just craft a bunch of SQL queries (okay, several dozen), this is way more interesting to think about. is this a valid question, even? I have no design background with ORMs, but I've used a few (django's, symfony's, etc).

    Read the article

  • Getting-started: Setup Database for Node.js

    - by Emile Petrone
    I am new to node.js but am excited to try it out. I am using Express as a web framework, and Jade as a template engine. Both were easy to get setup following this tutorial from Node Camp. However the one problem I am finding is I can't find a simple tutorial for getting a DB set up. I am trying to build a basic chat application (store session and message). Does anyone know of a good tutorial? This other SO post talks about dbs to use- but as this is very different from the Django/MySQL world I've been in, I want to make sure I understand what is going on. Thanks!

    Read the article

  • How can I stop sorl thumbnail from breaking with very long filenames?

    - by bitbutter
    I've noticed that when working with SORL thumbnail, sometimes a user will upload an image with a very long filename, longer than the varfield in the database can hold. The name gets truncated in the database and the project gives errors whenever the image is requested. Is there a smart and safe way to have django automatically truncate long filenames in sorl uploads (prior to saving them in the database) to prevent this sort of thing? As reference, here's how the relevant model from my current project looks: class ArtistImage(models.Model): artist = models.ForeignKey(Artist) position = models.IntegerField() image = ThumbnailField( thumbnail_tag='<span class="artistimagewrapper"><img class="artistimage" src="%(src)s" width="%(width)s" height="%(height)s"></span>', upload_to='uploaded_images/artistimages', size=(900,900), quality=100, options={'crop': 'center'}, extra_thumbnails={ 'small':{ 'size':(92,92), 'quality':100, 'options':{'crop': 'center'}, } } ) class Meta: ordering = ('image',) def __unicode__(self): return (u"%s" % self.image)

    Read the article

  • GAE datastore eager loading in python api

    - by tomus
    I have two models in relation one-to-many: class Question(db.Model): questionText = db.StringProperty(multiline=False) class Answer(db.Model): answerText = db.StringProperty(multiline=False) question = db.ReferenceProperty(Question, collection_name='answers') I have front-end implemented in Flex and use pyamf to load data. When i try to load all answers with related questions all works as desired and I can access field answer.question however in case of loading questions (e.g. by Questions.all() ), 'question.answers' remains empty/null (though on server/python side I can revise question.answers without problem - probably after lazy-loading). So is it possible to load all questions along with answers ? (I know this is possible in JPA Java api but what about python ?) Shoud I use additional setting, GQL query or django framework to make it work ?

    Read the article

  • how to install mysqlDb for MySQL and Python ON WINDOWS

    - by Spikie
    I AM A NET DEVELOPER TRY TO INSTALL MYSQLDB FOR PYTHON I KEEP HAVING THIS ERROR MESSAGE raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb I AM FOLLOWING THIS INSTRUCTION FROM THIS SITE <"http://sourceforge.net/project/shownotes.php?release_id=303257" I DO NOT UNDERSTAND THESE LINES Windows ....... C:... python setup.py install C:... python setup.py bdist_wininst The latter example should build a Windows installer package, if you have the correct tools. In any event, you must have a C compiler. Additionally, you have to set an environment variable (mysqlroot) which is the path to your MySQL installation. In theory, it would be possible to get this information out of the registry, but like I said, I don't do Windows, but I'll accept a patch that does this. I HAVE BEEN SEARCHING FOR ANSWER ALL DAY PLEASE DO ANYBODY REALLY KNOW HOW TO DO THIS OR AT LEAST POINT ME IN THE RIGHT DIRECTION???? THANKS and what is the c compiler for???????

    Read the article

  • Interactive pyDev console at breakpoint

    - by fest
    I'm using Aptana Studio with Pydev 1.5.3 to debug my Django applications. I use PyDev's remote debugger and some code in manage.py and for most of the time this setup is working successfully- I can set breakpoints, inspect variables and step/continue through my code. However, I'd like to execute arbitrary code at the breakpoint- the thing I really miss after switching from pdb to Eclipse debugging. There is an interactive console available in debug perspective but it is inactive for me. So my question- is it possible to set up an interactive console in PyDev with remote debugger which could "inject" code at breakpoint?

    Read the article

  • How to build an interactive search engine web interface using python

    - by asmaier
    I have build a static web interface for searching data from some tables in my PostgreSQL database. The query website consists of a simple textfield for entering the search term, the result website presents the results as a simple html table. The server side code for searching the PostgreSQL database and returning the results is written in python using psycopg2. Now I would like to add some interactive "Ajax features" to my search engine. When entering the search term I would like to be able to see a list of possible search terms like Google does it. On the results page, I would like to be able to sort the table showing the results. What would be the easiest/recommended way to implement these features for my search engine web site? Do I need a full-fledged web framework like Django for that?

    Read the article

  • Best Design for a Facebook clone on GAE Java

    - by charming30
    My current App is written in Python on GAE which can do Contacts management, Genealogy, Social Networking, Photo sharing, Telecom Integration (SMS, iVRS, URL Billing), CRON and performs business logic operations for our Mobile Apps. Current Architecture indlues python, django, jquery, memcache and few telecom APIs. Now, It feels that an SOA Architecture on GAE using Java would be really ideal and scalable for this kind of App where we want to build new features like widgets that users can turn on or off and third party developers can also develop and deploy features. Please correct me or improve the following design decision: UI (Current plan is GWT) Sessions, Security and ACL (Spring MVC 2.x) Reusable Business Logic components (?) Implementation of Web Services (?) Your advice would really help.

    Read the article

  • Key/Value pyqt QComboBox

    - by Danilo
    I want to use a QComboBox with the "keys" and "values" from a tuple similar to the ones used in a django models. For example I have the following structure for a person's sex. SEX_CHOICES = (('M', 'Male'), ('F', 'Female')) The first item of the tuple contains the code of the sex that is stored in the database, and the second one the text that I want to display in the QComboBox as an item. Is there a way in wich I could set the QComboBox value as M and it displays Male. An also when the user select the element Male I could get the selected value as M. Thanks

    Read the article

  • With VIM, use both snipMate and pydiction together (share the <tab> key?)

    - by thornomad
    I am trying to use snipMate and pydiction in vim together - however, both use the <tab> key to perform their genius-auto-completion-snippet-rendering-goodness-that-I-so-desire. When pydiction is installed, snipMate stops working. I assume its because they can't both own the <tab> key. How can I get them to work together? I wouldn't mind mapping one of them to a different key, but I am not really sure how to do this ... (maybe pydiction to the <ctrl-n> key so it mimics vim's autocomplete?). Here is the relevant .vimrc: filetype indent plugin on autocmd FileType python set ft=python.django autocmd FileType html set ft=html.django_template let g:pydiction_location = '~/.vim/ftplugin/pydiction-1.2/complete-dict'

    Read the article

  • Framework Similar to Pylons for Ruby

    - by Travis
    I've been using Python for most of my web projects lately, and have come to really love the Pylons MVC framework. I like the incredible transparency (lack of magic), the built-in components they selected (sqlalchemy, formencode, routes), and the ability to easily change things up (use a different ORM or templating engine). Moving forward, due to constraints at my company, I'm going to be trying out Ruby rather than Python. I'm wondering if people with experience in both have any recommendations for a Ruby framework that is comparable to Pylons. Python is to Django as Ruby is to Rails Python is to Pylons as Ruby is to ?

    Read the article

  • How to create virtual Environment for users on server

    - by Bhushan Nagaonkar
    I have a web application where users can register them self and then save Java and C++ programs in their account. Programs are saved in a tmp directory like, /tmp -user1 --program1 --program2 -user2 --program1 --program2 So all the users folders are in same "tmp" directory. I want to know how can I proved security by not allowing a user to access files of other users. A user will be executing a java or c++ program in his folder which can be used to read files on the server. How to prevent this? I am new to this thing I don't know how to go about this. The server is Linux server and project is in python using Django. Thank in advance

    Read the article

< Previous Page | 131 132 133 134 135 136 137 138 139 140 141 142  | Next Page >