Re: Select random blog post Object from "Post" Model and render In View/Template

2018-01-07 Thread m712
urlpattern. > >My guess is to count() the Post objects, then randomly pick one of the >objects. Then somehow grab the primary key, post_id, and somehow insert >into a urlpattern. Also point to the correct template. Any help >appreciated! m712 -- https://nextchan.org -- https:

Re: New Project Name

2017-08-13 Thread m712
o view this discussion on the web visit >https://groups.google.com/d/msgid/django-users/ed9347f7-7cad-42c8-a0f7-8a2e3b15f3cb%40googlegroups.com. >For more options, visit https://groups.google.com/d/optout. --- :^) --- :^) --- :^) --- :^) --- :^) --- :^) --- :^) --- :^) --- https://blaze.nextchan.org - h

Re: NoReverseMatch at /registration/password/change/

2017-09-20 Thread m712
his 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

Re: HOMEPAGE

2017-09-21 Thread m712
1997bcc%40googlegroups.com. >For more options, visit https://groups.google.com/d/optout. --- :^) --- :^) --- :^) --- :^) --- :^) --- :^) --- :^) --- :^) --- https://nextchan.org - https://gitgud.io/m712/blazechan I am awake between 7AM-12AM UTC, hit me up if something's wrong -- You received thi

Modules Imported Multiple Times

2008-07-14 Thread django-m712
Hi, I'm having a problem where Python modules are being imported multiple times and I cannot figure out why. I have a simple, standard set up created with the following commands: django-admin.py startproject mytest cd mytest manage.py startapp app1 I would like to run some initialization code b

Re: How To style a Django formset for fileField

2017-04-14 Thread m712 - Developer
remove the ambiguity and then recreating my migrations. Apologies for wasting your time! ^^ Best Regards, m712 - Developer -- 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

Re: How To style a Django formset for fileField

2017-04-14 Thread m712 - Developer
Ahaha, apologies again. I am very new to mailing lists and ended up replying to someone who didn't reply to me. Please remove my messages if possible. Sorry! -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and sto

Re: method's name in MIDDLEWARE

2017-04-15 Thread m712 - Developer
You should take a look at https://docs.djangoproject.com/en/1.11/topics/http/middleware/#process-view It is not a reserved keyword but simply a function that is called by the Django middleware system. On Apr 15, 2017 4:47 PM, shahab emami wrote:hello i want to learn MIDDLEWARE in django  . i creat

Re: Dynamic Selector with Django/Jquery

2017-04-15 Thread m712 - Developer
You can create a URL in your application to which your AJAX code will send the details and the amount of items it wants and your application will return the items in JSON format. Take a look at https://docs.djangoproject.com/en/1.11/topics/db/queries/ to learn about how to filter and limit your que

Re: Mysql/Models

2017-04-16 Thread m712 - Developer
On Apr 17, 2017 12:57 AM, alkhair...@mymail.vcu.edu wrote: > > I am not exactly sure how to do this, so any help would be great. The shell is just a Python REPL, you can run any Python code in it. Consider: >>> from yourapp import models >>> models.YourModel.objects.first() >Further, am I missing

Re: Creating multiple objects with one request in Django Rest Framework

2017-04-16 Thread m712 - Developer
Hi, Take a look at https://docs.djangoproject.com/en/1.11/topics/db/examples/many_to_many/ On Apr 17, 2017 8:19 AM, Aamu Padi wrote:I am using Django as the backend server and Vue.js for the front end Movie app.I have a Ticket modelclass MovieTicket(models.Model): show = models.ForeignKey(Show

Re: Django forks

2017-04-17 Thread m712 - Developer
You can always make an extension. Many popular things in the framework are contributions from the community including the current default authentication system. It doesn't have to be in a fork either.On Apr 17, 2017 5:57 PM, Jamesie Pic wrote: > > Dear Andréas, > > During the past decade, I ha

Re: AttributeError: module 'polls.views' has no attribute 'index'

2017-04-19 Thread m712 - Developer
You didn't give us enough info, but I am thinking that you don't have an index() function in your polls/views.py. Start the tutorial from the beginning and follow it closely. On Apr 19, 2017 4:17 PM, Billy Lin wrote:I'm following the getting started tutorial 01 and running into issues after creati

Re: for loop + transaction.on_commit + celery = Unexpected Behaviour

2017-04-24 Thread m712 - Developer
I'm not too familiar with Celery, but I think that for loop continuously keeps changing transaction's commit event handler. Maybe you are looking for something like transaction.commit instead of on_commit? On Apr 24, 2017 2:37 PM, Emilio Jimenez Canalejo wrote:Hi, I've been looking for some time a

Re: Displaying the multiple images in the product detail page

2017-04-25 Thread m712 - Developer
Stop replying over and over again with the same content, we saw it. Regarding your question, I don't know whether you're referring to item[0].image[x] or item[x]. If you're refferring to the first one then please consider renaming your variables. In any case; this:          {% for item in produc

Re: Displaying the multiple images in the product detail page

2017-04-25 Thread m712 - Developer
I forgot a second {% endfor %} below the there, but you get the idea. On Apr 26, 2017 6:29 AM, m712 - Developer wrote:Stop replying over and over again with the same content, we saw it. Regarding your question, I don't know whether you're referring to item[0].image[x] or item[x].

Re: Link to download

2017-05-02 Thread m712 - Developer
You cannot get a file outside of your project unless you symlink it inside the project. This is also a Very Bad Thing(TM) as it may allow attackers to request arbitrary files. What you should do instead is this: 1) Put Data/01/export.txt to the static/ folder inside your app (with the same folde

Re: Unicode error in __unicode__(self) function

2017-05-09 Thread m712 - Developer
On May 9, 2017 11:42 AM, Melvyn Sopacua wrote: > I'm sorry - but this isn't your real error. Your error is in another castle? -- 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, se

Re: Email conformation problem

2017-05-17 Thread m712 - Developer
That's a pretty rude way to reply for someone who is asking questions. Many major email providers mark emails from servers without a PTR record to their domains as "spam". On May 17, 2017 9:52 AM, Ismail Sarenkapic wrote:lol, It is Django related question and can be solved with some of third party

Re: Email conformation problem

2017-05-17 Thread m712 - Developer
ot; on your favorite search engine. Learn to research a little, please. Other than that, try what James suggested. On May 17, 2017 1:12 PM, Ismail Sarenkapic wrote: > > Ok, so how do I solve this problem of fishing content in my mails? > > On Wednesday, May 17, 2017 at 9:56:56

Re: Django not showing updated data

2017-05-18 Thread m712 - Developer
You most likely have a variable as a rest of query that's defined at module level. Something like: records = models.Record.objects.all() def my_view(request):     ... You need to put your variables inside views if you want them fresh every view. Otherwise Django will fetch it when you start th

Re: Please help me

2017-05-29 Thread m712 - Developer
You just made my day. On 05/29/2017 12:52 PM, Opeyemi Gabriel wrote: > Django girls, am a guy > > On May 29, 2017 13:20, "Jani Tiainen" > wrote: > > Hi, > > If you feel that Django tutorial is too compact, Django Girls do > have much more verbose tutorial. >

Re: ModuleNotFoundError: No module named 'models'

2017-05-29 Thread m712 - Developer
How do you expect us to understand your problem if you give us no context at all? For all I know this error could be a file system corruption. On May 30, 2017 2:42 AM, jinghui yang wrote:ModuleNotFoundError: No module named 'models'How to fix this error? -- You received this message because yo

Re: Custom field implementing Boolean Field is having response value as None instead of False

2017-06-19 Thread m712 - Developer
Melvyn was not saying whether you were checking for None. If `value` is i.e. "some string" your to_python method will return `None`. You should do something like this: ```     if value in ('t', ...): return True     elif value in ('f', ...): return False     else: return bool(value) # You can chang

Re: django JsonResponse

2017-06-28 Thread m712 - Developer
You may want to take a look at http://www.django-rest-framework.org/ The error tells you exactly what's wrong: MyModel object is a Model, which is not iterable. You want to serialize the MyModel object, which is possible with Django Rest Framework. I usually advise against using JsonResponse over D