Search Results

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

Page 23/309 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • django filebrowser extensions problem

    - by Borislav
    Hi, I've set django filebrowser's debug to True and wrote the extension restrictions in the model. pdf = FileBrowseField("PDF", max_length=200, directory="documents/", extensions=['.pdf', '.doc', '.txt'], format='Document', blank=True, null=True) In django admin it shows correctly with debug info. Directory documents/ Extensions ['.pdf', '.doc', '.txt'] Format Document But when I call the filebrowser, it allows all file extensions to be uploaded. How can I restrict filebrowser to upload only certain filetypes that I want? Thanks everyone

    Read the article

  • django admin site make CharField a PasswordInput

    - by Paul
    I have a Django site in which the site admin inputs their Twitter Username/Password in order to use the Twitter API. The Model is set up like this: class TwitterUser(models.Model): screen_name = models.CharField(max_length=100) password = models.CharField(max_length=255) def __unicode__(self): return self.screen_name I need the Admin site to display the password field as a password input, but can't seem to figure out how to do it. I have tried using a ModelAdmin class, a ModelAdmin with a ModelForm, but can't seem to figure out how to make django display that form as a password input...

    Read the article

  • How to locally test Django's Sites Framework

    - by Off Rhoden
    Django has the sites framework to support multiple web site hosting from a single Django installation. EDIT (below is an incorrect assumption of the system) I understand that middleware sets the settings.SITE_ID value based on a lookup/cache of the request domain. ENDEDIT But when testing locally, I'm at http://127.0.0.1:8000/, not http://my-actual-domain.com/ How do I locally view my different sites during development?

    Read the article

  • Using ckEditor on selective text areas in django admin forms

    - by Rahul
    Hi, I want to apply ckeditor on specific textarea in django admin form not on all the text areas. Like snippet below will apply ckeditor on every textarea present on django form: class ProjectAdmin(admin.ModelAdmin): formfield_overrides = {models.TextField: {'widget': forms.Textarea(attrs={'class':'ckeditor'})}, } class Media: js = ('ckeditor/ckeditor.js',) but i want it on a specific textarea not on every textarea.

    Read the article

  • django internationalisation

    - by ha22109
    Hello , I am doing django admin internationalization .I am able to do it perfectly.But my concern is that in the address bar it is showing the app label in tranlated form which is not in us acii .Is this the problem with django or i m doing something wrong.

    Read the article

  • Django 1.2 and south problem

    - by alexarsh
    Hi, I was using python 2.5 and django 1.0.2. But I moved to python 2.6 and django 1.2 recently and I'm getting the following error now during the migrate: http://slexy.org/view/s2HCFJj0yL After running migrate several times, it eventually passes. I have 5 different apps under migration and I thought it can be dependencies issue. But I have no migrations calling other apps. So what can be the problem? Regards, Arshavski Alexander.

    Read the article

  • displaying list of registered user in django-admin

    - by theactiveactor
    My Book model has an author attribute which today is simply a CharField. The value for author should be one of the registered users of my Django site. When creating a new Book object in Django admin, I would like author to be displayed as a combo box showing all registered users. How would I go about achieving this?

    Read the article

  • BI with Django?

    - by Helmut
    Is there a way to develop Bi (Business Intelligence) solutions with Django? Therefore it should be possible to define models with more than one Datasource. Is anybody out there who has experienced BI with Django? How could it work ?

    Read the article

  • Is django orm & templates thread safe?

    - by Piotr Czapla
    I'm using django orm and templates to create a background service that is ran as management command. Do you know if django is thread safe? I'd like to use threads to speed up processing. The processing is blocked by I/O not CPU so I don't care about performance hit caused by GIL.

    Read the article

  • Serve external template in Django

    - by AlexeyMK
    Hey, I want to do something like return render_to_response("http://docs.google.com/View?id=bla", args) and serve an external page with django arguments. Django doesn't like this (it looks for templates in very particular places). What's the easiest way make this work? Right now I'm thinking to use urllib to save the page to somewhere locally on my server and then serve with the templates pointing to there. Note: I'm not looking for anything particularly scalable here, I realize my proposal above is a little dirty.

    Read the article

  • How do I uninstall Django Evolution?

    - by Rhubarb
    I installed it in my dev project. I would like to remove it and any trace of it in my database and my django app, not to mention my python install. I found it didn't quite do what I needed, but that's another topic, and I'm moving to South. Can I just delete the evolution tables in my django db, and remove it from the app settings? Or is there more to it?

    Read the article

  • Need "starting point" hints about adding "tabbed" interface to Django admin

    - by Edwin
    Hi, I'm new to the web development world - that means I'm new to javaScript/CSS. Now I'm building a web system with Python Django. I'm wondering would you like to give me some hints as the starting point for adding "tabbed" interface to Django admin? For example, there are 3 detail table for a master table, and I want to use 3 different tabs for editing that 3 detail tables in the 'edit' page for the master table. Thank you in advance!

    Read the article

  • Dynamically Delete inline formsets in Django

    - by BenMills
    Is it possible to have Django automatically delete formsets that are not present in the request? So for example if I had three inline formsets represented in HTML when I loaded my edit page and I use javascript to remove two of those when the request is processes Django sees that those two forms are no longer their and deletes them.

    Read the article

  • Django template can't see CSS files

    - by Technical Bard
    I'm building a django app and I can't get the templates to see the CSS files... My settings.py file looks like: MEDIA_ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'media') MEDIA_URL = '/media/' I've got the CSS files in /mysite/media/css/ and the template code contains: <link rel="stylesheet" type="text/css" href="/media/css/site_base.css" />` then, in the url.py file I have: # DEVELOPMENT ONLY (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/media'}), but the development server serves the plain html (without styles). What am I doing wrong?

    Read the article

  • Storing dynamic fields in Django forms

    - by hekevintran
    Django's form library has a feature of form sets that allow you to process dynamically added forms. For example you would use form sets if your application has a list of bookmarks you could use form sets to process multiple forms that each represent a bookmark. What about if you want to dynamically add a field to a form? An example would be a survey creation page where you can dynamically add an unlimited number of questions. How do you handle this in Django?

    Read the article

  • Good example usage of get_or _create in Django views and raising a Form error

    - by Rik Wade
    I would like to use get_or_create to check whether an object already exists in my database. If it does not, then it will be created. If it does exist, then I will not create the new object, but need to raise a form error to inform the user that they need to enter different data (for example, a different username). The view contains: p, created = Person.objects.get_or_create( email = registration_form.cleaned_data['email'], defaults = { 'creationDate': datetime.datetime.now(), 'dateOfBirth': datetime.date(1970,1,1) }) So 'p' will contain the existing Person if it exists, or the new Person if not. I would like to act on the boolean value in 'created' in order to skip over saving the Person and re-display the registration_form and raise an appropriate form validation error. The alternative I'm considering is doing a check in a custom Form validation method to see whether a Person exists with the data in the provided 'email' field, and just raising a validation error.

    Read the article

  • Cookieless Django - Django with no cookies

    - by phoebebright
    As I'm writing a django site from government bodies I'm not going to be able to use cookies. I found this snippet http://djangosnippets.org/snippets/1540/ but it's currently not allowing users to login. Before I start debugging I wondered if anyone else has solved this problem with this snippet or in any other way?

    Read the article

  • Django OpenID django-openid-auth Login Error.

    - by gramware
    I get the following error when attempting to use django-openid-auth OpenID discovery error: No usable OpenID services found for *******@gmail.com I have followed the instructions that come with it, though it seems there is something I am missing. the installation is on my localhost.

    Read the article

  • No Module named django.core

    - by Sirish Kumar
    Hi, I have updated to latest Django version 1.0.2 after uninstalling my old Django version.But now when I run django-admin.py I get the following error. How can I resolve this? Traceback (most recent call last): File "C:\Python25\Lib\site-packages\django\bin\django-admin.py", line 2, in <module> from django.core import management ImportError: No module named django.core

    Read the article

  • No Module named django.core

    - by Sirish Kumar
    Hi, I have updated to latest Django version 1.0.2 after uninstalling my old Django version.But now when I run django-admin.py I get the following error. How can I resolve this? Traceback (most recent call last): File "C:\Python25\Lib\site-packages\django\bin\django-admin.py", line 2, in <module> from django.core import management ImportError: No module named django.core

    Read the article

  • Validation on ManyToManyField before Save in Models.py

    - by Heyl1
    I have the following models: class Application(models.Model): users = models.ManyToManyField(User, through='Permission') folder = models.ForeignKey(Folder) class Folder(models.Model): company = models.ManyToManyField(Compnay) class UserProfile(models.Model): user = models.OneToOneField(User, related_name='profile') company = models.ManyToManyField(Company) What I would like to do is to check whether one of the users of the Application has the same company as the Application (via Folder). If this is the case the Application instance should not be saved. The problem is that the ManyToManyFields aren't updated until after the 'post-save' signal. The only option seems to be the new m2m_changed signal. But I'm not sure how I then roll back the save that has already happened. Another option would be to rewrite the save function (in models.py, because I'm talking about the admin here), but I'm not sure how I could access the manytomanyfield content. Finally I've read something about rewriting the save function in the admin of the model in admin.py, however I still wouldn't know how you would access the manytomanyfield content. I have been searching for this everywhere but nothing I come across seems to work for me. If anything is unclear, please tell me. Thanks for your help! Heleen

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >