Re: clean up media file
Thanks, was looking for something like this. On Jul 14, 4:55 pm, -RAX- wrote: > Hi all, > > I am opensourcing a tool for cleaning all the media upload files. > It is basically browsing your DB and deleting all the media files which are > not linked by the DB. > > We implemented this tool since django 1.3 in which FileFIeld files are no > longer deleted when the model is deleted. > You can fine the source code > here:https://github.com/msama/django-uploadcleaner -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: clean up media file
Thanks, was looking for something like this. On Jul 14, 4:55 pm, -RAX- wrote: > Hi all, > > I am opensourcing a tool for cleaning all the media upload files. > It is basically browsing your DB and deleting all the media files which are > not linked by the DB. > > We implemented this tool since django 1.3 in which FileFIeld files are no > longer deleted when the model is deleted. > You can fine the source code > here:https://github.com/msama/django-uploadcleaner -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Not reading from TEMPLATE_DIRS in settings.py
Have you checked the permissions of the directory and template files? run ls -l in the parent directory of the template folder and inside the folder itself . madala wrote: > Have followed tutorial 2 instructions carefully. So far everything has > worked as described in tutorials but cannot get django to load files from > my own template directory. Seems a very simple problem. > > here's the part of my settings.py: > > TEMPLATE_DIRS = ( > '/home/madala/WebsiteCode/templates', > "/home/madala/Website/templates", > # Put strings here, like "/home/html/django_templates" or > "C:/www/django/templates". > # Always use forward slashes, even on Windows. > # Don't forget to use absolute paths, not relative paths. > ) > > So I carried on and started tutorial 3 till I got halfway down and had to > do same thing but no matter what I try can't get Django to recognize my > directories. > > Can anyone see where I am going wrong please? thanks in anticipation. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Unique Id issue
Hi all, Am in a bit of a fix which I put myself in,I have the following models: class Town(...): name = models.CharField(unique=true) province = models.foreignKey(Province) class Area(): name = models.CharField(unique=true,max_length=120) town = models.CharField(Town) The problem here is I made the assumption that an area name is unique,unfortunatly after deploying ,I have just realized that some towns have the same area names so I can't have example area x in town A as well as area x in town B. We have already deployed and have 575 users so far,is there any safe way of removing the unique key constraint on Area model without damaging the records which are already there? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/pxRbdVnDVOwJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Implementing a monitoring system with django.
Depending on what you need for the graphs,have a look at flot,jqplot or rapheal.js(heavy).There is also high charts althought there are some licensing issues you may want to avoid. If you get stuck with the charts,let me know..am running some. On Tuesday, December 11, 2012 11:09:06 PM UTC+2, Marc Aymerich wrote: > > On Tue, Dec 11, 2012 at 4:32 PM, Bill Freeman > > wrote: > > > > > > On Mon, Dec 10, 2012 at 2:41 PM, Marc Aymerich > > > > wrote: > >> > >> Hi, > >> I'm considering to implement a simple monitorization system that > >> basically gathers some data from a set of nodes (<1000 nodes). The > >> gathered data should be stored in order to let users perform some > >> queries and maybe also generate some graphs. > >> > >> I'm looking for advice in what components are best suited for each of > >> the following parts: > >> > >> 1) Storage: maybe something nonsql like MongoDB? or perhaps RRD? > >> 2) Data gathering: celery periodic tasks? > >> 3) Graphs: rrd? or some java script framework for graphing? > >> > >> thanks for your comments!! > > > > > > While this may be a fine opportunity to learn about some of these > techniques > > (NoSQL, celery), unless I misunderstand the potential bandwidths > involved, > > the problem fits more pedestrian stuff pretty well. > > > > If I were doing this I'd use PostgreSQL and a cron (or equivalent on > your > > OS) triggered django management command to gather the data and stuff it > into > > the models. Certainly django can provide display of the data to the > user. > > > > For graphing, I've used YUI (yahoo) tools in the past (I'm sure that > google > > has competitive offerings), but it required that the user have Flash. > While > > pretty much everyone has Flash, I'd rather go for HTML5 or SVG (and a > few > > people may have browsers that don't do these). Maybe modern frameworks > can > > be had that detect the browser's capabilities and respond accordingly. > (The > > YUI stuff was driven by a table of data in the DOM, and that approach > allows > > the support decision to be deferred to the browser side.) Depending on > load > > and update rate, you could also generate png or jpg files on the fly in > a > > view that IMG tags in your HTML refer to, which works even if the user > has > > javascript disabled, but loads the server a bit. You would probably > want to > > encode a timestamp or generation sequence into the generated image path > > name, so that you wouldn't have to worry about cacheing, including in > the > > browser, keeping you from showing a fresh image when the user refreshes > the > > page. > > > > Hi bill thanks for your feedback! > You're right, maybe I can start using a traditional RDBMS like > postgres and switch when things starts getting slow, if even it really > happens at all. > > By the way, I've been looked at some nosql storage backends, and > couchdb seems the more appropriate option for storing time-series data > in django. > > regarding the graph stuff, the project is somehow related with > opensource and openeverything, so flash is not really an option. I'll > look at some js framework. > > thanks again! > -- > Marc > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/pxDyxFeEwBoJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: 1.5 custom user model: Add User with default UserCreationForm results in "no such table: auth_user"
Thanks alot Eric and Russel,I was also stuck on this. I can also confirm that you have to override clean_username in addition to the class Meta ,otherwise you will get a database error. On Wednesday, February 27, 2013 9:15:53 PM UTC+2, Eric Psalmond wrote: > > Hi everyone, > > After a bit of searching I didn't find an answer to this issue, so I > thought I'd post here and see what the response was like. > > A little background: I've been working with other frameworks and packages > for years - from Websphere long ago to RoR and M$-MVC more recently. > > After using Django for about two weeks I'm 100% in love with it and have > been singing its praises from the mountaintops. Documentation is dead on > and unlike anything else I've seen, and the ORM is for people that actually > understand and like RDBMS, and in a day and age of No-SQL fads and PHP > "developers," it has been very refreshing. I was trying out Django > alongside with a trendy new PHP framework that claimed to have great docs > and ORM, but when implementing it I found it was a typical mess of > documentation-by-forum and uniquely seemed to love the smell of its own > farts more than any open source project I'd ever seen. > > If I had one complaint about Django, it would be lack of support for > composite keys, but I see enough work has already been done on that front > that I might feel comfortable hacking something together, and it's so minor > compared to all the other benefits that I can live with it. > > Anyway- on to my question: > > I rolled a custom user model since 1.5 was released yesterday. I love the > abstractions of AbstractUser and AbstractBaseUser, it totally makes sense. > However, when I rolled my own custom user class and tried to use the built > in UserAdmin and UserCreationForm classes, I had a problem with the Admin. > Everything in my project seemed to obey the swappable Meta tag in the User > class except for the UserCreationForm. I always got an error of: Table > does not exist: "auth_user" whenever getting past the first step of setting > username and password. > > Not being super familiar with forms in Django yet, I stepped through the > debugger and found that this line in the form was the culprit: > > def clean_username(self): > # Since User.username is unique, this check is redundant, > # but it sets a nicer error message than the ORM. See #13147. > username = self.cleaned_data["username"] > try: > User._default_manager.get(username=username) > except User.DoesNotExist: > return username > raise > forms.ValidationError(self.error_messages['duplicate_username']) > > For some reason, User._default_manager.get refused to obey the switch the > my CustomUser class. User.anything_else seemed to be OK. I resolved this > by changing User._default_manager.get to my CustomUser._default_manager.get > and now everything is peachy and going to the right table. > > I have seen some posts that indicate when using a custom user class that > new forms and UserAdmin classes must be rolled (or, *gasp*, copy-pasted,) > so I'm wondering if this is the expected and correct behavior, am I missing > something, or did I find a bug? > > Thanks for reading and I look forward to participating in this awesome > community. > > Best, > -Eric > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.