Re: Can I simply disable the CSRF? crazy
On Tue, Aug 17, 2010 at 23:29, Rolando Espinoza La Fuente wrote: > See csrf_exempt decorator: > http://docs.djangoproject.com/en/dev/ref/contrib/csrf/#exceptions I had problems too, but the decorator is a good patch for the moment :-) Thanks! -- Karim Gojux www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
Newbie question about url and seo
Hi all! This is my first post here in the list, I'm new in django and python but I really found it fun and exciting so here we are! My first question is pretty simple. I noted that the url I create using urls.py are cleaned and pretty but there is no index.html or simila. It seems that every url point to a directory. Is that good in terms of SEO? I guess that is even better than the old fashion way with the index.something, but I don't know. Thanks in advance -- Karim Gojux www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: Newbie question about url and seo
On Fri, Aug 20, 2010 at 18:19, David Euzen wrote: > Hello, > > you should think of it in terms of ressource, not of file. URLs are > about ressources not about files even if sometimes ressources are > files. Thanks for your answer. Was very useful! Have a nice day. -- Karim Gojux www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
Problems loading static files on runserver (I mean images and css)
As I read here http://docs.djangoproject.com/en/dev/howto/static-files/ I configure the settings.py and the urls.py to load a template in runserver. ## urls.py ## from django.conf import settings [...] (r'^media/(?P.*)$', 'django.views.static.serve', {'document_root': 'settings.STATIC_DOC_ROOT'}), ## end of urls.py ## ## settings.py ## [...] STATIC_DOC_ROOT = '/Users/karim/Projects/simplesite/template/media/' [...] ## end of settings.py ## My doubt is in these 3 variables. How I have to use they? MEDIA_ROOT = '' MEDIA_URL = '' ADMIN_MEDIA_PREFIX = '/media/' I tried a lot but without success. Another question. In the template how I have to refer to the files? I have just 2: "style.css" and "header.jpg" that are located in "/Users/karim/Projects/simplesite/template/media" Is these code right? Thanks! -- Karim Gojux www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: Problems loading static files on runserver (I mean images and css)
On Fri, Aug 27, 2010 at 10:57, bruno desthuilliers < bruno.desthuilli...@gmail.com> wrote: > > Thanks a lot for all your advices. I work a lot on settings.py and now is more professional. The mistake was in ADMIN_MEDIA_PREFIX = '/media/' I changed it in ADMIN_MEDIA_PREFIX = '/admin-media/' And everything works now. Thanks! -- Karim Gojux www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
How to create a gerarchical list in admin for flatpages?
Hi all! I'm working to create my CMS on Django, I would like to realize a easy admin page for my flat pages that in Django-CMS is called "site map". How I can do that? Are there any tutorial or how to about that? Have you any advice? Thanks! The site map in Django-CMS: http://www.django-cms.org/media/uploads/cms_page_media/2/3_pagelist___.png -- Karim Gojux www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: Overriding flatpages class meta
Try to modify the flatpages source! You can find it directly in your django installation. -- Karim Gojux www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: How to create a gerarchical list in admin for flatpages?
On Tue, Aug 31, 2010 at 14:11, Karim Gorjux wrote: > I would like to > realize a easy admin page for my flat pages that in Django-CMS is > called "site map". I found what I need. Is here: http://code.google.com/p/django-mptt/ -- Karim Gojux www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
I don't understand the difference between these two views
Working on the Coltrane's Book :-) ... I create two views that do the same thing but the first one use the generic view and the second a render to response. I don't understand why because both works but the second besides don't passe the category object, don't load the django.core.context_processors.media I set in settings.py. So if I use the second view, the media I use with MEDIA_URL are not loaded. Why happening this? [...] href="{{ MEDIA_URL }}/style.css" [...] from django.shortcuts import get_object_or_404, render_to_response from coltrane.models import Entry, Category from django.views.generic.list_detail import object_list # this works and load everything def category_detail(request, slug): category = get_object_or_404(Category, slug=slug) return object_list(request, queryset=category.live_entry_set(), template_name='coltrane/category_detail.html', extra_context={ 'category': category }) # this doesn't load the django.core.context_processors.media def category_detail(request, slug): category = get_object_or_404(Category, slug=slug) return render_to_response( 'coltrane/category_detail.html', { 'object_list': category.live_entry_set()} ) -- Karim Gojux www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: I don't understand the difference between these two views
On Thu, Sep 2, 2010 at 17:46, Daniel Roseman wrote: > See here for an explanation: > http://docs.djangoproject.com/en/1.2/ref/templates/api/#subclassing-context-requestcontext > especially the "Note" box a screen or so down. Thanks! Now everything is clear -- Karim Gojux www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: With apache2 and mod_python I can't get static files loading in admin
On Fri, Oct 1, 2010 at 15:17, Daniel Roseman wrote: > Either use > a DocumentRoot directive Thanks! I solved the problem using the directive. Thanks really a lot! :-) -- K. Blog Personale: http://www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
Cherokee for home developing
Hi all! I'm trying to create my devbox for Django and I use a server in my lan with Ubuntu and Cherokee installed in. For every project I use virtualenv so I install django and flup and I create in cherokee panel the virtual server using the path of my virtualenv. All I do is explained in the Cherokee documentation page. The only change I do is the interpreter in Information Resource Settings where I use the absolute path of the python executable on my virtualenv. The browser at my virtual host's ulr show the "it worked!" message, if I just try to enable the admin and I try to go there in the browser I get this message: Unhandled Exception An unhandled exception was thrown by the application. This is really strange. If I try to reload the url, I get randomly a "Unhandled Exception" or a "It worked!" message. I tried also with an application that I develop that I'm sure it worked before and with my surprise still works in cherokee, but if I try to get the admin page I simply can't. The result is the same error ad describe above. Anyone could help me? I'm really near to get my devbox working and never think about deploying or the stuff around that anymore... help me just developing! Thanks in advance! :-) -- K. Personal Blog: http://www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: Cherokee for home developing
On Thu, Oct 28, 2010 at 19:32, Karim Gorjux wrote: > Hi all! I'm trying to create my devbox for Django and I use a server I fixed the problem with the settings.py and now admin works. The problem now is to avoid the flup's "Unhandled Exception" and let django shows it debug -- K. Blog Personale: http://www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: Cherokee for home developing
On Thu, Oct 28, 2010 at 21:06, Robbington wrote: > Glad to finally see some one using Cherokee with django. Dont just use > it in development, its actually less memory intensive than apache as > well as having an awesome admin interface. Now I can just develop on Django with Cherokee I haven't any hosting at the momento > Anyway enough plugging. > > To avoid problems and for simplicty I would advise using Cherokee > Uwsgi config to serve up your python code. Now I solved all my problems working with settings.py. Seems that also the debug works, but If I'll be again in trouble I'll get a try at uwsgi. Anyway the Cherokee server is hosted in a VirtualBox on my Mac. I had a lot of trouble trying to configure a web server with django on the Mac and I'm really happy to had found this solution. Thanks Rob for the support :-) -- K. Blog Personale: http://www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: Cherokee for home developing
I have just one question. While I'm editing the source of the project, to see the result I have always to restart the server or there is another way? -- K. Blog Personale: http://www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: Cherokee for home developing
Thanks for all your answer, the topic get a little divergence, but it's ok, I still use Cherokee for developing even if is not so comfortable as I thought. > The best way to save yourself time and effort is really to use the > Django development server when testing out alterations. Yes I guess so, but I had many problems to serve static files, and the :8000 port wasn't so cool so I tried to work with a production web server even for the developing. > Karim, you may find that refreshing your project is easier with uWSGI as > opposed to something > like FastCGI, in reference to your question about having to restart Cherokee > each time you make changes. Yes, I noted that when I edit a url and sometimes the code, I have to kill the fastcgi process to see the result in the browser. I think that I could run the fastcgi as explained in the django documentation: ./manage.py runfcgi method=prefork socket=/home/user/mysite.sock pidfile=django.pid and map in vim file a kill command kill `cat $PIDFILE` Another solution is take a look at the uWSGI configuration Anyway is a nice topic ;-) -- K. Blog Personale: http://www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: Add admin action to Django User
On Mon, Nov 1, 2010 at 05:03, Django-learner wrote: > Hi, I want to add an customized action to user management in django > admin site. I can see that only delete selected user is available, how > can I add more to that? Did you try to google that? This is my **first** result: http://docs.djangoproject.com/en/dev/ref/contrib/admin/actions/ -- K. Blog Personale: http://www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: Add admin action to Django User
Maybe you'll find this also useful: http://www.theotherblog.com/Articles/2009/06/02/extending-the-django-admin-interface/ -- K. Blog Personale: http://www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: Cherokee for home developing
On Sun, Oct 31, 2010 at 01:27, Max Countryman wrote: > Yes, absolutely. :D Good luck! Max, I'm trying with uwsgi and Cherokee. Seems to work, but if I edit the code, I have to kill the uwsgi process to see the modification on the browser. Is that normal? -- K. Blog Personale: http://www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: Cherokee for home developing
On Mon, Nov 1, 2010 at 21:21, Max Countryman wrote: > Karim, I would set it up using a UNIX socket. Then all you have to do is rm > the socket path. :) There is no need to kill uWSGI in that case. Let me study that, because there is always a newbie side in me that sometimes scream out :D If this will drive me crazy, I'll write you here again if you let me. Ciao! -- K. Blog Personale: http://www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
How create a simple "brochure" website in django?
Hi all! I'm a relative newbie in Django and I spending a lot of time study it in these days. I read many tutorials and books and I'm surprised to found very interesting resource to how create a wiki, a blog, app like twitter even a social bookmarking website but I never found a simple tutorial to explain how to create just a website. I would like to create a website with some flatpages. I tried to use the contrib app in django and is very easy, but really very essential. Even get the flatpages to populate a menu in a template was just an add of few weeks ago. I would read a tutorial that cover this needs maybe using the flatpages contrib, why not? * Add the tinymce wysiwyg editor with support to load multimedia file to include within the page. For example a image. * Let the editor create href link to other pages in the website easily * Organize the pages in gerarchical and edit in that way in the panel admin as django-page-cms * internationalization of the pages from the panel admin I still wonder that I can't found any tutorials or books that cover this essential and maybe simple task so I ask you if you know where I can get any resource to achieve these features in my next project. Thanks! :-) -- K. Blog Personale: http://www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: How create a simple "brochure" website in django?
On Thu, Nov 4, 2010 at 15:06, bruno desthuilliers wrote: > You may not realize that what you're describing here is a full blown > CMS, and as such is a tad more complex than simple thing like a blog > or wiki or dumbed-down twitter clone. I strongly suggest you try some > existing CMS like django-cms or LFC > > http://www.lfcproject.com/ > http://www.django-cms.org/ Thanks! I understand why I can't find anything on internet about that. Do you know if there is a really simplecms where I can work on without too much problems? -- K. Blog Personale: http://www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: How create a simple "brochure" website in django?
On Thu, Nov 4, 2010 at 18:26, James wrote: > Yes, there is. > > You should take a look at "Practical Django Projects" (be sure to get > the 2nd edition) by James Bennett. In the book he creates a > simple-cms with a tinymce editor. > > He has the source code published here: > http://bitbucket.org/ubernostrum/practical-django-projects/src I read this book, but the cms is a blog called coltrane and handle the pages with flatpages -- K. Blog Personale: http://www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: How create a simple "brochure" website in django?
Now I'm trying django-cms, but I would like to find some really essential to study on. -- K. Blog Personale: http://www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
django-cms error: no module named simplesite.urls
Hi all, I'm just taking a look to the django-cms. I followed all the instruction, but when I try to connect to the site I get this error - log - File "/home/karim/Projects/e_dcms/lib/python2.6/site-packages/django/core/servers/basehttp.py", line 280, in run self.result = application(self.environ, self.start_response) File "/home/karim/Projects/e_dcms/lib/python2.6/site-packages/django/core/servers/basehttp.py", line 674, in __call__ return self.application(environ, start_response) File "/home/karim/Projects/e_dcms/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 245, in __call__ response = middleware_method(request, response) File "/home/karim/Projects/e_dcms/lib/python2.6/site-packages/django_cms-2.1.0.beta3-py2.6.egg/cms/middleware/multilingual.py", line 59, in process_response language = getattr(request, 'LANGUAGE_CODE', self.get_language_from_request(request)) File "/home/karim/Projects/e_dcms/lib/python2.6/site-packages/django_cms-2.1.0.beta3-py2.6.egg/cms/middleware/multilingual.py", line 25, in get_language_from_request pages_root = urllib.unquote(reverse("pages-root")) File "/home/karim/Projects/e_dcms/lib/python2.6/site-packages/django_cms-2.1.0.beta3-py2.6.egg/cms/models/__init__.py", line 50, in new_reverse url = django.core.urlresolvers.old_reverse(viewname, urlconf=urlconf, args=args, kwargs=kwargs, prefix=prefix, current_app=current_app) File "/home/karim/Projects/e_dcms/lib/python2.6/site-packages/django/core/urlresolvers.py", line 351, in reverse *args, **kwargs))) File "/home/karim/Projects/e_dcms/lib/python2.6/site-packages/django/core/urlresolvers.py", line 272, in reverse possibilities = self.reverse_dict.getlist(lookup_view) File "/home/karim/Projects/e_dcms/lib/python2.6/site-packages/django/core/urlresolvers.py", line 194, in _get_reverse_dict self._populate() File "/home/karim/Projects/e_dcms/lib/python2.6/site-packages/django/core/urlresolvers.py", line 162, in _populate for pattern in reversed(self.url_patterns): File "/home/karim/Projects/e_dcms/lib/python2.6/site-packages/django/core/urlresolvers.py", line 244, in _get_url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/home/karim/Projects/e_dcms/lib/python2.6/site-packages/django/core/urlresolvers.py", line 239, in _get_urlconf_module self._urlconf_module = import_module(self.urlconf_name) File "/home/karim/Projects/e_dcms/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module __import__(name) ImportError: No module named simplesite.urls - log - I google the simplesite.urls but I can't find where and what is. I also write to the django-cms maling list but is moderated and needs times to get an answer so I hope that one of you knows where I made the mistake. Thanks in advance! -- K. Blog Personale: http://www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: django-cms error: no module named simplesite.urls
On Thu, Nov 4, 2010 at 19:35, Karim Gorjux wrote: > Hi all, I'm just taking a look to the django-cms. I followed all the > instruction, but when I try to connect to the site I get this error my mistake. Was the settings.py wrong! :-| -- K. Blog Personale: http://www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
Create a simple Editor with image support
Hi all, I would like to create a "improved" flatpage application adding a editor and the support of image files. My target is to edit a static web page load images and see a preview. I can add easily a editor like tinymce, I would try also FCKeditor, but what about the handle of images? Could you show me a guide that explain how to handle images from the editor and django? Thanks -- K. Blog Personale: http://www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
Create User from an User extension
Hi all, I successfully extended the User as described in the authorization documentation. Now I would like to use and edit the User and my class Persona not like two entity but just one. When I want to create a Persona, I have also to create a User first. Now the steps are too long, how I can create an admin.TabularInline? I tried this: class UserInline(admin.TabularInline): model = User class PersonaAdmin(admin.ModelAdmin): inlines = [ UserInline, ] But when I try to add a Persona I get the exception "has no foreign key" I guess I have to do the reverse add an PersonaInline to the UserAdmin, but I'm a little confused. -- K. Blog Personale: http://www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: Create User from an User extension
On Sat, Nov 13, 2010 at 00:08, Steve Holden wrote: > When you add a Persona the UserInline lets you enter a User record, but > the User has to be saved before the Persona. You could do this by > extending the Persona.save() method to save the User as well. Thanks a lot. I'll try. -- K. Blog Personale: http://www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.