Problem: Ajax post method to django views

2019-11-08 Thread Mikko Meronen
Hi, I have a problem to pass a json value to Django views and use the value to retrieve data from my database. Anyone could help me? I get the ajax error message and the following error in chrome console: jquery.js:8475 POST http://www.topithenewsdoggy.com/history/ 403 (Forbidden) *views.py*

Re: Django template

2019-02-08 Thread Mikko Meronen
someone wiser can answer to this :p -Mikko la 9. helmik. 2019 klo 8.48 Tom Zhang (computerset...@gmail.com) kirjoitti: > Thanks. I know how to do this according to Django way. But if you use > Django's way to transfer data, it makes it difficult to move to other > frameworks, right? Wh

Re: Django template

2019-02-08 Thread Mikko Meronen
='World').order_by('-created')[:8] args = {'worlddata': worlddata} return render(request, "news/home.html", args) In* home.html* (bolded ones is the code you need to connect to your views.py) *{% for news in worlddata %}* *{{ news.title }}* *{% endfor %}* -Mikko la 9. helmik. 201

Re: Django timezone problem

2019-02-08 Thread Mikko Meronen
/Los_Angeles' timezone.activate(tzinfo) timezone.localtime(timezone.now()).isoformat() # Resume default timezone (setting.py # TIME_ZONE) timezone.deactivate() timezone.localtime(timezone.now()).isoformat() Do you think it should then be alright and my timezone.now() function works? -Mikko pe 8

Re: Django timezone problem

2019-02-08 Thread Mikko Meronen
= t.strftime('%m-%d') history = history.objects.filter(monthday__exact=dm) historystory = random.sample(list(history), 1) args = {'historystory':historystory} return render(request, "news/home.html", args) -Mikko -Mikko pe 8.2.2019 klo 22.04 Alvaro Chen kirjoitti: > Set the timezone

Re: Django template

2019-02-08 Thread Mikko Meronen
-file to templates folder as well and connect it to my html. -Mikko pe 8.2.2019 klo 21.07 Tom Zhang kirjoitti: > Hi, all, > > If I don't want to use Django template engine and I just want to use > regular html/javacript, how do I configure settings.py? > I am thinking about the po

Re: Django timezone problem

2019-02-06 Thread Mikko Meronen
Hi, Thank you for your help :) -Mikko ke 6.2.2019 klo 18.47 Andréas Kühne kirjoitti: > Hi Mikko, > > The best way to do this is actually to set the timezone for the user via a > property on the user. The reason for this is that there is no way to > actually get the timezone f

Re: Django timezone problem

2019-02-04 Thread Mikko Meronen
on February 4, because it is February 4 here (in Finland or England, not sure what timezone I'm using). So I want to make my view to understand the end user's local time, so it can pick the right story from the database for the webpage visitor. -Mikko ma 4. helmik. 2019 klo 10.15 'Amitesh Sahay

Django timezone problem

2019-02-03 Thread Mikko Meronen
. The part is under Additional info. -Mikko -- 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,

Re: Search function problem in production environment

2018-10-19 Thread Mikko Meronen
The code seems to work in production environment after all, just needed to restart the site. - Mikko pe 19. lokak. 2018 klo 16.26 Mikko Meronen (mikkovillemero...@gmail.com) kirjoitti: > Hi again, > > I am trying to deploy a search function to my website. It works well in > the

Search function problem in production environment

2018-10-19 Thread Mikko Meronen
regards, Mikko *Error:* 2018-10-19 13:13:13,629: Error running WSGI application 2018-10-19 13:13:13,630: IndexError: list index out of range 2018-10-19 13:13:13,630: File "/usr/lib/python3.6/site-packages/django/core/handlers/wsgi.py", line 142, in __call__ 2018-10-19 13

Re: Instagram embedding

2018-10-13 Thread Mikko Meronen
Hi, It worked in production environment well, just not in development environment. - Mikko la 13. lokak. 2018 klo 17.39 Mikko Meronen (mikkovillemero...@gmail.com) kirjoitti: > Hi, > > I'm trying to embed Instagram to my development site by using a Instagram > embedding code, bu

Instagram embedding

2018-10-13 Thread Mikko Meronen
Hi, I'm trying to embed Instagram to my development site by using a Instagram embedding code, but when I add it to my html, I get the error below. I would appreciate a lot if someone could help me to understand the error and solve the problem. Best regards, - Mikko UnicodeDecodeError at /news

Re: Views & Template issue

2018-09-12 Thread Mikko Meronen
Thank you, works well now :) ke 12. syysk. 2018 klo 11.37 Andréas Kühne (andreas.ku...@hypercode.se) kirjoitti: > Hi Mikko, > > It works correctly the way you have written it. Look at the code you have > written: > t = time.time() > > def index(request): > newstest =

Re: Views & Template issue

2018-09-11 Thread Mikko Meronen
tables based on the creation time and updating the tables there. Now all my items are in a single table. - Mikko t = time.time() def index(request): newstest = NewsData.objects.filter(created__gt= t - 300).order_by('-created') newstest1 = NewsData.objects.filter(created__lt= t - 300

Re: Views & Template issue

2018-09-09 Thread Mikko Meronen
Thank you. -Mikko su 9. syysk. 2018 klo 16.49 Jason (jjohns98...@gmail.com) kirjoitti: > You've defined two views which pass in different querysets to be rendered. > > so if you hit index, you get the first queryset rendered but not the > second because newstest1 is not ren

Views & Template issue

2018-09-09 Thread Mikko Meronen
don't get anything, not even an error. Do I need to add something to other files in Django or is this even possible? - Mikko {% for news in newstest %} {{ news.title }} {{ news.publisher }} {{ news.section }} {{ news.country }} {% endfor %} +15 min

Re: Django database problem

2018-08-27 Thread Mikko Meronen
commands as well, but they killed the loop. Thanks for the help ^^ -Mikko ma 27. elok. 2018 klo 15.01 Andréas Kühne (andreas.ku...@hypercode.se) kirjoitti: > I have looked at this several times myself. :-) > > Regards, > > Andréas > > > Den mån 27 aug. 2018 kl 13:33 skr

Re: Django database problem

2018-08-26 Thread Mikko Meronen
it is doing that? I'm not using django custom command (if that makes the difference or can be used for my case, I will get familiar with it a bit later), I'm just inserting the data to django's database with separate python code. -Mikko ma 20. elok. 2018 klo 20.41 Jani Tiainen (rede...@gmail.com

Re: Django database problem

2018-08-20 Thread Mikko Meronen
l', 'title', 'published')) connection.commit() do() ERROR: Traceback (most recent call last): File "C:\Users\Mikko\django-project\top\datas\dataTESTI.py", line 43, in do() File "C:\Users\Mikko\django-project\top\datas\dataTESTI.py", line 21, in do find

Django database problem

2018-08-17 Thread Mikko Meronen
the data to separate sqlite database, but I don't know how to collect/connect it to django's sqlite database (or models). - Mikko -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails fro

Re: Problem in part 6, CSS doesn't work

2018-05-30 Thread Mikko Meronen
3] "GET /favicon.ico HTTP/1.1" 404 2088 -Mikko 2018-05-30 2:16 GMT+03:00 Vijay Khemlani : > That's only for production environments, for development you don't need to > run that command > > Where did you finally put the css file and what path did you put in the > t

Re: Problem in part 6, CSS doesn't work

2018-05-29 Thread Mikko Meronen
cfiles app " django.core.exceptions.ImproperlyConfigured: You're using the staticfiles app without having set the STATIC_ROOT setting to a filesystem path. If any advices available, I would appreciate it a lot, thank you. -Mikko 2018-05-29 10:18 GMT+03:00 s.f.wrobel via Django users

Re: Problem in part 6, CSS doesn't work

2018-05-26 Thread Mikko Meronen
In PowerShell it says: [26/May/2018 17:45:14] "GET /static/polls/style.css HTTP/1.1" 404 1669 2018-05-26 17:42 GMT+03:00 Mikko Meronen <mikkovillemero...@gmail.com>: > Hi, > > Still the same problem :( > > Mikko > > 2018-05-26 17:30 GMT+03:00 Dylan Reinh

Re: Problem in part 6, CSS doesn't work

2018-05-26 Thread Mikko Meronen
Hi, Still the same problem :( Mikko 2018-05-26 17:30 GMT+03:00 Dylan Reinhold <dreinh...@gmail.com>: > Mikko, > Your css file is polls/static/polls/images/style.css but you are trying > to link to polls/style.css which would be [ olls/static/polls/style.css ] > > Move yo

Problem in part 6, CSS doesn't work

2018-05-26 Thread Mikko Meronen
no-repeat; } polls/templates/polls/index.html: {% if latest_question_list %} {% for question in latest_question_list %} {{ question.question_text }} {% endfor %} {% else %} No polls are available. {% endif %} {% load static %} Best regards, Mikko -- Yo

Re: Django-admin problem

2018-05-04 Thread Mikko Meronen
ething like > c:\python36\scripts\django-admin.py > > > > Or you should use virtualenv (or pipenv) which would set path correctly. > > > > pe 4. toukokuuta 2018 klo 19.51 Mikko <mikkovillemero...@gmail.com> > kirjoitti: > > Hi, > > > >

Django-admin problem

2018-05-04 Thread Mikko
Hi, I'm trying to follow the tutorial, but I got this problem at the very beginning when I tried ''django-admin startproject mysite'': django-admin : The term 'django-admin' is not recognized as the name of a cmdlet, function, script file, or operable pr ogram. Check the spelling of the name,

HTML

2007-10-29 Thread Mikko Hellsing
As I am a fan and user of html strict doctype i would like to see some option to make forms and other helpers generate html rather than xhtml. Has this been up for discussion before? There are still many good reasons to use html rather than xhtml so please dom't say something like "well, every

i18n, .PO files and string substitution

2006-12-19 Thread Mikko Ohtamaa
is django.templatags.i18n.BlockTranslateNode.render if someone wants to poke the source. # Standard Python substitution below result = translation.gettext(singular) % context -- Mikko Ohtamaa Consultant Red Innovation http://www.redinnovation.com --~--~-~--~~~---~--~~ You received this message

Re: Initial data for models splitted across multiple files

2006-11-30 Thread Mikko Suniala
he recipe seems to be some sort of a hack I guess it does not make sense to file a bug just because something does not work as expected when the recipe is applied. However, I added a note to the recipe. Mikko --~--~-~--~~~---~--~~ You received this message be

Initial data for models splitted across multiple files

2006-11-29 Thread Mikko Suniala
tigation I found out that the manager application is searching for files with a path like /models/sql/.sql rather than /sql/.sql (as is the case when a single model file (models.py) is used). Is this a bug or is it just me? Mikko --~--~-~--~~~---~--~~ Yo

RE: Scandinavian characters in .po files and timezones

2006-07-30 Thread Mikko Nylén
Thanks for all answers. I was able to fix the problem by starting over with the django.po. May be the problem was that when I did start working with the file, I didn't have set encoding=utf-8 and when I turned it on in the middle, Vim didn't convert the characters to UTF-8. - Mikko Nylén

Scandinavian characters in .po files and timezones

2006-07-30 Thread Mikko Nylén
t;, which would tell the offset from UTC in seconds. However, if there are any better ways to handle this, I'd like to know about them. Thanks, - Mikko Nylén --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django us

RE: Exclusion by a many-to-many field to self

2006-06-29 Thread Mikko Nylén
to manually sort and limit the results.   Hand writing the SQL might work, though, I would need to hand-write the whole query, including other filters, and turn the results manually as Color objects. How exactly would “where/tables clauses in a filter” you mentioned work?   - Mikko Nylén

Exclusion by a many-to-many field to self

2006-06-28 Thread Mikko Nylén
Color.objects.filter(similar_colors__the_color__startswith="..."), as the filter() gives all those objects I don't want to get included. How I can do this? Thanks, - Mikko Nylén --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Googl