Re: NoReverseMatch at /polls/1/results/

2015-05-08 Thread Muhammad M
HM, Upon a closer look at your code (views.results), you have this: return render(request, 'polls/results.html', {'guestion': question}) You are passing "guestion" (with a G) to the template instead of "question" (with a Q). As such, your template complains when you try to use "question.id"

Re: Questions on project vs app, and how they relate

2015-11-19 Thread Muhammad M
Dear Monte, Don't consider me an expert but here is how you may want to handle this scenario. 1. django-admin.py startproject tournaments Now, cd into the 'tournaments' directory (wherein you have a manage.py file). From that directory you can create as many different apps (actually

Re: Questions on project vs app, and how they relate

2015-11-19 Thread Muhammad M
Hi Monte, You can use a model from one app in another app. So, let's say that in competitors/models.py (where you define the models for your "competitors" app), you have a model class named Participant. This model represents, well, a participant in the tournament. It is likely, as you stated,

Re: Using API to get data and display it on my website using DJANGO..

2016-01-20 Thread Muhammad M
Hi Rij, I would approach it like this (though there might be alternative routes to the same results): First: Where is the data? According to your links, the various API endpoints are in the “results” list of the JSON on http://data.london.gov.uk/api/3/action/package_list

Re: looking for a good tutorial for creating user with fb,tw,google login

2014-07-20 Thread Muhammad M
Bussiere, I have used python-social-auth in one of my projects and it works great. If you are developing a Python-based web app (irrespective of what framework you are using - Django, Flask, etc.), it's the best OAuth package out there, at least in my opinion. It's hard to guess what may be the

Re: Diving into Django 2016

2016-02-09 Thread Muhammad M
Dear Alan, If, as you stated, you haven’t worked in a real development job, it might be a bit of a challenge teaching others how to do the same since you may have limited exposure to the tools of the trade. As for resources, here are a few that may be useful: 1. The Official Django Tutorial:

Re: Django project beginner

2016-12-26 Thread Muhammad M
Dear Imed, Another very useful tutorial that covers a lot of ground about developing django-powered sites is the "TaskBuster Django Tutorial" at http://www.marinamele.com/taskbuster-django-tutorial That site also has other tutorials that are related to other aspects of (django) website

Re: null value in column violates not-null constraint

2017-05-25 Thread Muhammad M
Ismail, You don't seem to be handling the value for Product.slug anywhere, either in the model or the view. You can fix the slug issue by overriding the Product model's save () method like this: def save (self, *args, **kwargs): if not self.slug: self.slug = slugify(self.title)

Re: django filter

2017-08-28 Thread Muhammad M
Hi Sum, Add an "approved" field of type BooleanField ( ) to your Leave model. So, something like this should work: In app/models.py: class Leave (models.Model): #other fields go here... approved = models.BooleanField ( ) In app/views.py, handle the query like this:

Re: django filter

2017-08-29 Thread Muhammad M
n the table. > > Cheers > > On Tue, Aug 29, 2017 at 2:44 PM, sum abiut <suab...@gmail.com > <mailto:suab...@gmail.com>> wrote: > Thanks heaps Muhammad. > Sum > > On Tue, Aug 29, 2017 at 10:13 AM, Muhammad M <mwebbi...@gmail.com > <mailto:mwe