Search Results

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

Page 73/309 | < Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >

  • Plural blocktrans problem with Django

    - by jorde
    I'm trying to translate a small block of text using Django's build in i18n. I don't know why but the following won't show up in different language: {% if store.rating_count %} {% blocktrans with store.rating_count as count %} {{ count }} review {% plural %} {{ count }} reviews {% endblocktrans %} {% else %} {% trans "No reviews" %} {% endif %} And a snipplet from my django.po (created with makemessages): #: templates/reviews/category.html:65 #, python-format msgid "%(count)s review" msgid_plural "%(count)s reviews" msgstr[0] "%(count)s arvostelu" msgstr[1] "%(count)s arvostelua" Other strings translate fine from the same template. I have rerun compilemessages few times.

    Read the article

  • What setup in .Net would most resemble Django

    - by Mingus Rude
    At work we are inte process of starting development on a new web-based product. Before doing so we need to establish what technology stack we are going to use. For this application my preference would have been to use Django but since the development- and management-team is soo heavily rooted with Microsoft the new product will have to be based on Microsoft technologies. So my question is, what setup, with Microsoft technologies, would most resemble a django setup with its MVT-design?

    Read the article

  • django multi-language (i18n) and seo

    - by fumer
    hi, I am developing a multi-language site in django. In order to improve SEO, i will give every language version a unique URL like below, english: www.foo.com/en/index.html french: www.foo.com/fr/index.html chinese: www.foo.com/zh/index.html However, Django looks for a "django_language" key in user's session or cookie to determine language in default, so,Despite which language user chose, URL is always the same. for instance: http://www.foo.com/index.html how to resolve this problem ? thank you!

    Read the article

  • django-admin.py startproject mysite not working well on windows 7

    - by john
    Hi I'm learning django and I did successfully start a site on Window XP by following the tutorial. However, on Window 7 when I issued: django-admin.py startproject mysite python.exe was started and a window appeared to ask me to choose either python.exe or other program to open a file.... did I do anthing wrong or there are more tricks for window 7? thanks.

    Read the article

  • Can Django be used for web services?

    - by alex
    My friend said, "Pylons is so much better for web services." My other friend said, "You can modify Django in a way to do exactly whatever you like." In Django, what is necessary to be modified (urls.py? models classes? settings?) in order to do "web services" with APIs and REST and versioning, etc etc.?

    Read the article

  • Django's local web server works, but not apaches

    - by tipu
    I've made no changes to the django project after running django-admin.py startproject Twingle When I run the local web server using python manage.py runserver, I can view the splash page telling me everything is working fine. But when I try to visit that project through apache, it fails. You can see the error at http://djaffry.selfip.com:8080/ The exception: Exception Value: No module named Twingle.urls (the project is Twingle)

    Read the article

  • How do I include the Django settings file?

    - by alex
    I have a .py file in a directory , which is inside the Django project folder. I have email settings in my settings.py, but this .py file does not import that file. How can I specify to Django that settings.py should be used , so that I can use EmailMessage class with the settings that are in my settings.py?

    Read the article

  • Django @ Google App Engine - Site Map Framework

    - by dkp
    Hi Folks, has anybody managed to get Djangos site map framework to run on Google App Engine? I receive the following exception: ImproperlyConfigured at /sitemap.xml You haven't set the DATABASE_ENGINE setting yet. Request Method: GET Request URL: http://127.0.0.1:8080/sitemap.xml Exception Type: ImproperlyConfigured Exception Value: You haven't set the DATABASE_ENGINE setting yet. Exception Location: D:\Program Files\Google\google_appengine\lib\django\django\db\backends\dummy\base.py in complain, line 13

    Read the article

  • Dynamically customize django admin columns ?

    - by tomjerry
    Is it possible to let the users choose / change dynamically the columns displayed in a object list in Django administration ? Things can surely be implemented "from scratch" by modifying the 'change_list.html' template but I was wondering if somebody has already had the same problem and/or if any django-pluggin can do that. Thanks in advance,

    Read the article

  • Alternative Django Authenication

    - by pq
    Need to integrate Django with an existing authentication system. That system has it's own database, API, login/logout,edit profile web pages and cookie. (I may have to add a few additional profile fields stored/updated locally) What's the proper approach to substitute the out-of-the-box authentication in Django?

    Read the article

  • Python/Django: log to console under runserver, log to file under Apache

    - by Justin Grant
    How can I send trace messages to the console (like print) when I'm running my Django app under manage.py runserver, but have those messages sent to a log file when I'm running the app under Apache? I reviewed Django logging and although I was impressed with its flexibility and configurability for advanced uses, I'm still stumped with how to handle my simple use-case. My apologies for not being able to find the answer elsewhere-- this is a newbie question I know.

    Read the article

  • GAE and Django: What are the benefits?

    - by RHicke
    Currently I have a website on the Google App Engine written in Google's webapp framework. What I want to know is what are the benefits of converting my app to run with django? And what are the downsides? Also how did you guys code your GAE apps? Did you use webapp or django? Or did you go an entirely different route and use the Java api? Thanks

    Read the article

  • django convert list of objects to list of primary keys

    - by John
    Hi, As the title says I have a list of Django objects and I want to get a list of primary keys. What is the best way of doing this? I know I could do my_list = [] for item in object_list: my_list.append(item.pk) but was wondering if there is Django or Python specific way of doing this better. Thanks

    Read the article

  • ModelState.AddModelError encodes HTML

    - by NTulip
    Hi I am noticing a weird issue when using ModelState.AddModelError to validate input on my forms. The output from Html.ValidationMessage is not the true HTML value but it's encoded value and so the CSS style is not applied to the error message. Example: private string errorMessage = "<span class=\"negative\">{0}</span><br class=\"hid\" />"; ModelState.AddModelError("title", String.Format(errorMessage, "Tab title is required")); The output is shown as: <span class="field-validation-error">&lt;span class=&quot;negative&quot;&gt;URL is Required&lt;/span&gt;&lt;br class=&quot;hid&quot; /&gt;</span> This didn't use to be the case with their earlier beta's and I am not sure what approach to take here. Thanks Nick

    Read the article

  • Can I prevent RequiredFieldValidation from triggering against postbacks from a specific control.

    - by marcusstarnes
    I have a web form with a number of textbox controls which I've associated RequiredFieldValidator's with. I have a ValidationSummary control on the page to render any incomplete fields when I submit the page. However, I've just had to add an image upload facility to the same page, and have an 'Upload' button which I have posting back to perform the upload. I don't want this upload button to trigger the RequiredFieldValidators for the rest of the page though - I want this upload postback to be ignored as far as the validation goes. What's the best way to stop the RequiredFieldValidator's from firing when I submit this upload button on the page because at the moment, the upload won't occur unless I have first field out all of the other textbox controls on the page.

    Read the article

  • Handling form from different view and passing form validation through session in django

    - by Mo J. Mughrabi
    I have a requirement here to build a comment-like app in my django project, the app has a view to receive a submitted form process it and return the errors to where ever it came from. I finally managed to get it to work, but I have doubt for the way am using it might be wrong since am passing the entire validated form in the session. below is the code comment/templatetags/comment.py @register.inclusion_tag('comment/form.html', takes_context=True) def comment_form(context, model, object_id, next): """ comment_form() is responsible for rendering the comment form """ # clear sessions from variable incase it was found content_type = ContentType.objects.get_for_model(model) try: request = context['request'] if request.session.get('comment_form', False): form = CommentForm(request.session['comment_form']) form.fields['content_type'].initial = 15 form.fields['object_id'].initial = 2 form.fields['next'].initial = next else: form = CommentForm(initial={ 'content_type' : content_type.id, 'object_id' : object_id, 'next' : next }) except Exception as e: logging.error(str(e)) form = None return { 'form' : form } comment/view.py def save_comment(request): """ save_comment: """ if request.method == 'POST': # clear sessions from variable incase it was found if request.session.get('comment_form', False): del request.session['comment_form'] form = CommentForm(request.POST) if form.is_valid(): obj = form.save(commit=False) if request.user.is_authenticated(): obj.created_by = request.user obj.save() messages.info(request, _('Your comment has been posted.')) return redirect(form.data.get('next')) else: request.session['comment_form'] = request.POST return redirect(form.data.get('next')) else: raise Http404 the usage is by loading the template tag and firing {% comment_form article article.id article.get_absolute_url %} my doubt is if am doing the correct approach or not by passing the validated form to the session. Would that be a problem? security risk? performance issues? Please advise Update In response to Pol question. The reason why I went with this approach is because comment form is handled in a separate app. In my scenario, I render objects such as article and all I do is invoke the templatetag to render the form. What would be an alternative approach for my case? You also shared with me the django comment app, which am aware of but the client am working with requires a lot of complex work to be done in the comment app thats why am working on a new one.

    Read the article

  • Date picker validation WPF

    - by developer
    How to apply validations to WPF datepicker toolkit? I want it to error out if invalid date is selected and in some case I have Arrival and Departure dates, so I want to validate it to see that the arrival date is not later than the departure date.

    Read the article

  • How to fix "Byte-Order Mark found in UTF-8 File" validation warning

    - by rsturim
    I've got an xhtml page validating under xhtml strict doctype -- but, I getting this warning which I trying to understand -- and correct. Just, how do I locate this errant "Byte-Order Mark". I'm editing my file using Visual Studio--not sure if that helps. Warning Byte-Order Mark found in UTF-8 File. The Unicode Byte-Order Mark (BOM) in UTF-8 encoded files is known to cause problems for some text editors and older browsers. You may want to consider avoiding its use until it is better supported.

    Read the article

  • Country/City/state validation

    - by M.M.H.Masud
    I want to do the following things using PHP and jQuery https://www.careerbuilder.com/share/register.aspx?sc_cmp1=JS_LoginASPX_RegNow Steps Select a country from a dropdown list. The city dropdown list will fillup automatically with the list of cities of the selected country. If state is available for that country then state list will be visible with all state list of that country. Then I need to validate the selected city, state and country. Do you have any ideas? Thanks in advance

    Read the article

< Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >