Search Results

Search found 15813 results on 633 pages for 'django settings'.

Page 95/633 | < Previous Page | 91 92 93 94 95 96 97 98 99 100 101 102  | Next Page >

  • Django get() query not working

    - by pimcoooooooo
    this_category = Category.objects.get(name=cat_name) gives error: get() takes exactly 2 non-keyword arguments (1 given) I am using the appengine helper, so maybe that is causing problems. Category is my model. Category.objects.all() works fine. Filter is also similarily not working. Thanks,

    Read the article

  • Deleting files associated with model - django

    - by alexBrand
    I have the following code in one of my models class PostImage(models.Model): post = models.ForeignKey(Post, related_name="images") # @@@@ figure out a way to have image folders per user... image = models.ImageField(upload_to='images') image_infowindow = models.ImageField(upload_to='images') image_thumb = models.ImageField(upload_to='images') image_web = models.ImageField(upload_to='images') description = models.CharField(max_length=100) order = models.IntegerField(null=True) IMAGE_SIZES = { 'image_infowindow':(70,70), 'image_thumb':(100,100), 'image_web':(640,480), } def delete(self, *args, **kwargs): # delete files.. self.image.delete(save=False) self.image_thumb.delete(save=False) self.image_web.delete(save=False) self.image_infowindow.delete(save=False) super(PostImage, self).delete(*args, **kwargs) I am trying to delete the files when the delete() method is called on PostImage. However, the files are not being removed. As you can see, I am overriding the delete() method, and deleting each ImageField. For some reason however, the files are not being removed.

    Read the article

  • How to preserve sysprep from changing Default User settings

    - by user33794
    I'm having diffculties configuring 20 new Dell Vostro minis here. I set up one of them with my preferred OS, applications and settings, especially the Visual Effects Settings of Windows XP. I set them to best performance and deactivated everything else in the box. I copied this profile to Default User Profile and did sysprep -mini -reseal. After capturing this image and deploying it again, the desktop settings are correct except the visual effects settings. fading and everything else is reenabled for each new user which is created on the system. How do I preserve my settings from being overwritten by sysprep? thanks!

    Read the article

  • How to setup a django site with Cherokee, DynDNS and virtual_env?

    - by e-satis
    I have a django project running with the dev server, and would like to try run it in a production environment. I wanted to try Cherokee for a change, so I installed it. We don't have a domain name yet, so I set up a DynDNS looking like stuff.gotdns.org. It works fine, I can see the Cherokee welcome page (so red, I first believed I got an error :-p). I ran the wizard to create a new virtual server for Django. No everything is setup, but I have nothing. Still the default Cherokee welcome page. What should I do now if I want to go to "http://stuff.gotdns.org" and see my website? What should I do now if I next want to make it available only at "http://project.stuff.gotdns.org"? Important fact, I use virtual_env, so your can call Python directly, you have to activate it first.

    Read the article

  • Django, wsgi, py. what's the difference?

    - by Kenny
    I'm trying to get a django application up and running on my cpanel system. I've installed mod_wsgi, and am following the guide here: http://www.nerdydork.com/setting-up-django-on-a-whm-cpanel-vps-liquidweb.html However, I'm now confused as I don't know what to do next. The application has .py files, and I am able to run it via this: python manage.py runserver 211.144.131.148:8000 However, that's via command line and binds to port 8000. I want to use Apache instead. The question is, that tutorial doesn't go further into how to get apache to recognize .py files and run the application as I want it. What do I do next?

    Read the article

  • Restore access to Cisco Connect after changing router settings

    - by StasM
    I have recently bought Cisco Valet Plus (M20) wireless router (which I recognize now was a mistake, but nevermind). It has two setup options - Cisco Connect software and web-based setup. Cisco Connect software allows changing very small set of settings, web-based setup allows access to almost all settings, except settings for guest network. The problem is that when I use web-based setup, Cisco Connect after some changes refuses to talk to the router, so I can't change guest settings anymore (since web interface doesn't allow to change them). It must be because of some config parameter not matching or some password set wrong - but I don't know where Cisco Connect stores them. So, does anybody have any idea how to make Cisco Connect talk to the router again once I changed the settings through the web interface?

    Read the article

  • How can I stop Windows DNS server properties settings from changing by themselves?

    - by paradroid
    When I open the DNS console in Administrative tools, I keep finding a couple of problems which keep on reappearing by themselves, and I want to stop them from happening. One of the DNS servers has two network interfaces, and it should only be listening for requests on of them, and I get errors in the Event Log otherwise. But when right clicking one DNS server and selecting Properties, I can see on the Interfaces tab that 'All IP addresses' is selected. If I Change it to 'Only the following IP addresses:' and deleselect the WAN addess, I will find it reslected when I next check it after a couple of days. In the other DNS server's Properties, on the Forwarders tab, there should only be two forwarder addresses. However, the address for the router keeps in appearing. This router has the DNS server as its forwarder. There shouldn't be anything using the router's DNS forwarders for DNS other than the router itself, but this surely is causing a loop. How do I get these properties on both DNS servers to stick?

    Read the article

  • Mac webcam photo application with access to camera settings (resolution, camera selection, color balance, focus)

    - by Pascal T.
    Does anyone know about a webcam photo application (ie an alternative to photo booth) with would allow to change the settings on the camera, such as : Select camera (I.e I want to use an external webcam) Change camera resolution (with photobooth change camera settings (I.e autofocus, aperture, color balance, etc..) I did a lot of research on the internet with no success. I am looking for a very simple app (such as wmcap.exe on Windows) What I tried so far: photo booth: it works with an external camera, however there is no way to change the resolution, or the color/focus settings manycam : a virtual webcam driver. you can add special effects to your camera and transfer those effects to any app, but not change your camera settings... iGlasses : enables you to change the camera settings inside photo booth and other apps. However you cannot control the focus, nor the video resolution macam (did not work on my Mac book Pro) Does anyone know better than me? Note : my only solution now is to launch a virtual machine (with parallels desktop) and take the pictures from there!

    Read the article

  • Dual monitors won't accept new settings

    - by mschulze
    I'm trying to use dual monitors but every time I try to change the display settings(external monitor is on the right of the laptop, not the left etc...) my screens go black, then my laptop screen will come back "normally" but my external monitor will just flash different shades of red or black. I cannot interact with anything on my laptop screen even though I can move my mouse around. Even when the monitors attempt to revert back the external monitor continues to flicker instead of reverting. The only way to stop it is to hard-boot but the new settings aren't saved. Also, when the dual monitors are both working my laptop screen has two vertical black bars along its sides. It's like Natty just decided I couldn't use the outer inch and a half of my laptop screen. My external monitor doesn't have this problem, and my laptop uses its full screen size when the external monitor is not hooked up. Does anyone know what I'm doing wrong? I have an HP Pavillion dv7 and an HP w2338h external monitor. Thanks!

    Read the article

  • nVidia Settings: Overriding anti-aliasing causes delay

    - by Kalle Elmér
    I'm using Google Sketchup on ubuntu 12.04 with Wine 1.4. It works flawlessly out of the box, but anti-aliasing is causing some problems. I can override anti-aliasing settings using the nVidia X Server Settings utility, which results in a great-looking image. However, the view doesn't seem to update properly. It's a bit hard to explain, but if I do something (e.g. zooming) the changes won't appear in the view until I take another action. in other words, there seems to be a delay of one "action". Take this example. The mouse wheel is moved one notch to zoom in one step. Nothing happens. An object is selected by clicking. The new zoom is rendered but the selection box doesn't appear. An empty area is clicked. The selection box appears. Is there something that I can do to solve the problem? Could I force the GPU to redraw that view with a certain interval, or is there some other solution? I really like anti-aliasing, but it's hard to use when drawing stuff.

    Read the article

  • Can't change settings for Mobile Broadband Dongle - Button is greyed out

    - by Ross LIndsey
    I was with VirginBroadband.com.au (Australia). My huawai 3G Dongle was working great on Ubuntu, However I have changed ISP's. I unlocked the modem, and put in the new SIM. I have tested this in my Windows PC and it connects to the new (Optus) Network A-OK and it all works. When I put this dongle (the same one that was working fine in Ubuntu) into that same Ubuntu Netbook it simply won't connect. When I try to go into the dialog to try and add or change settings the button to change or update settings is greyed out, I can't select it. Apparently since this dongle was already recognized the Broadband Setup Wizard won't start, and I have no idea how to get it to start (presuming it has the ability to configure an already recognized dongle). What do I have to do to either enable the ability to change the configuration for this setup, or to blow away the one that is set up so the Broadband Wizard will re-start and let me configure a new one. Can anyone provide simple instructions for doing this? I'm using Ubuntu with the Cinnamon Desktop

    Read the article

  • Unwanted Chinese language got set in system settings

    - by Registered User
    I was discussing on the Ubuntu users list how to type in in Hindi (Indic language) in Libre Office and about a package installation problem. I have made some changes in system settings, following suggestions by some users. However, this morning when I did a reboot I am unable to see English as my default language. My system is showing some Chinese characters which I do not understand. All I wanted was to use Libre Office for a particular document in Hindi. What happened is that even Gmail is opening in Chinese. The system settings folder and others are also opening in Chinese. I am unable to use the system now. I have uploaded the snapshots here: please have a look. Upon a reboot, I was asked to rename all folders. Gmail opening in Chinese This is how menu on my system looks: half English and half Chinese Notice that in the third snapshot the calendar and menu are appearing in Chinese. I want the original US English menus and folder names back. I just wanted to type a document with Lohit Hindi font in Libre Office. I use Ubuntu 11.10. I do not use Unity, only Gnome desktop. I installed gnome-session-fallback a long time back and have been using that ever since. How do I get back to all English submenus and English folder names? I have a US English Keyboard and I use only US English. This thing which is now somehow set is unwanted.

    Read the article

  • Google App Engine (python): TemplateSyntaxError: 'for' statements with five words should end in 'rev

    - by Phil
    This is using the web app framework, not Django. The following template code is giving me an TemplateSyntaxError: 'for' statements with five words should end in 'reversed' error when I try to render a dictionary. I don't understand what's causing this error. Could somebody shed some light on it for me? {% for code, name in charts.items %} <option value="{{code}}">{{name}}</option> {% endfor %} I'm rendering it using the following: class GenerateChart(basewebview): def get(self): values = {"datepicker":True} values["charts"] = {"p3": "3D Pie Chart", "p": "Segmented Pied Chart"} self.render_page("generatechart.html", values) class basewebview(webapp.RequestHandler): ''' Base class for all webapp.RequestHandler type classes ''' def render_page(self, filename, template_values=dict()): filename = "%s/%s" % (_template_dir, filename) path = os.path.join(os.path.dirname(__file__), filename) self.response.out.write(template.render(path, template_values))

    Read the article

  • Hooking up Sproutcore frontend and custom Python backend

    - by Suvir
    Hello everyone, I am building a web-based application. The frontend has been designed in Sproutcore. For the backend, we have our own python API which handles all transactions with multiple databases. What is the best way to hook up the front-end with the back-end. AFAIK django is pretty monolithic (correct me if i am wrong) and it would be cumbersome if I dont use its native ORM...I would prefer a python-based solution..any ideas? thanks! Suvir

    Read the article

  • Why don't these class attributes register?

    - by slypete
    I have a factory method that generates django form classes like so: def get_indicator_form(indicator, patient): class IndicatorForm(forms.Form): #These don't work! indicator_id = forms.IntegerField(initial=indicator.id, widget=forms.HiddenInput()) patient_id = forms.IntegerField(initial=patient.id, widget=forms.HiddenInput()) def __init__(self, *args, **kwargs): forms.Form.__init__(self, *args, **kwargs) self.indicator = indicator self.patient = patient #These do! setattr(IndicatorForm, 'indicator_id', forms.IntegerField(initial=indicator.id, widget=forms.HiddenInput())) setattr(IndicatorForm, 'patient_id', forms.IntegerField(initial=patient.id, widget=forms.HiddenInput())) for field in indicator.indicatorfield_set.all(): setattr(IndicatorForm, field.name, copy(field.get_field_type())) return type('IndicatorForm', (forms.Form,), dict(IndicatorForm.__dict__)) I'm trying to understand why the top form field declarations don't work, but the setattr method below does work. I'm fairly new to python, so I suspect it's some language feature that I'm misunderstanding. Can you help me understand why the field declarations at the top of the class don't add the fields to the class? In a possibly related note, when these classes are instantiated, instance.media returns nothing even though some fields have widgets with associated media. Thanks, Pete

    Read the article

  • Search over multiple fields

    - by schneck
    Hi there, I think I don't unterstand django-haystack properly: I have a data model containing several fields, and I would to have two of them searched: class UserProfile(models.Model): user = models.ForeignKey(User, unique=True, default=None) twitter_account = models.CharField(max_length=50, blank=False) My search index settings: class UserProfileIndex(SearchIndex): text = CharField(document=True, model_attr='user') twitter_account = CharField(model_attr='twitter_account') def get_queryset(self): """Used when the entire index for model is updated.""" return UserProfile.objects.all() But when I perform a search, only the field "username" is searched; "twitter_account" is ignored. When I select the Searchresults via dbshell, the objects contain the correct values for "user" and "twitter_account", but the result page shows a "no results": {% if query %} <h3>Results</h3> {% for result in page.object_list %} <p> <a href="{{ result.object.get_absolute_url }}">{{ result.object.id }}</a> </p> {% empty %} <p>No results</p> {% endfor %} {% endif %} Any ideas?

    Read the article

  • Cache for everybody except staff members.

    - by Oli
    I have a django site where I want to stick an "admin bar" along the top of every non-admin page for staff members. It would contain useful things like page editing tools, etc. The problem comes from me using the @cache_page decorator on lots of pages. If a normal user hits a page, the cached version comes up without the admin bar (even for admin users) and if an admin hits the page first, normal users see the admin bar. I could tediously step through the templates, adding regional cache blocks but there are a lot of templates, and life is altogether too short. Ideally, there would be a way of telling the caching to ignore cache get/set requests from admin users... But I don't know how to best implement that. How would you tackle this problem?

    Read the article

  • How do I prevent a ManyToManyField('self') from linked an object to itself?

    - by dyve
    Consider this model (simplified for this question): class SecretAgentName(models.Model): name = models.CharField(max_length=100) aliases = ManyToManyField('self') I have three names, "James Bond", "007" and "Jason Bourne". "James Bond" and "007" are aliases of each other. This works exactly like I want it to, except for the fact that every instance can also be an alias of itself. This I want to prevent. So, there can be many SecretAgentNames, all can be aliases of each other as long as "James Bond" does not show up as an alias for "James Bond". Can I prevent this in the model definition? If not, can I prevent it anywhere else, preferably so that the Django Admin understands it?

    Read the article

  • Removing a result from Queryset

    - by Enrico
    Is there a simple way to discard/remove the last result in a queryset without affecting the db? I am trying to paginate results in Django, but don't know the total number of objects for a given query. I was planning on using next/previous or older/newer links, so I only need to know if this is the first and/or last page. First is easy to check. To check for the last page I can compare the number of results with the pagesize or make a second query. The first method fails to detect the last page when the number of results in the last set equals the pagesize (ie 100 records get broken into 10 pages with the last page containing exactly 10 results) and I would like to avoid making a second query. My current thought is that I should fetch pagesize + 1 results from the db. If the queryset length equals 11, I know this is not the last page and I want to discard the last result in the queryset before passing the queryset to the template.

    Read the article

  • Quering distinct values throught related model

    - by matheus.emm
    Hi! I have a simple one-to-many (models.ForeignKey) relationship between two of my model classes: class TeacherAssignment(models.Model): # ... some fields year = models.CharField(max_length=4) class LessonPlan(models.Model): teacher_assignment = models.ForeignKey(TeacherAssignment) # ... other fields I'd like to query my database to get the set of distinct years of TeacherAssignments related to at least one LessonPlan. I'm able to get this set using Django query API if I ignore the relation to LessonPlan: class TeacherAssignment(models.Model): # ... model's fields def get_years(self): year_values = self.objects.all().values_list('year').distinct().order_by('-year') return [yv[0] for yv in year_values if len(yv[0]) == 4] Unfortunately I don't know how to express the condition that the TeacherAssignment must be related to at least one LessonPlan. Any ideas how I'd be able to write the query? Thanks in advance.

    Read the article

  • Passing session data to ModelForm inside of ModelAdmin

    - by theactiveactor
    I'm trying to initialize the form attribute for MyModelAdmin class inside an instance method, as follows: class MyModelAdmin(admin.ModelAdmin): def queryset(self, request): MyModelAdmin.form = MyModelForm(request.user) My goal is to customize the editing form of MyModelForm based on the current session. When I try this however, I keep getting an error (shown below). Is this the proper place to pass session data to ModelForm? If so, then what may be causing this error? TypeError at ... Exception Type: TypeError Exception Value: issubclass() arg 1 must be a class Exception Location: /usr/lib/pymodules/python2.6/django/forms/models.py in new, line 185

    Read the article

  • Saving related model objects

    - by iHeartDucks
    I have two related models (one to many) in my django app and When I do something like this ObjBlog = Blog() objBlog.name = 'test blog' objEntry1 = Entry() objEntry1.title = 'Entry one' objEntry2 = Entry() objEntry2.title = 'Entry Two' objBlog.entry_set.add(objEntry1) objBlog.entry_set.add(objEntry2) I get an error which says "null value in column and it violates the foreign key not null constraint". None of my model objects have been saved. Do I have to save the "objBlog" before I could set the entries? I was hoping I could call the save method on objBlog to save it all. NOTE: I am not creating a blog engine and this is just an example.

    Read the article

  • Is it ok to hardcode dynamic links in a permanent view?

    - by meder
    Let's say I wanted to showcase 2-3 clickable buttons on my homepage which will be there permanently. These are links to the css, html, and javascript tag listing pages. Is it fine to just hardcode href=/tags/css and href=/tags/html right in my django templates/view? I won't change them for at least a year or so, meaning I don't think I need to add a column to the tags table to distinguish them - is this common or should I try to make it somewhat dynamic? These tags are in a table but so are 1000 other tags.

    Read the article

  • Select distinct users with referrals

    - by Mark
    I have a bunch of Users. Since Django doesn't really let me extend the default User model, they each have Profiles. The Profiles have a referred_by field (a FK to User). I'm trying to get a list of Users with = 1 referral. Here's what I've got so far Profile.objects.filter(referred_by__isnull=False).values_list('referred_by', flat=True) Which gives me a list of IDs of the users who have referrals... but I need it to be distinct, and I want the User object, not their ID. Or better yet, it would be nice if it could return the number of referrals a user has. Any ideas?

    Read the article

  • Overwrite queryset which builds filter sidebar

    - by cw
    Hi, I'm writing a hockey database/manager. So I have the following models: class Team(models.Model): name = models.CharField(max_length=60) class Game(models.Model): home_team = models.ForeignKey(Team,related_name='home_team') away_team = models.ForeignKey(Team,related_name='away_team') class SeasonStats(models.Model): team = models.ForeignKey(Team) Ok, so my problem is the following. There are a lot of teams, but Stats are just managed for my Club. So if I use "list_display" in the admin backend, I'd like to modify/overwrite the queryset which builds the sidebar for filtering, to just display our home teams as a filter option. Is this somehow possible in Django? I already made a custom form like this class SeasonPlayerStatsAdminForm(forms.ModelForm): team = forms.ModelChoiceField(Team.objects.filter(club__home=True)) So now just the filtering is missing. Any ideas?

    Read the article

< Previous Page | 91 92 93 94 95 96 97 98 99 100 101 102  | Next Page >