Search Results

Search found 7702 results on 309 pages for 'django validation'.

Page 122/309 | < Previous Page | 118 119 120 121 122 123 124 125 126 127 128 129  | Next Page >

  • Django with custom authentication backends, is Csrf middleware really required ?

    - by Hellnar
    Hello, Under Django 1.1.1, I am using several authentication backends such as social-registration for facebook connect and django-emailauth for email based authentication instead of user names. I am curious if the Csrf middleware is an essential security measure as it seems like it sometimes generates problems, especially with facebook connect. My project is rather simple. Each user have a profile which they can fill and a purchase page where they fill the payment for to do purchases. Either of these pages are protected via @login_required.

    Read the article

  • CakePHP: Same model, set up per form validation rules?

    - by mwaterous
    I have a single model in CakePHP that has multiple forms on different pages of the site that I would like to validate differently even where the field name is the same - I have discovered that you can set 'on' to create|update which has been a handy discovery but I am wondering if there is any other way of explicitly declaring rules based on the form that was submitted? Just to rephrase for clarity, form a and form b contain fields of the same name, but if form a is submitted the fields in question should be validated differently than if they were submitted from form b. Possible?

    Read the article

  • [Django] How to find out whether a model's column is a foreign key?

    - by codethief
    I'm dynamically storing information in the database depending on the request: // table, id and column are provided by the request table_obj = getattr(models, table) record = table_obj.objects.get(pk=id) setattr(record, column, request.POST['value']) The problem is that request.POST['value'] sometimes contains a foreign record's primary key (i.e. an integer) whereas Django expects the column's value to be an object of type ForeignModel: Cannot assign "u'122'": "ModelA.b" must be a "ModelB" instance. Now, is there an elegant way to dynamically check whether b is a column containing foreign keys and what model these keys are linked to? (So that I can load the foreign record by it's primary key and assign it to ModelA?) Or doesn't Django provide information like this to the programmer so I really have to get my hands dirty and use isinstance() on the foreign-key column?

    Read the article

  • How to get rid of this w3 validation error?

    - by Pandiya Chendur
    I developed a web page and now i am validating it with w3c HTML4.0... I got one error it says Error Line 30, Column 57: there is no attribute "DATA-FLEXMENU" href="about.php" class="mainlink" data-flexmenu="flexmenu1">About Us</a></div> You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead). Any ways of getting rid of this error .... Any suggestion...

    Read the article

  • Struts2 JPA Validation error how to forward to action and not lose ActionErrors messages ?

    - by Sebastien Dionne
    I'm using Hibernate validator 4.1 to validate my entity. I have a dashboard that I can access from the action : viewDashboard. In my action, I load 2 List in my acion like this. public String execute() throws Exception { listDocteur = service.listDocteur(); listUser = service.listUser(); return SUCCESS; } In the DashBoard, I have a submit that can add a User. <action name="saveUser" class="com.test.action.CreateUserAction" method="execute" <interceptor-ref name="mybasicStackWithValidation" </interceptor-ref <result name="input"/WEB-INF/jsp/viewDashboard.jsp</result <result name="success" type="redirectAction"viewDashboard</result </action if I submit invalid value, I'll see the error messages, but I'll lose my 2 Lists. If I have a type="redirectAction".. I lose the error messages. in Struts 1, I would forward to the action viewDashboard.do without a redirect and that will works.. but How to do that in Struts2 ?

    Read the article

  • What's the best way to access Neo4j from Django?

    - by abdel
    it seems that i found something that let me confused; i've found two Neo4j to download to python, the first one is: http://pypi.python.org/pypi/neo4j-embedded and the second one is: https://svn.neo4j.org/components/neo4j.py/trunk/ what's the difference between the two? the first one seems to be big (size), so does this mean that if i use it i'll not need the neo4j community release (milestone)? when i've installed the first one, and tried to test a django example, it seems that the directory named "model" https://svn.neo4j.org/components/neo4j.py/trunk/src/main/python/neo4j/model/ is missing? so what's the difference, and who will be better to use with Django? and what about that one? http://pypi.python.org/pypi/neo4django/

    Read the article

  • Really basic Django E-commerce? Where do I start

    - by Andrew
    I'm trying to set up a really basic e-commerce site with Django, and am trying to figure out the best place to start. I am relatively comfortable with the framework itself, but have never done any sort of e-commerce development in any language, so I want to learn about some best practices so I don't make any huge or obvious mistakes. I've looked at Satchmo, and even went as far as installing and playing around with it, but it looks like way more than I want. I basically want to show users a list of things, and let them click a button to buy one. No cart, no shipping, just click a button, connect with Authorize.net (or something similar) to do the transaction, and then display a confirmation page. Any suggestions or online tutorials people have found helpful? Even perhaps a tutorial in another language. Or maybe a really lightweight Django plugin that doesn't try to do everything like Satchmo? I've been coming up with very little so far. Thanks!

    Read the article

  • Turbogears 2 vs Django - any advice on choosing replacement for Turbogears 1?

    - by michela
    I have been using Turbogears 1 for prototyping small sites for the last couple of years and it is getting a little long in the tooth. Any suggestions on making the call between upgrading to Turbogears 2 or switching to something like Django? I'm torn between the familiarity of the TG community who are pretty responsive and do pretty good documentation vs the far larger community using Django. I am quite tempted by the built-in CMS features and the Google AppEngine support. Any advice? Thanks .M.

    Read the article

  • How do I construct a Django form with model objects in a Select widget?

    - by Thierry Lam
    Let's say I'm using the Django Site model: class Site(models.Model): name = models.CharField(max_length=50) My Site values are (key, value): 1. Stackoverflow 2. Serverfault 3. Superuser I want to construct a form with an html select widget with the above values: <select> <option value="1">Stackoverflow</option> <option value="2">Serverfault</option> <option value="3">Superuser</option> </select> I'm thinking of starting with the following code but it's incomplete: class SiteForm(forms.Form): site = forms.IntegerField(widget=forms.Select()) Any ideas how I can achieve that with Django form?

    Read the article

  • Is it possible to use Django's testing framework without having CREATE DATABASE rights?

    - by superjoe30
    Since I don't have a hundred bazillion dollars, my Django app lives on a shared host, where all kinds of crazy rules are in effect. Fortunately, they gave me shell access, which has allowed me to kick butts and take names. However I can't do anything about not having CREATE DATABASE rights. I'm using postgresql and have a killer test suite, but am unable to run it due to the code not being able to create a new database. However I am able to create said database beforehand via cPanel and use it with Django. I just don't have CREATE DATABASE rights. Is there a way I can still run my test suite?

    Read the article

  • ASP.net MVC How to change the Textbox Class upon validation failure?

    - by Harry
    I notice in the default MVC template project that the Account registration fields are highlighted via a class change. I can't seem to get the same behavour out of my own code (in the same project - same CSS etc) What might be stopping this from occuring? Update I believe this relates to one of my other questions Because I was having trouble with NullReferenceExceptions I have changed the Html.ValidationMessage fields to have different names than the target fields. So really, I need to resolve this question

    Read the article

  • pitfalls with mixing storage engines in mysql with django?

    - by Dave Orr
    I'm running a django system over mysql in amazon's cloud, and the database default is innodb. But now I want to put a fulltext index on a couple of tables for searching, which evidently requires myisam. The obvious solution is to just tell mysql to ALTER TABLE to myisam, but are there going to be any issues with that? One that comes to mind is that I'll have to remember to do that any time I build a new version of the database, which should theoretically be rare, but there doesn't seem to be a way to tell django to please set the storage engine at the table level. I guess I could write a migration (we use south). Any other things I might be missing? What could possibly go wrong?

    Read the article

  • How do I specify (1) an order and (2) a meaninful string representation for users in my Django application?

    - by David Faux
    I have a Django application with users. I have a model called "Course" with a foreign key called "teacher" to the default User model that Django provides: class Course(models.Model): ... teacher = models.ForeignKey(User, related_name='courses_taught') When I create a model form to edit information for individual courses, the possible users for the teacher field appear in this long select menu of user names. These users are ordered by ID, which is of meager use to me. How can I order these users by their last names? change the string representation of the User class to be "Firstname Lastname (username)" instead of "username"?

    Read the article

  • How painful is a django project upload to a live (staging) site?

    - by Ignacio
    Hi, I've getting quite fast with a small django project of mine, which I'm developing locally, of course. But, as I had never worked with django before, I'm not aware of what it implies to upload it and test it on a production server. And I'm quite curious, since I'm very eager to test an early release live. I know there is this document, which I think it'll be really helpful: http://djangobook.com/en/2.0/chapter12/ But, are there any details I should take into account before, during and after the deployment? Any advice or best practices? Thanks.

    Read the article

  • How to wait for ajax validation to complete before submitting a form?

    - by Jung
    Having a problem where the form submits before the validateUsername function has a chance to complete the username check on the server-side. How do I submit the form only after the validateUsername function completes? Hope this is clear... form.submit(function(){ if (validateUsername() & validateEmail() & validatePassword()) { return true; } else { return false; } }); function validateUsername(){ usernameInfo.addClass("sign_up_drill"); usernameInfo.text("checking..."); var b = username.val(); var filter = /^[a-zA-Z0-9_]+$/; $.post("../username_check.php",{su_username:username.val()},function(data) { if (data=='yes') { username.addClass("error"); usernameInfo.text("sorry, that one's taken"); usernameInfo.addClass("error"); return false; } else if (!filter.test(b)) { username.addClass("error"); usernameInfo.text("no funny characters please"); usernameInfo.addClass("error"); return false; } else { username.removeClass("error"); usernameInfo.text("ok"); usernameInfo.removeClass("error"); return true; } }); }

    Read the article

  • Django: do I need to do HttpResponseRedirect to render a simple string after a POST?

    - by AP257
    I've got a mobile app that makes POST requests to a Django site. I want to return a simple string (not a template-based page) after the app makes the POST request, saying 'Success' or 'Failure' as appropriate. However I know that after a POST request in Django you're supposed to do a HttpResponseRedirect. But, do I really need to redirect to another page and write a new function to handle it, all to output a string? And if so, how do I pass the success/failure status of the app in the HttpResponseRedirect, since it's only supposed to take one argument? Thanks!

    Read the article

  • How painful is a django project deployment to a live (staging) site?

    - by Ignacio
    Hi, I've getting quite fast with a small django project of mine, which I'm developing locally, of course. But, as I had never worked with django before, I'm not aware of what it implies to upload it and test it on a production server. And I'm quite curious, since I'm very eager to test an early release live. I know there is this document, which I think it'll be really helpful: http://djangobook.com/en/2.0/chapter12/ But, are there any details I should take into account before, during and after the deployment? Any advice or best practices? Thanks.

    Read the article

  • Connect to a DB with an encrypted password with Django?

    - by Liam
    My place of employment requires that all passwords must be encrypted, including the ones used to connect to a database. What's the best way of handling this? I'm using the development version of Django with MySQL at the moment, but I will be eventually migrating to Oracle. Is this a job for Django, or the database? Edit: The encrypted password should be stored in the settings.py file, or somewhere else in the filesystem. This is the password that will be used to connect to the database.

    Read the article

  • How to start doing TDD in a django project?

    - by Satoru.Logic
    Hi, all. I have read a lot of essays talking about benifits TDD can bring to a project, but I have never practiced TDD in my own project before. Now I'm starting an experimental project with Django, and I think maybe I can have a try of TDD. But what I find now is that I don't even know how to answer the question "what should I put in my test cases?". Please tell me how should I plan TDD in a project, in this case, a web project based on Django. Thanks.

    Read the article

< Previous Page | 118 119 120 121 122 123 124 125 126 127 128 129  | Next Page >