Search Results

Search found 23428 results on 938 pages for 'django related manager'.

Page 18/938 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • Django: How do I position a page when using Django templates

    - by swisstony
    I have a web page where the user enters some data and then clicks a submit button. I process the data and then use the same Django template to display the original data, the submit button, and the results. When I am using the Django template to display results, I would like the page to be automatically scrolled down to the part of the page where the results begin. This allows the user to scroll back up the page if she wants to change her original data and click submit again. Hopefully, there's some simple way of doing this that I can't see at the moment.

    Read the article

  • Modify Django Forms

    - by Ninefingers
    Hi All, I've recently been developing on the django platform and have stumbled upon Django Forms (forms.Form/forms.ModelForm) as ways of creating <form> html. Now, this is brilliant for quick stuff but what I'm trying to do is a little bit more complicated. Consider a DateField - my current form has fields for day, month and year and constructs a python date object from that. However, a django form creates a single textbox in which the correct format (say 2010-06-15) must be entered. As another example, for large fields I need to replace <input> with <textarea>. I'd like to take advantage of Django's forms for simple validation but I need something simpler for my users. So my question is: can I intercept the rendering of one of these objects to write out the html as I like? If so, do I have to do all the writing myself or can I only do those objects I wish to re-write? Thanks in advance.

    Read the article

  • Django Form Preview

    - by Mark Kecko
    I'm trying to use django's FormPreview and I can't get it to work properly. Here's my code: forms.py class MyForm(forms.ModelForm): status = forms.TypedChoiceField( coerce=int, choices=LIST_STATUS, label="type", widget=forms.RadioSelect ) description = forms.CharField(widget = forms.Textarea) stage = forms.CharField() def __init__(self, useradd=None, *args, **kwargs): super(MyForm, self).__init__(*args, **kwargs) self.fields['firm'].label = "Firm" class Meta: model = MyModel fields = ['status', 'description', 'stage'] class MyFormPreview(FormPreview): form_template = 'templates/post.html' preview_template = 'templates/review.html' def process_preview(self, request, cleaned_data): print "processed" def done(self, request, cleaned_data): print "done" # Do something with the cleaned_data, then redirect # to a "success" page. return HttpResponseRedirect('/') urls.py (r'^post/$', MyFormPreview(MyForm)), post.html <form id = "post_ad" action = "" method = "POST" enctype="multipart/form-data"> <table> {{form.as_table}} </table> <input type="submit" name="save" value="Post" /> </form> When I go to /post/ I get the correct form and I fill it out. When I submit the form it goes right back to /post/ but but there are no errors (I've tried displaying {{errors}}) and the form is empty. None of my print statements execute. I'm not sure what I'm missing. Can anyone help me out? I can't find any documentation besides what's on the django site. Also, what's the "preview" variable called that I should use in my preview.html template? {{preview}} or do I just do {{form}} again? -- Answered below. I tried adding 'django.contrib.formtools' to my installed_apps in settings and I tried using the code from the default form templates from django.contrib as suggested below. Still, when I submit the form I go right back to the post template, none of my print statements execute :(

    Read the article

  • Error in {% markdown %} filter in Django Nonrel

    - by Robert Smith
    I'm having trouble using Markdown in Django Nonrel. I followed this instructions (added 'django.contrib.markup' to INSTALLED_APPS, include {% load markup %} in the template and use |markdown filter after installing python-markdown) but I get the following error: Error in {% markdown %} filter: The Python markdown library isn't installed. In this line: /path/to/project/django/contrib/markup/templatetags/markup.py in markdown they will be silently ignored. """ try: import markdown except ImportError: if settings.DEBUG: raise template.TemplateSyntaxError("Error in {% markdown %} filter: The Python markdown library isn't installed.") ... return force_unicode(value) else: # markdown.version was first added in 1.6b. The only version of markdown # to fully support extensions before 1.6b was the shortlived 1.6a. if hasattr(markdown, 'version'): extensions = [e for e in arg.split(",") if e] It seems obvious that import markdown is causing the problem but when I run: $ python manage.py shell >>> import elementtree >>> import markdown everthing works alright. Running Markdown 2.0.3, Django 1.3.1, Python 2.7. UPDATE: I thought maybe this was an issue related to permissions, so I changed my project via chmod 777 -R, but it didn't work. Ideas? Thanks!

    Read the article

  • Django Template tag, generating template block tag

    - by Issy
    Hi Guys, Currently a bit stuck, wondering if anyone can assist. I am using django-adminfiles. Which is a near little application. I want to use it to insert images into posts/articles/pages for a site i am building. How django-adminfiles works is it inserts a placeholder i.e <<< ImageFile and this gets rendered using a django template. It also has the feature of inserting custom options i.e (Insert Medium Image) , i figured i would used this to automatically resize images and include it in the post (similar to how WP does it). Django-adminfiles makes use of sorl.thumbnail app to generate thumbnails. So i have tried testing generating thumbnails: The current template that is used to render the inserted image is: {% spaceless %} <img src="{{ upload.upload.url }}" width="{{ upload.width }}" height="{{ upload.height }}" class="{{ options.class }}" class="{{ options.size }}" alt="{% if options.alt %}{{ options.alt }}{% else %}{{ upload.title }}{% endif %}" /> {% endspaceless %} I tried modifying this to: {% load thumbnail %} {% spaceless %} <img src="{% thumbnail upload.upload.url 200x50 %}" width="{{ upload.width }}" height="{{ upload.height }}" class="{{ options.class }}" class="{{ options.size }}" alt="{% if options.alt %}{{ options.alt }}{% else %}{{ upload.title }}{% endif %}" /> {% endspaceless %} I get the error: Exception Value: Caught an exception while rendering: Source file: '/media/uploads/DSC_0014.jpg' does not exist. I figured the thumbnail needs the absolute path so tried putting that in the template, and that works. i.e this works: {% thumbnail '/Users/me/media/uploads/DSC_0014.jpg' 200x50 %} So basically i need to generate the absolute path to the file give the relative path (to web root). You could do this by passing the MEDIA_ROOT setting to the template, but the reason i want to do a template tag is to programmatically set the image size.

    Read the article

  • Django-South introspection rule doesn't work.

    - by Ory Band
    I'm using Django 1.2.3 and South 0.7.3. I am trying to convert my app (named core) to use Django-South. I have a custom model/field that I'm using, named ImageWithThumbsField. It's basically just the ol' django.db.models.ImageField with some attributes such as height, weight, etc. While trying to ./manage.py convert_to_auth core I receieve South's freezing errors. I have no idea why, I'm Probably missing something... I am using a simple custom Model: from django.db.models import ImageField class ImageWithThumbsField(ImageField): def __init__(self, verbose_name=None, name=None, width_field=None, height_field=None, sizes=None, **kwargs): self.verbose_name=verbose_name self.name=name self.width_field=width_field self.height_field=height_field self.sizes = sizes super(ImageField, self).__init__(**kwargs) And this is my introspection rule, which I add to the top of my models.py: from south.modelsinspector import add_introspection_rules from lib.thumbs import ImageWithThumbsField add_introspection_rules( [ ( (ImageWithThumbsField, ), [], { "verbose_name": ["verbose_name", {"default": None}], "name": ["name", {"default": None}], "width_field": ["width_field", {"default": None}], "height_field": ["height_field", {"default": None}], "sizes": ["sizes", {"default": None}], }, ), ], ["^core/.fields/.ImageWithThumbsField",]) This is the errors I receieve: ! Cannot freeze field 'core.additionalmaterialphoto.photo' ! (this field has class lib.thumbs.ImageWithThumbsField) ! Cannot freeze field 'core.material.photo' ! (this field has class lib.thumbs.ImageWithThumbsField) ! Cannot freeze field 'core.material.formulaimage' ! (this field has class lib.thumbs.ImageWithThumbsField) ! South cannot introspect some fields; this is probably because they are custom ! fields. If they worked in 0.6 or below, this is because we have removed the ! models parser (it often broke things). ! To fix this, read http://south.aeracode.org/wiki/MyFieldsDontWork Does anybody know why? What am I doing wrong?

    Read the article

  • Complex derived attributes in Django models

    - by rabidpebble
    What I want to do is implement submission scoring for a site with users voting on the content, much like in e.g. reddit (see the 'hot' function in http://code.reddit.com/browser/sql/functions.sql). My submission model currently keeps track of up and down vote totals. Currently, when a user votes I create and save a related Vote object and then use F() expressions to update the Submission object's voting totals. The problem is that I want to update the score for the submission at the same time, but F() expressions are limited to only simple operations (it's missing support for log(), date_part(), sign() etc.) From my limited experience with Django I can see 4 options here: extend F() somehow (haven't looked at the code yet) to support the missing SQL functions; this is my preferred option and seems to fit within the Django framework the best define a scoring function (much like reddit's 'hot' function) in my database, and have Django use the value of that function for the value of the score field; as far as I can tell, #2 is not possible wrap my two step voting process in a suitably isolated transaction so that I can calculate the voting totals in Python and then update the Submission's voting totals without fear that another vote against the submission could be added/changed in the meantime; I'm hesitant to take this route because it seems overly complex - what is a "suitably isolated transaction" in this case anyway? use raw SQL; I would prefer to avoid this entirely -- what's the point of an ORM if I have to revert to SQL for such a common use case as this! (Note that this coming from somebody who loves sprocs, but is using Django for ease of development.) Before I embark on this mission to extend F() (which I'm not sure is even possible), am I about to reinvent the wheel? Is there a more standard way to do this? It seems like such a common use case and yet in an hour of searching I have yet to find a common solution...

    Read the article

  • Django throws 404 at generic views

    - by x0rg
    I'm trying to get the generic views for a date-based archive working in django. I defined the urls as described in a tutorial, but django returns a 404 error whenever I want to access an url with a variable (such as month or year) in it. It don't even produces a TemplateDoesNotExist-execption. Normal urls without variables work fine. Here's my urlconf: from django.conf.urls.defaults import * from zurichlive.zhl.models import Event info_dict = { 'queryset': Event.objects.all(), 'date_field': 'date', 'allow_future': 'True', } urlpatterns += patterns('django.views.generic.date_based', (r'events/(?P<year>d{4})/(?P<month>[a-z]{3})/(?P<day>w{1,2})/(?P<slug>[-w]+)/$', 'object_detail', dict(info_dict, slug_field='slug',template_name='archive/detail.html')), (r'^events/(?P<year>d{4})/(?P<month>[a-z]{3})/(?P<day>w{1,2})/(?P<slug>[-w]+)/$', 'object_detail', dict(info_dict, template_name='archive/list.html')), (r'^events/(?P<year>d{4})/(?P<month>[a-z]{3})/(?P<day>w{1,2})/$','archive_day',dict(info_dict,template_name='archive/list.html')), (r'^events/(?P<year>d{4})/(?P<month>[a-z]{3})/$','archive_month', dict(info_dict, template_name='archive/list.html')), (r'^events/(?P<year>)/$','archive_year', dict(info_dict, template_name='archive/list.html')), (r'^events/$','archive_index', dict(info_dict, template_name='archive/list.html')), ) When I access /events/2010/may/12/this-is-a-slug I should get to the detail.html template, but instead I get a 404. What am I doing wrong?

    Read the article

  • The Best Free Alternatives to the Windows Task Manager

    - by Lori Kaufman
    The Windows Task Manager is a built-in tool that allows you to check which services are running in the background, how much resources are being used by which software programs, and the all-to-common task of killing programs that are not responding. Even though the Windows Task Manager has several useful tools, there are many free alternatives available that provide additional or expanded features, allowing you to more closely monitor and tweak your system. How To Play DVDs on Windows 8 6 Start Menu Replacements for Windows 8 What Is the Purpose of the “Do Not Cover This Hole” Hole on Hard Drives?

    Read the article

  • Error caused by Dropbox in update manager

    - by Olivier Lalonde
    I am getting the following error message when the update manager runs: Apt Authentication issue Problem during package list update. The package list update failed with a authentication failure. This usually happens behind a network proxy server. Please try to click on the "Run this action now" button to correct the problem or update the list manually by running Update Manager and clicking on "Check". W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used.GPG error: http://linux.dropbox.com lucid Release: The following signatures were invalid: NODATA 1 NODATA 2 W: Failed to fetch http://linux.dropbox.com/ubuntu/dists/lucid/Release W: Some index files failed to download, they have been ignored, or old ones used instead. This error started to appear recently and for no obvious reason (maybe because I created myself a private PGP key?). I'm running Dropbox v0.7.11 on Ubuntu Lucid 10.04.

    Read the article

  • having problems with update manager

    - by Howie Lynch
    I'm trying to update my Ubuntu system, but cannot do anything with the Update Manager. It loads up 3/4 of the way and then says: Could not initialize the package information An unresolvable problem occurred while initializing the package information. Please report this bug against the 'update-manager' package and include the following error message: 'E:The package google-chrome-stable:i386 needs to be reinstalled, but I can't find an archive for it.' Also ubuntu software center will not open and keeps crashing. This is very annoying as I can't install or update anything.

    Read the article

  • How to cancel Update Manager downloading flashplugin-installer?

    - by kev
    Update Manger has frozen for about 60min when downloading flashplugin-installer. And the Cancel button of Applying Changes dialog is disabled. When I click the top-left x, it doesn't response. How to cancel downloading flashplugin-installer? ...SKIP... Setting up libxatracker1 (8.0.2-0ubuntu3.1) ... Setting up update-manager-core (1:0.156.14.5) ... Setting up update-manager (1:0.156.14.5) ... Setting up update-notifier-common (0.119ubuntu8.4) ... flashplugin-installer: downloading http://archive.canonical.com/pool/partner/a/adobe-flashplugin/adobe-flashplugin_11.2.202.236.orig.tar.gz

    Read the article

  • "configure: error: Intel WiMAX SDK is required " error when recompiling Network Manager

    - by Milad Nekofar
    I tried to to recompile network manager in this way but did not succeeded. Can you explain me how can I install wimax tools? Or tell me what is wrong with my installation? I installed wimax tools successfully from this source, but when I am trying to compile network manager I get this error: ... checking for QT... no checking for LIBNL1... no checking for LIBNL2... no checking for LIBNL3... yes checking for UUID... yes checking for IWMX_SDK... no configure: error: Intel WiMAX SDK is required

    Read the article

  • Muob Package Manager crashes

    - by Woltan
    Clicking on Check for Updates in the kubuntu Muon Package Manager gives the following error message: Unable to download the following packages: Failed to download http://de.archive.ubuntu.com oneiric-updates/universe Sources 416 Requested Range Not Satisfiable [IP: 141.30.13.10 80] Failed to download http://de.archive.ubuntu.com oneiric-updates/multiverse Sources 416 Requested Range Not Satisfiable [IP: 141.30.13.10 80] Failed to download http://de.archive.ubuntu.com oneiric-updates/main i386 Packages 416 Requested Range Not Satisfiable [IP: 141.30.13.10 80] After clicking OK or after just looking at the software sources the package manager crashed with the following error message: The package system could not be initialized, your configuration may be broken. What can I do to fix the problem?

    Read the article

  • Ubuntu software centre, update manager fail to open

    - by Pradeep
    On my Ubuntu 12.04 LTS system the Software Centre and Update Manager do not open. I am unable to install any updates. And the message given below pops up. I am looking for a step-by-step process to fix this, and as a newbie, I don't know how to use the command line. Could not initialize the package information An unresolvable problem occurred while initializing the package information. Please report this bug against the 'update-manager' package and include the following error message: 'E:Encountered a section with no Package: header, E:Problem with MergeList /var/lib/apt/lists/extras.ubuntu.com_ubuntu_dists_precise_main_binary-i386_Packages, E:The package lists or status file could not be parsed or opened

    Read the article

  • Content Manager Assistant PSVita Linux Does NOT Recognize USB Port

    - by Nicky Bailuc
    I have an external copy of Windows 7 alongside Quantal and I installed Content Manager Assistant on it. I was able to start the program successfully by finding the Executable file of the program in the program folder in Windows and run it in Wine, however Wine didn't recognize my PSVita that was connected through one of my USB ports. Is there any way to configure WINE to properly recognize the Vita? Content Manager Assistant is a Windows and Mac only program that allows you to transfer files between your PC and PSVita, kinda like iTunes for iPod.

    Read the article

  • How to route my internet from mobile broadband from a third party software to network manager

    - by user86865
    I use mobile broadband connection (Reliance Netconnect+ USB) for internet. I can connect to this network from Network Manager easily. There is a 3rd party software which is given by the service provider. I can also connect to the internet by using this software (Software from ZTE). But when i am using this software, i cannot upload files to Ubuntu One, Cannot install packages from Software Center, etc except i can load web pages from FireFox. But when using the connection from NM, i can do all the stuffs. But, there are so many options available in this 3rd party software. So, can i route my internet connection from this software to my Network Manager? There are some options available in the settings as;- Dns, alternate dns, static IP, CHAP, PAP. Can anyone help me?? I use 12.04.

    Read the article

  • Network Manager troubleshooting

    - by Anero
    I'm having some issues when connecting to my house's wifi from my Ubuntu 10.10 laptop. If the connection doesn't exists, when selecting the network (and after entering the WPA2 password) I'm able to connect. Once the connection is saved, when trying to reconnect, Network Manager works for a minute or so and then fails; the only way to reconnect then is to delete the saved connection and re-select the network from the list of available wireless networks. The same network works with no issues on the same laptop when running Win7, and on other wireless networks when running Ubuntu. Is there a Network Manager log which I can take a look at for troubleshooting the issue? Are there any tools for checking the wifi status?

    Read the article

  • Update-manager does not show all updates

    - by Aibara Iduas
    Ever since I upgraded to 13.10, the software updater does not show all the available updates. Some will appear and can be installed just fine, but once it claims that all software is up to date, using sudo apt-get upgrade shows that there are still more packages waiting to be updated. I can update them via the command line, but that only solves things temporarily. I'm not sure why some show up and others don't. How can I make Update Manager update all packages? Update-manager shows this: But apt-get shows this: Thanks!

    Read the article

  • How to install again Update Manager after uninstalling it

    - by biezdar
    Ok, the thing is this I tried asking many times on few ubuntu forums how to deal with my non-responsive Update Manager, but all I was getting was the same stuff (run it from the terminal, run some lines, apt-get update blah blah). Nothing was helping. Eventually I went mad Windows style and tried to simply uninstall it and install it again. The problem is - how to install it again? Can't do it through Software Center, can't really build a package (because I'm too stupid to do that). And I seriously want to avoid reinstalling the whole system. I am running a 12.04 verison (Update Manager was unable to update to a newer one) Please help. I am furious with this thing.

    Read the article

  • virt-manager not installing

    - by Registered User
    I am trying to install virt-manager on 11.10 on 64 bit machine sudo aptitude install virt-manager here is where it stopped the install Processing triggers for python-support ... Errors were encountered while processing: libvirt-bin E: Sub-process /usr/bin/dpkg returned an error code (1) A package failed to install. Trying to recover: Setting up libvirt-bin (0.9.2-4ubuntu15) ... useradd: cannot lock /etc/passwd; try again later. adduser: `/usr/sbin/useradd -d /var/lib/libvirt -g kvm -s /bin/false -u 118 libvirt-qemu' returned error code 1. Exiting. dpkg: error processing libvirt-bin (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: libvirt-bin What should be done in this case to resolve it?

    Read the article

  • Returning form errors for AJAX request in Django

    - by mridang
    Hi Guys, I've been finding my way around Django and jQuery. I've built a basic form in Django. On clicking submit, I'm using jQuey to make an AJAX request to the sever to post my data. This bit seems to work fine and I've managed to save the data. Django returns a ValidatioError when a form is invalid. Could anyone tell me how to return this set of error messages as a response to my AJAX request so i can easily iterate through it using JS and do whatever? I found this snippet. Looking at the JS bit (processJson) you'll see that he seems to get the error messages by extracting them from the response HTML. It seems kinda kludgy to me. Is this a best way to go about it? My apologies for any vagueness. Thanks in advance.

    Read the article

  • django urlconf or .htaccess trouble

    - by Zayatzz
    Hello I am running my django project from subfolder of a website. Lets say the address where my project is meant to open from is. http://example.com/myproject/ the myproject folder is root folder for my user account. In that folder i have fcgi script that starts my project. The .htaccess file in the folder contains this: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ mysite.fcgi/$1 [QSA,L] The trouble is, that at some cases, instead of redireting user to page like http://example.com/myproject/social/someurl/ it redirects to http://example.com/social/someurl/ which does not work. What i want to know is how to fix this problem. Is this django problem and i should change it with urconf and add myproject to all urls, or should i do this with .htaccess? I found similar question, which, sadly, remains unanswered: http://stackoverflow.com/questions/2321154/how-to-write-htaccess-if-django-project-is-in-subfolder-and-subdomain Alan.

    Read the article

  • Django ORM and multiprocessing

    - by Ankur Gupta
    Hi, I am using Django ORM in my python script in a decoupled fashion i.e. it's not running in context of a normal Django Project. I am also using the multi processing module. And different process in turn are making queries. The process ran successfully for an hr and exited with this message "IOError: [Errno 32] Broken pipe" Upon futhur diagnosis and debugging this error pops up when I call save() on the model instance. I am wondering Is Django ORM Process save ? Why would this error arise else ? Cheers Ankur

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >