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*
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
='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
/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
= 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
-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
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
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
. 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,
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
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
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
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
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 =
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
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
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
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
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
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
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
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
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
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
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
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
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,
>
>
>
>
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,
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
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
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
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
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
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
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
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
36 matches
Mail list logo