Re: main page have stopped work after creating poll app

2018-05-28 Thread Florian Schweikert
It seems you don't have a "main" page. The page you saw was a placeholder starting page if there are no other urls defined. If you want to deliver something at / you have to add it to urls.py PS: pasting screenshots of code is a very bad habit. On 26/05/18 14:46, Dmitry Sobolev wrote:

Re: Filter Json boolean data

2018-01-19 Thread Florian Schweikert
Hi, On 19/01/18 11:50, tango ward wrote: >     # Check who the winner of the match >     if data['radiant_win'] == 'False': You are comparing a boolean with the *string* 'False', remove the ' and try again. >     j_data['Winner'] = data['dire_name'] >     else

Re: pass context to overridden templates

2017-05-04 Thread Florian Schweikert
On 03/05/17 15:53, cjdcordeiro wrote: > Probably the best would be overriding the app's default class based > view, but when I look at it > (https://github.com/django-notifications/django-notifications/blob/master/notifications/views.py#L29) > it doesn't have a get_context method or anything I can

Re: No installed app with label 'province'.

2017-02-09 Thread Florian Schweikert
On 09/02/17 14:01, Gerald Brown wrote: > Because of this problem I am NOT able to proceed with my project so any > and all help will be appreciated. Maybe somebody could help you if you provide more information about what you are doing. Following information could give some starting points for in

Re: Reverse for 'reg/{{post.pk}}/' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []

2016-05-30 Thread Florian Schweikert
On 24/05/16 08:46, meInvent bbird wrote: > onClick="window.location.href='{% url 'reg/{{post.pk}}' %}'">Save You cannot access a variable like this in a template. There is also no point in trying to access an url using url providing an url. Your url pattern is called 'post_detail'. Try somethin

Re: 1.8 or 1.9?

2016-05-12 Thread Florian Schweikert
On 12/05/16 18:36, Sean McKinley wrote: > I haven't taken the course, but the differences between basic Django 1.8 > and 1.9 are not all that significant and you can find out if you are > being taught something odd by reviewing 1.9 release notes. Big caveat, > syncdb is gone in 1.9 so you have to l

Re: NAS using Django

2016-03-10 Thread Florian Schweikert
On 10/03/16 08:03, Vayuj Rajan wrote: > I configured SAMBA and I can access it directly at my computer. But what > I saw there that he was accessing it by using a website . So basically > he was accessing it from local web server with a storage attached. You basically want something like owncloud

Re: Absolute beginner question -- recipes

2016-02-29 Thread Florian Schweikert
On 28/02/16 20:14, Simon Gunacker wrote: > | > def detail(request, pk): > recipe = Recipe.objects.get(id=pk) > recipe['steps'] = Steps.objects.filter(recipe_id=pk) > template = loader.get_template('recipe/recipe_detail.html') > context = { > 'recipe': recipe, > } > r

Re: like query django

2016-01-19 Thread Florian Schweikert
On 19/01/16 16:35, Xristos Xristoou wrote: > url(r'^view/(?P[^\.]+)/$', views.view_post, name='view_post'), > url(r'^(?P[0−9]+)/$', views.like_post, name='like_post'), this defines urls like /1/ > The current URL, |like/1/|, didn't match any of these. of course it doesn't, you didn't define a li

Re: n00b question about displaying data in order by day

2015-11-07 Thread Florian Schweikert
On 07/11/15 06:03, Becka R. wrote: > How can I display the data in the template so the shifts are sorted by > day, and then by meal? Try saving the weekday as integer (0-6), sorting using integer is much easier than sorting using strings in non-alphabetic order :) You can than e.g. define a defaul

Re: Admin: Unknown fields

2015-09-29 Thread Florian Schweikert
On 29/09/15 18:47, Rolston Jeremiah wrote: > class Genus(models.Model): > genus_id = models.AutoField(primary_key=True), > scientific_genus = models.CharField(max_length=32), > common_name = models.CharField(max_length=32), > common_examples = models.TextField(), It's probably because of the ',' a

Re: How to serve any static directory?

2015-09-01 Thread Florian Schweikert
On 01/09/15 16:34, Yann Salaün wrote: > In summary : is there a way to put something like `return > serve_this_static_directory()` in the view? or is there any workaround > there? Not sure if I get you right, you want to serve static files with django? Is there any reason why it's not possible to

Re: Using ModelForms

2015-08-31 Thread Florian Schweikert
On 25/08/15 01:25, Sait Maraşlıoğlu wrote: > default = timezone.now() Beware, timezone.now() will be evaluated once when the module is loaded, not on save if you might think. Use default = timezone.now without calling it to get the current value on save. -- You received this message because you

Re: I have error like Type Error save() takes at least 2 arguments (1 given) in Django project.

2015-08-31 Thread Florian Schweikert
On 31/08/15 12:10, Remaze Vs wrote: > def save(self,request,*args,**kwargs): You defined save to take a second positional argument, so it's no wonder it crashes if you call .save() If you need the request in the save method you have to pass it, otherwise remove the request parameter. See docs for

Re: ForeignKey Fields null=True does not imply blank=True

2015-08-26 Thread Florian Schweikert
On 26/08/15 11:59, khoobks wrote: > I just discovered some interesting behaviour in Django 1.8.4 and was > wondering if this was an unexpected side effect or specifically designed > behaviour. That behaviour is intended and documented[0]. blank and null working on completely different levels. bla

Re: 'self' is not define

2015-08-19 Thread Florian Schweikert
On 19/08/15 13:25, Remaze Vs wrote: > username=self.request.user.username What do you want to accomplish with this line? This cannot work. Where should self and self.request come from? You probably want to us a ForeignKey to the User model. (user = models.ForeignKey(User)) Afterwards you have to

Re: Models and relationships

2015-07-06 Thread Florian Schweikert
On 06/07/15 14:04, Chris Strasser wrote: > my problem is with reverse lookups (i think it is called) the docs say that i > can access entries through blog.entry,(by lowercaseing the class) > it appears to me that i have the same setup with contact and location but i > am getting errors ?? I thin

UnicodeError while searching in haystack/whoosh index

2015-04-28 Thread Florian Schweikert
Hi, I'm working on an django-cms 3.0.13/py2.7 page atm and came across an weird behaviour using haystack with whoosh. When using rebuild_index everything works fine. But using update_index afterwards leads to an UnicodeDecodeError when searching for a page with umlauts. Error thrown in "whoosh/re

Re: static files and DEBUG = False

2015-04-24 Thread Florian Schweikert
On 21/04/15 23:49, egon.frer...@gmx.de wrote: > settings.py contains ALLOWED_HOSTS with the host in the form > ".example.com". With DEBUG = True I get the complete page. But if I set > DEBUG = False the static files are not found so I get only the content. Django does not serve static files if DEB

Re: New data field in models.py "does not exist".

2015-01-12 Thread Florian Schweikert
On 12/01/15 19:16, dennis breland wrote: > I ran these after making the changes: > python manage.py sqlall recipe manage.py sqlall just prints the sql statements for your models > python manage.py syncdb Do you use migrations? If so did you run migrate? What was the output of syncdb? -

Re: what's different between {% static %} and {{ STATIC_URL}}

2015-01-08 Thread Florian Schweikert
On 2015-01-06 12:55, Andreas Kuhne wrote: The difference is the age of the django project you are looking at. {% load staticfiles %} the {% static %} is the current way to load and use static files. It also has the option to do other things (like MD5 hashes for versions) automatically and should

Re: Serving static files (admin panel and others)

2014-12-13 Thread Florian Schweikert
On 14/12/14 00:55, Muhammed Tüfekyapan wrote: > I try many things to serve .css files but I can't do that. How can i > serve .css and .js files in Django 1.7? > > > I typed django manage.py collectstatic but still my admin panel don't > load css. > > What can i do? did you follow the howto in t

Re: Open a url with user and password

2014-12-09 Thread Florian Schweikert
On 2014-12-07 11:48, Hossein Rashnoo wrote: Please help me. this is quite unrelated to django, maybe it would be better asking this question on the python mailinglist[1] -- Florian [1] https://www.python.org/community/lists/ -- You received this message because you are subscribed to the Go

Re: Redirect not working

2014-12-04 Thread Florian Schweikert
On 04/12/14 18:58, jogaserbia wrote: > This is what I get from chrome when I click on the button in the > index.html, but nothing else happens. I bolded what I believe should > redirect to the testing UR with the lng and lat data. does it work with hardcoded url? is the testing url in the rende

Re: Problem Making New Django project - please help

2014-12-04 Thread Florian Schweikert
On 03/12/14 16:36, Shashwat singh wrote: > Django is properly installed but when i try to create a new project --- > " django-admin.py startproject abc " it returns ^^ that error. > Any help will be highly appreciated. starting new project with name abc throws the my_project.settings not found? T

Re: Query set append

2014-12-02 Thread Florian Schweikert
On 2014-12-01 20:07, check.dja...@gmail.com wrote: * I load the temple : template = loader.get_template(>.html>) * i use context : context = RequestContext(request,{ 'tableC_QuerySet': tableC_QuerySet,}) * return HttpResponse(template.render(context)) you may also have a

Re: Problem Making New Django project - please help

2014-12-02 Thread Florian Schweikert
On 2014-12-02 10:59, Shashwat singh wrote: ImportError: Could not import settings 'my_project.settings' (Is it on sys.path? Is there an import error in the settings file?): No module named my_project.settings PLEASE HELP WITH THIS there is not enough information to see the cause of the problem

Re: how to get back to a view requiring login

2009-10-11 Thread Florian Schweikert
2009/10/12 Sergio A. > > I've three views each with different URL. They are visible to logged > in users. > If a non-logged user tries to access a URL requiring login, I'm able > to redirect it to the login page. > > What I'm missing is how to go back to the initial page, once the user > log in t

Authentication Backend: get access to request

2009-09-28 Thread Florian Schweikert
Hi, I'm writing an own auth backend at the moment, but I need access to the request object. I found a possible solution with adding settings.request = request into a middleware, but that's seems not beautilful to me. My backend is something like this at the moment, to check the hash I need the cl

Re: TemplateSyntaxError: VariableDoesNotExist

2009-09-25 Thread Florian Schweikert
; On Sep 24, 10:14 am, Florian Schweikert > wrote: > > Hello, > > > > {% trans Pagetitle %} produces TemplateSyntaxError when there is no > > Pagetitle given, without translation django ignores it. > > Why i18n can't translate/ignore NoneType? I don't

TemplateSyntaxError: VariableDoesNotExist

2009-09-24 Thread Florian Schweikert
Hello, {% trans Pagetitle %} produces TemplateSyntaxError when there is no Pagetitle given, without translation django ignores it. Why i18n can't translate/ignore NoneType? I don't want to use if around all this varibles. Is there any more confortable way? greetings, Florian --~--~-~--~-

Re: verbose_name/i18n sometimes doesn't work in one app

2009-09-23 Thread Florian Schweikert
2009/9/23 > Hi, > > I've a project with 2 apps, I'm using the meta class for defining > verbose_name(_plural), register in admin.py. > For The first app it works good, in the second django shows often the > (buggy) generic name, for example: > > "Lv a_types"(the space is on the wrong place I thin

Re: Django1.1 logs me out after few seconds inactivity

2009-09-13 Thread Florian Schweikert
Maybe it's that old bug: http://blog.umlungu.co.uk/blog/2007/may/20/cookie-problem-django-admin/ Server Upgrade to Lenny is planned in the near future, I hope the problem solves itself with the dist-upgrade. greetz, Florian --~--~-~--~~~---~--~~ You received this m

Re: Django1.1 logs me out after few seconds inactivity

2009-08-25 Thread Florian Schweikert
Now I'm able to login etc, but only with django-server, with apache also the admin interface informs me that my browser doesn't allow cookies. So there's a problem with apache and/or mod_python. :-/ I'll test this after the planned upgrade to lenny again. --~--~-~--~~~-

Re: Django1.1 logs me out after few seconds inactivity

2009-08-24 Thread Florian Schweikert
1 Russell Keith-Magee > > On Fri, Aug 21, 2009 at 9:10 PM, Florian > Schweikert wrote: > > > In summary: > > * On the server (etch) session flushes by request.user.is_authenticated() > > (e.g session.user switched to anonymous without any findable reason) > after

Re: Django1.1 logs me out after few seconds inactivity

2009-08-21 Thread Florian Schweikert
Tried to use sqlite, to test if it's a db problem, but django aren't able to open a sqlite databasefile which has the right permissions. Trying postgres next. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django us

Re: Django1.1 logs me out after few seconds inactivity

2009-08-21 Thread Florian Schweikert
I tried it on my notebook with the django server, the cookie wasn't touched, but request.session.session_key changes every request. Using the db session backend avoid login, cached_db and cache works temporally. In summary: * On the server (etch) session flushes by request.user.is_authenticated()

Re: Django1.1 logs me out after few seconds inactivity

2009-08-21 Thread Florian Schweikert
I wrote a tiny page which just shows the session_key. I can refresh this site and the key is the same, but if I open one of the other pages the request.user.is_authenticated() method opens a new session. :( Nevertheless thanks for your ideas. greets, florian --~--~-~--~~~

Re: Django1.1 logs me out after few seconds inactivity

2009-08-21 Thread Florian Schweikert
2009/8/21 Russell Keith-Magee > > On Fri, Aug 21, 2009 at 12:17 AM, Kelvan > wrote: > > > > I've a big problem with user authentification, my application get an > > username and a hashkey to verify if the user is logged in. I wrote a > > function that check this, it worked fine to log in the user