Re: Error when I use python manage.py makemigrations polls

2018-11-01 Thread M Hashmi
Share Installed App snapshot again. Its not showing "polls" in installed apps. On Thu, Nov 1, 2018 at 6:27 PM ALLAN NJOROGE wrote: > Hey, I am a newbie in Django and am trying to learn by following the > official documentation, I am stuck on writing your first code part 2, I > have followed ever

Re: Server Error on deployment to Digitalocean server

2018-08-02 Thread M Hashmi
#x27;sgbackend.SendGridBackend' > > > settings.py > > EMAIL_BACKEND = os.getenv("EMAIL_BACKEND") > SENDGRID_API_KEY = os.getenv("SEND_GRID_API_KEY") > DEFAULT_EMAIL_BCC="" > DEFAULT_EMAIL_FROM = os.getenv("DEFAULT_FROM_EMAIL") > > > On T

Re: Server Error on deployment to Digitalocean server

2018-08-02 Thread M Hashmi
Set your SMTP configurations in settings.py. Make sure to follow wsgi handler properly by adding IP in ALLOWED_HOSTS = ['yourIP']. Make sure you've setup MX records for your domain configuration with DIgitalocean. On Thu, Aug 2, 2018 at 4:42 AM, Azeez Akinsola wrote: > Hello everyone, > > I ne

Re: Sample of GeoDjanco websites

2018-03-19 Thread M Hashmi
I've been searching for one from last couple of weeks and after using Djnago-map-widgets, django-google-maps, django-forms I came to conclusion that no much work done in GeoDjango. All these apps do not work very well with everything GeoDjango has to offer. Only way out for me is that using Google

Re: Where use JSON in Django?

2018-02-13 Thread M Hashmi
JSON is parsing in and out information from JS to Python or Django in your case directly. For instance let's suppose you have a JS script in your template and you need to pass your context variables into JS code as variables. You can jsonify your request/response to get or post data. A good exampl

Re: Django Gunicorn Import Error: no module name wsgi

2017-09-03 Thread M Hashmi
Try: gunicorn --bind ip:port wsgi:application Make sure you run it from the directory where manage.py is located. Regards, M On Sun, Sep 3, 2017 at 9:04 AM, Jonathan Cheng wrote: > I use Python3.5.2 Django1.9 > > I use `python -m venv venv/weather_station` to create virtual evnironment > (/hom

Re: Dynamic Model ID cannot be called

2017-07-26 Thread M Hashmi
Nothing wrong with your function based view. Just try to fill data in DB field. It will work. Because you don't have any record in DB. Try to use 'get_or_create' function. M On Wed, Jul 26, 2017 at 4:50 AM, Shazia Nusrat wrote: > Hi, > > I have a simple model like below: > > class Artists(mode

Re: JS static file is not accessible in Django

2017-01-10 Thread M Hashmi
RIght click on the page when local server is running and click inspect elements. Check if there is any error in console section. If JS is showing file then it means the issue is with the function not with loading file. Send snapshot for further help. On Tue, Jan 10, 2017 at 10:19 PM, wrote: > Ih

Re: Question Is Django Rest Framework only for APIs or can i Use it to create Users for a website?

2017-01-06 Thread M Hashmi
Django RestAPI is a layer that exposes part of your application or your whole website to other platforms for connectivity. Once it is integrated then whatever tasks you've specified for DjangoRestFramwork to carry to another platform will act for everything what that application tend to present. So

Re: finding get_user_model

2017-01-06 Thread M Hashmi
from django.apps.config import get_model On Fri, Jan 6, 2017 at 2:03 AM, roboslone wrote: > Hi! Did you run migrations after adding 'django.contrib.auth' to your > INSTALLED_APPS? > > On 6 Jan 2017, at 07:30, Rasika wrote: > > from django.contrib.auth import get_user_model > why I am not able t

Re: Subclassing Models in non model class

2016-12-28 Thread M Hashmi
Thanks for the reply. I was trying to understand sql level inheritance difference between Proxy based models and abstract models. I got it figured out. Thanks Regards, Mudassar On Wed, Dec 28, 2016 at 4:09 AM, Melvyn Sopacua wrote: > On Tuesday 27 December 2016 05:51:55 M Hashmi wr

Re: Experiences/tips for deploying and supporting on-premise in enterprises?

2016-12-27 Thread M Hashmi
Todd, This is django presenting complete Cloud architecture to end user connected to the core hardware structure at backend. You get registered for example and spin up a VM, so the signals will get your site session connected to the core datacenter implementations to complete the task. I remember

Subclassing Models in non model class

2016-12-27 Thread M Hashmi
Hi All, I created a model Address like a normal practice below. Now I need to create a subclass without using models.Model. But its not letting me do because obviously it won't create tables unless I call models.Model in class parameters. Idea is to create a model and use that model with non db r

Re: installed apps

2016-12-27 Thread M Hashmi
All your files at your system are located in site-packages folder. Whatever you installed even Django itself is located there. In case you need to override any method you need to subclass the original model to alter its behavior. www.djangoproject.com provides to detail documentation about how to w

Re: Experiences/tips for deploying and supporting on-premise in enterprises?

2016-12-27 Thread M Hashmi
I was part of dinCloud hosting provider and they have complete solution built in Python/Django. You can see the website where all the VM's architecture is built using django framework. Its a cloud hosting provider with few enterprise applications provided as Saas and hardware monitoring with NOC Pa

Re: Django Browser issue

2016-12-12 Thread M Hashmi
Browser's has nothing to with DB connection. Can you clear cache on your machine to see if it works? Still if there is issue than send your Apache settings for detailed look on how you have configured it on hosting server. On Mon, Dec 12, 2016 at 1:53 AM, wrote: > Hi, > > I am facing a peculiar

Re: DateTimeField Outside Admin

2016-11-27 Thread M Hashmi
Its simple. In your view in your context dictionary create a variable for date. Import timezone and date = timezone.now(). You can declared "date" like {{ date }} in any of your template and you will get date coming up. On Sun, Nov 27, 2016 at 8:50 AM, Elias Coutinho wrote: > > >

Re: WOrking with checkbox Multiple Select FIeld - Django Admin

2016-10-29 Thread M Hashmi
Form ModelForm if you need to check a single field then you set it as BooleanField in your models.py but if you need to use kind of condition that requires multiple checkboxes to be True. Then its better to define condition in your view like models.py a = models.BooleanField(default=False) b = mod

Re: Django menu and submenus

2016-10-26 Thread M Hashmi
Make sure you've included all the js/css ID/Class selectors in your newly created submenu. Reason might be that old code is rendering something from JS and your code missed it out. You can send code from before and after for better understanding. Regards, Mudassar On Wed, Oct 26, 2016 at 4:24 AM,

Re: Importing contacts from email/social

2016-10-14 Thread M Hashmi
your question, have you tried this: https://github.com/ > mengu/django_contact_importer > > Asad Jibran Ahmed > http://blog.asadjb.com > > On Sat, Oct 15, 2016 at 2:25 AM, M Hashmi wrote: > >> >> I was hoping to find a combine platform where at least variables are sa

Re: Importing contacts from email/social

2016-10-14 Thread M Hashmi
se > sources as well. > > What's your source? > > Asad Jibran Ahmed > http://blog.asadjb.com > > On Fri, Oct 14, 2016 at 7:41 PM, M Hashmi wrote: > >> Hi, >> >> Is there a library available to import user contact's list? >> >

Importing contacts from email/social

2016-10-14 Thread M Hashmi
Hi, Is there a library available to import user contact's list? If you have some piece of code as reference or a lib please guide. Regards, Mudassar -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop recei

Re: Django app crashes with out of memory

2016-10-07 Thread M Hashmi
These are all memory hungry applications. Please provide some detail that how many worker processes initialized by the gunicorn and how do you bind it with Nginx. Nginx configurations also required to see details. Plus use "free -m" to see how much memory you've got allocated to all services. Use "

Re: Advanced search with aggregations

2016-10-05 Thread M Hashmi
Kindly provide some details like what are your models so people can understand what you are trying to do according to the available models. On Wed, Oct 5, 2016 at 8:38 AM, Raffa wrote: > Hi all > I have to create a page where I insert some cascade combobox that fill > dynamically through whic

Re: django form converter to PDF

2016-10-03 Thread M Hashmi
haven't tested the code, but It should work, assuming "app:quote" > resolve to an actual url :) > > [1] http://weasyprint.org/ > [2] http://weasyprint.readthedocs.io/en/latest/tutorial.html#as- > a-python-library > > 2016-10-03 14:05 GMT+02:00 M Hashmi : > >

django form converter to PDF

2016-10-03 Thread M Hashmi
Hi, I need some simple library to convert a simple quote form to PDF. I tried xhtml2pdf and few others but need really simple process to use but creating a fancy pdf. If anyone knows please let me know. Regards, Mudassar -- You received this message because you are subscribed to the Google Gro

Re: nginx configuration to cache all endpoints but one

2016-10-02 Thread M Hashmi
re a .txt version of settings. >> >> For logs, I will send it in PVT! >> >> thank you. >> >> Il giorno domenica 25 settembre 2016 13:40:13 UTC+2, M Hashmi ha scritto: >>> >>> Send me settings of /etc/nginx/nginx.conf and then >>> /etc/sites-

Re: Django not saving form in DB from frontend

2016-09-30 Thread M Hashmi
*Please change* def contact_form(request): template = 'contact.html' if request.method == 'POST': form = ContactForm(request.POST or None, request.Files or None) if form.is_valid(): new_form = form new_form.sav

Re: [Kind Attention Requested] Django Zinnia blog error for entries

2016-09-27 Thread M Hashmi
Try registering django_comments after zinnia in the INSTALLED_APPS setting not before. INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.admin', 'django.contrib.sites', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.content

Re: nginx configuration to cache all endpoints but one

2016-09-25 Thread M Hashmi
there so that is more readable to me and also other people? > > I want to cache all /api location, except /api/search > > In attachment what I tried (I removed from settings things not relevant to > this). > > thank you, > Luigi > > > > > > Il giorno vene

Re: nginx configuration to cache all endpoints but one

2016-09-23 Thread M Hashmi
Create a separate block to exclude certain endpoint above others. You can also try following approach. https://groups.google.com/forum/embed/#!topic/openresty-en/apyaHbqJetU Regrads, Mudassar On Fri, Sep 23, 2016 at 12:26 PM, gg4u wrote: > Hello, > > I want to cache all api endpoints except of

Re: Django Ticketing Application

2016-09-12 Thread M Hashmi
Hello Alexandra, You are at the right forum. But chatting as ticket needs some workout. Each message needs to be contain with all ticketing properties and upon selection of a message it should act as ticket. Now for that simply If you can, start with DjangoSocketIO at https://djangopackages.org/gr

django symlink error for windows

2016-09-03 Thread M Hashmi
How to create a symbolic link in windows for error below using mlink? Please advise. Template error: In template C:\Python27\lib\site-packages\oscar\templates\oscar\dashboard\catalogue\product_row_image.html, error at line 2 'module' object has no attribute 'symlink' 1 : {% load thumbnail %

Re: Filtering models by user or by items

2016-09-01 Thread M Hashmi
What did you get with: products = Product.objects.filter(account=user) As it is inheriting user from get_shopaccount method. Regards, Mudassar On Thu, Sep 1, 2016 at 8:45 AM, Shamaila Moazzam wrote: > am making a shops dashboard view .in that view i have used a mixin as > mentioned belowmy

Re: Pygame

2016-09-01 Thread M Hashmi
Lets divide the answer in two different segments knowledge and information. 1. Information: No you cannot. 2.Knowledge: Every framework works with basic request based structure comprising on requests of GET and POST. When you are interacting with a website from browser all that is working at back

Re: 1.7.9 deployment stubbornly won't create a test database

2016-08-30 Thread M Hashmi
My bad...missed the version in original question. You are right. On Tue, Aug 30, 2016 at 4:59 PM, Andromeda Yelton < andromeda.yel...@gmail.com> wrote: > What are do the relevant parts of your settings file say? In particular, > https://docs.djangoproject.com/en/1.7/topics/testing/overview/#the-

Re: 1.7.9 deployment stubbornly won't create a test database

2016-08-30 Thread M Hashmi
Try this: python manage.py test --keepdb On Mon, Aug 29, 2016 at 3:26 PM, Adam Hirsch wrote: > I've been handed a fairly large and built-up django 1.7.9 installation > with several dozen pre-existing in-house modules and a lot of history. > > For some reason, any attempt to * manage.py test *

Re: help designing a fallback django paralel server

2016-08-30 Thread M Hashmi
Not sure what exactly you want because why would you want your workers to access server on speed of internet when you have them locally connected. However, as far as I understood is that you can have one machine setup as remote with some firewall that will open up ports based on local IP addresses

Re: How to create a database for my website in Django

2016-08-30 Thread M Hashmi
Hi, First of all as far as creation of database is concerned there is comprehensive documentation at djagnoproject.com in tutorial section. Once you've created database then you can use "forms" to get data from the front end to save it in db. Before you go through all this exercise I would suggest

Re: Redis error on initial migration

2016-08-27 Thread M Hashmi
On Sat, Aug 27, 2016 at 2:03 PM, James Schneider wrote: > On Aug 27, 2016 1:49 PM, "M Hashmi" wrote: > > > > Hi, > > I am trying to setup "saleor" e-commerce on windows and getting this > error. > > > > (saleorpro) C:\Users\Mudassar\saleo

Redis error on initial migration

2016-08-27 Thread M Hashmi
Hi, I am trying to setup "saleor" e-commerce on windows and getting this error. (saleorpro) C:\Users\Mudassar\saleorpro\saleor>manage.py makemigrations SystemCheckError: System check identified some issues: CRITICALS: userprofile.User: (auth.C009) .is_anonym ous must be an attribute or property r

Re: Hi. i'm new to django, i have lot of doubts about AD

2016-08-25 Thread M Hashmi
What is your code and what you are trying to achieve? On Thu, Aug 25, 2016 at 5:18 AM, rajeshkmr9583 wrote: > Hi guys, > i'm new to django framework and now my doubt id how to create AD for > login page > > Thanks > > -- > You received this message because you are subscribed to the Google Gr

Re: Django-drip not working

2016-08-20 Thread M Hashmi
to Django 1.8 yet. > > > Le samedi 20 août 2016 09:41:06 UTC-4, M Hashmi a écrit : > >> Now I am getting another error: >> >> Traceback: >> >> File >> "C:\Users\Mudassar\dressikarepo\lib\site-packages\django\core\handlers\base.py"

Re: Django-drip not working

2016-08-20 Thread M Hashmi
in} Regards, Mudassar On Sat, Aug 20, 2016 at 5:52 AM, Tim Graham wrote: > Looks like it could be a bug in django-drip because: > > Model._meta.fields + Model._meta.many_to_many + > Model._meta.get_all_related_objects() > (tuple) + (tuple) + (list) > > A possible fix could be:

Django-drip not working

2016-08-20 Thread M Hashmi
Hi Guys, I am having trouble with Django-drip and couldn't search a solution and hard to figure out. The error pops up when I try to add a Drip. My settings.py has "DRIP_FROM_MAIL" field and EMAIL_HOST field both. I've added django-drip and migrated for django==1.8.13 it worked fine but now stuck

Re: Implementing django auth system with relational models

2016-08-18 Thread M Hashmi
Ludovic, Shouldn't she be using model managers for this? Just curious. Regards, Mudassar On Wed, Aug 17, 2016 at 2:37 PM, ludovic coues wrote: > Ok, sorry, I made a off by one error on the link :) > > Try that: > > # shops/admin.py > from django.contrib import admin > from products.model

Re: Implementing django auth system with relational models

2016-08-17 Thread M Hashmi
So what you are saying is that you don't need to get all the products instead only products uploaded by a particular user? This makes sense because you are getting the whole model called with the key so if I am getting your question right you just need to apply some sort of filter to get user relat

Re: nginx+uwsgi, cache somewhere but I don't know where

2016-08-16 Thread M Hashmi
Reload Nginx and see if still its loading cached query. On Tue, Aug 16, 2016 at 8:18 AM, 술욱 wrote: > Hello > > I'm running (in production) and app that uses raw queries, something like: > > query = """ > select table1.field1, table2.field3 > from table1 left join table2 >on test1.field1 = te

Re: Strange bug with form errors

2016-08-15 Thread M Hashmi
my production version was not exactly the same as my > development one... An upgrade solved the problem. > > Ouf ! I believed I was going to come crazy ! > > Thank's for your answer. > > *Envoyé:* lundi 15 août 2016 à 08:59 > *De:* "M Hashmi" > *À:* djan

Re: how to integrate django framework in android app ????

2016-08-15 Thread M Hashmi
If you need to expose your django application for other platforms then you must be looking for Django RestFramework. Read the docs and you will understand. M On Sun, Aug 14, 2016 at 1:30 AM, ludovic coues wrote: > Could you detail a bit more what you are trying to achieve ? > > What do you mean

Re: Strange bug with form errors

2016-08-15 Thread M Hashmi
Can you paste the full traceback from production server? On Sun, Aug 14, 2016 at 11:53 PM, Nestor Burma wrote: > I have a very strange bug with fom errors. *On my development site, my > code works fine*. But on my production site (apache + mod-wgsi + > posgresql), the form errors I defined in is

Re: How to create Xlm file in specific folder ?

2016-08-10 Thread M Hashmi
I apologize for my message but it reminded me the last question from asad and frustration due to absence of code. Hope Asad will make it a practice and what Ludovic suggested makes sense. Hope it works. On Wednesday, August 10, 2016 at 3:46:32 AM UTC-7, Asad ur Rehman wrote: > > I want to creat

Re: How to create Xlm file in specific folder ?

2016-08-10 Thread M Hashmi
n Wed, Aug 10, 2016 at 4:45 AM, Asad ur Rehman wrote: > M hashmi if someone is not doing question up to the mark you have to guide > him/her. We are here for learning not for criticize each other. > > -- > You received this message because you are subscribed to the Google Groups &g

Re: How to create Xlm file in specific folder ?

2016-08-10 Thread M Hashmi
Dear Asad, Google is trying to build such a technology that can help transmit brain waves connected via neurons to some media such as wifi or wire. Till the time its not a reality...you have to paste your complete code to get help because no one can read your mind without you telling or expla

Re: Launching websites

2016-08-10 Thread M Hashmi
It completely depends on nature of your site or business you intend to manifest virtually. So I would keep it generic and to the point that is required for most of business models. General Checklist: Terms of use Contact page About page Transactional emails setup SMTP setup Google analytics setup

Re: associating save link with button

2016-08-09 Thread M Hashmi
Great Larry. Good luck. On Tue, Aug 9, 2016 at 8:12 AM, Larry Martell wrote: > I figured this out. I just had to add 'download' to the tag: > > class="btn btn-primary" download>Export > > > On Tue, Aug 9, 2016 at 3:04 AM, M Hashmi wrote: > > Ple

Re: associating save link with button

2016-08-09 Thread M Hashmi
Please paste code. On Monday, August 8, 2016 at 12:18:45 PM UTC-7, larry@gmail.com wrote: > > Not really a django question but I'm hoping someone can help me here. > > I have a django app but the html is not displayed in a browser - > render_to_string is called and the html is returned in a

Re: Please Can Some one Help me To get my static files load my default CSS files

2016-08-08 Thread M Hashmi
You will better understand it with following link: https://www.codingforentrepreneurs.com/projects/try-django-18/ Regards, Mudassar On Mon, Aug 8, 2016 at 5:26 AM, Timothy Steele wrote: > M Hashmi > Thanks > For the response it work for me. > I will like you to also give me a

Re: Using non-ASCII app name via Apache server

2016-08-08 Thread M Hashmi
Oh Great! It was great learning for me as well while searching out the solution. Take care Goran, Regards, Mudassar On Mon, Aug 8, 2016 at 9:57 AM, Göran Uddeborg wrote: > For the benefit of anyone following this thread. I've found some > relevant information, even if I don't understand the

Re: Using non-ASCII app name via Apache server

2016-08-08 Thread M Hashmi
p on one of my prototype dressika.com. Can you also try apt-get update/upgrade to get build releases. Regards, Mudassar On Mon, Aug 8, 2016 at 5:52 AM, Göran Uddeborg wrote: > M Hashmi: > > http://stackoverflow.com/questions/728891/correct-way- > to-define-python-source-code-encod

Re: Using non-ASCII app name via Apache server

2016-08-08 Thread M Hashmi
http://stackoverflow.com/questions/728891/correct-way-to-define-python-source-code-encoding On Mon, Aug 8, 2016 at 4:41 AM, M Hashmi wrote: > In traceback the error is in last line. Somehow it is trying to import > something that is returning response as string. > Can you kindly

Re: How o run shell command in Django ?

2016-08-08 Thread M Hashmi
Send your root urls.py code. On Mon, Aug 8, 2016 at 4:42 AM, Asad ur Rehman wrote: > tail -f /var/log/newfies/gunicorn_newfies_dialer.log > > > when i try to find error through this always give no module named urls. > Debug is already = True > > On Monday, August 8, 2016 at 2:33:12 PM UTC+5, Asa

Re: Using non-ASCII app name via Apache server

2016-08-08 Thread M Hashmi
In traceback the error is in last line. Somehow it is trying to import something that is returning response as string. Can you kindly post your installed apps again and root urls.py in project directory. So I can compare urls and app imports side by side. You said you have nothing in your app mode

Re: How o run shell command in Django ?

2016-08-08 Thread M Hashmi
Send error. On Mon, Aug 8, 2016 at 4:14 AM, Asad ur Rehman wrote: > Internal server error is coming.. > > On Monday, August 8, 2016 at 2:33:12 PM UTC+5, Asad ur Rehman wrote: >> >> I want to run *fs_cli -x *command in django . Can anybody help me ? >> How can i create function in django to execu

Re: Using non-ASCII app name via Apache server

2016-08-08 Thread M Hashmi
will struggle to seprate httpd erros from djagno erros. Regards, Mudassar On Mon, Aug 8, 2016 at 4:01 AM, Göran Uddeborg wrote: > M Hashmi: > > Reply me back I am waiting. Apologies if my assumption caused your time. > > No need to apologize! You are trying to help me. I'm gr

Re: How o run shell command in Django ?

2016-08-08 Thread M Hashmi
Install sh with pip. http://amoffat.github.io/ On Mon, Aug 8, 2016 at 3:54 AM, Asad ur Rehman wrote: > from sh import fs_cli > this is also not working ... > > > > > On Monday, August 8, 2016 at 2:33:12 PM UTC+5, Asad ur Rehman wrote: >> >> I want to run *fs_cli -x *command in django . Can anyb

Re: Please Can Some one Help me To get my static files load my default CSS files

2016-08-08 Thread M Hashmi
You need to set your static in settings.py and I am giving you simplest idea you can implement with no issues. STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static', 'static-only') MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'static', 'media') STATICFILES_DIRS = [

Re: Using non-ASCII app name via Apache server

2016-08-08 Thread M Hashmi
gards, Mudassar On Mon, Aug 8, 2016 at 2:24 AM, Göran Uddeborg wrote: > M Hashmi: > > List down your "civ.apps.CivConfig" also restart Gunicorn, and reload > Nginx. > > I'm not sure exactly what you mean by "list down". Do you want me to > comment

Re: How o run shell command in Django ?

2016-08-08 Thread M Hashmi
There are better ways to cut short your time to execute or even schedule tasks or commands. It won't take you more than an hour to understand Django-celery for scheduling tasks. You need to create a bash script and it should include all the steps in case you need virtualenv loaded while command ru

Re: Please Can Some one Help me To get my static files load my default CSS files

2016-08-07 Thread M Hashmi
In your settings.py how did you setup your STATIC_URL and STATIC_FILEDIRS? Copy paste your settings.py code below STATIC_URL with your DB engine settings. DB looks working fine because your page is showing up so we can use same BASE_DIR conventions for setting up your static. On Sunday, August 7

Re: Using non-ASCII app name via Apache server

2016-08-07 Thread M Hashmi
List down your "civ.apps.CivConfig" also restart Gunicorn, and reload Nginx. On Sunday, August 7, 2016 at 4:59:40 PM UTC-7, Göran Uddeborg wrote: > > I'm new to Django, so this is probably some kind of beginner's mistake. > > Django is set up to run via Apache and WSGI. It uses Python 3. The f

Re: OperationalError at /checkout/ table orders_order has no column named order_id

2016-08-07 Thread M Hashmi
tions there will be one or two fields not getting added in new db. I am using sqlite3 as database in dev. My problem is solved though. Regards, Mudassar On Sunday, August 7, 2016 at 5:55:13 AM UTC-7, M Hashmi wrote: > > *I have two apps "orders" and "carts". In my mod

OperationalError at /checkout/ table orders_order has no column named order_id

2016-08-07 Thread M Hashmi
*I have two apps "orders" and "carts". In my models for carts I got:* class CartItem(models.Model): cart = models.ForeignKey("Cart") item = models.ForeignKey(Variation) quantity = models.PositiveIntegerField(default=1) line_item_total = models.DecimalField(max_digits=10, decimal_pl

Re: Trying to set up a website using Django but something went wrong

2016-08-06 Thread M Hashmi
1. Type "python" in your terminal and if it open ups Python interpreter that means path is setup for Python. 2. If confirmed that Python is installed you might want to install setuptools. 3. With setuptools a small app "pip" which is programmed to bring packages upon request from pypi or Djangopr

Re: QuerySet for related models

2016-08-05 Thread M Hashmi
simple and rapid. Regards, Mudassar On Fri, Aug 5, 2016 at 10:23 AM, M Hashmi wrote: > Todor, > > You have access to my complete repo but still I will post answer here for > others to learn. > > Regards, > Mudassar > > On Fri, Aug 5, 2016 at 6:06 AM, Todor Velichkov &l

Re: QuerySet for related models

2016-08-05 Thread M Hashmi
t; On Friday, August 5, 2016 at 2:20:25 PM UTC+3, M Hashmi wrote: >> >> 1.8.13 as its LTS. >> >> On Fri, Aug 5, 2016 at 3:54 AM, Todor Velichkov >> wrote: >> >>> Whats your Django version? >>> >>> On Friday, August 5, 2016 at 1:42:48 PM U

Re: QuerySet for related models

2016-08-05 Thread M Hashmi
1.8.13 as its LTS. On Fri, Aug 5, 2016 at 3:54 AM, Todor Velichkov wrote: > Whats your Django version? > > On Friday, August 5, 2016 at 1:42:48 PM UTC+3, M Hashmi wrote: >> >> I did the same thing while working with the contenttype except I did used >> default filt

Re: QuerySet for related models

2016-08-05 Thread M Hashmi
umber of hits for a product for some period of > range (lets say a week). Then we need to use the `Hit` model. > > top_products_by_last_week_hits = Product.objects.filter( > hitcounts__hit__created__gte=today-timedelta(days=7) > ).annotate( > last_week_hits=Count('hitcounts__

Re: QuerySet for related models

2016-08-04 Thread M Hashmi
the error. I also changed it like: trending_products = list(Product.objects.aggregate(hit=Max('hits__hits'))) It didn't work. Thanks again. On Thursday, August 4, 2016 at 10:44:02 PM UTC-7, Constantine Covtushenko wrote: > > Hi M Hashmi, > > I believe that you ar

Re: QuerySet for related models

2016-08-04 Thread M Hashmi
> for a Reverse Generic Relation > <https://docs.djangoproject.com/ja/1.9/ref/contrib/contenttypes/#reverse-generic-relations> > > class in order to get the Hits for a product. > > On Thursday, August 4, 2016 at 10:42:58 PM UTC+3, M Hashmi wrote: >> >> My field h

Re: QuerySet for related models

2016-08-04 Thread M Hashmi
x hits as I used annotate method with Max as well. Also did count for hits. Any suggestions on this now. Thank you for your response. On Thursday, August 4, 2016 at 2:10:48 PM UTC-7, Constantine Covtushenko wrote: > > Please check my notes below: > > On Thu, Aug 4, 2016 at 10:42 PM,

Re: QuerySet for related models

2016-08-04 Thread M Hashmi
ts for a product. > > On Thursday, August 4, 2016 at 10:42:58 PM UTC+3, M Hashmi wrote: >> >> My field hits=models.ForeignKey(Hitcount) means that my Product model has >> a related model with multiple fields and all the products in Product model >> will have one or mo

Re: QuerySet for related models

2016-08-04 Thread M Hashmi
My field hits=models.ForeignKey(Hitcount) means that my Product model has a related model with multiple fields and all the products in Product model will have one or more hit records. Instance of Product model will save a hit from end user by session/ip/user etc. -- You received this message

QuerySet for related models

2016-08-04 Thread M Hashmi
I know that count only can be applied for an IntegerField or FloatField but I've created a ForeignKey to another model which contains hitcounts. Now I need to filter results by max count from related model and I couldn't dot it. models.py: class Product(models.Model): title = models.Ch

How to set Callback URL for facebook OAuth

2016-07-10 Thread M Hashmi
I am trying to implement django-allauth on local server. I need help to figure out how to set callback url for FaceBook Auth. Regards, Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving em

Re: IntegrityError column email is not unique

2016-07-02 Thread M Hashmi
@James As per my understanding I did following. Now it is not adding email if it exists but also its not giving me any error. class GuestCheckoutForm(forms.Form): email = forms.EmailField() email2 = forms.EmailField(label='Verify Email') def clean_email(self): email = self.c

Re: IntegrityError column email is not unique

2016-07-02 Thread M Hashmi
@James As per my understanding I did following. Now it is not adding email if it exists but also its not giving me any error. class GuestCheckoutForm(forms.Form): email = forms.EmailField() email2 = forms.EmailField(label='Verify Email') def clean_email(self): email = self.c

Re: IntegrityError column email is not unique

2016-07-02 Thread M Hashmi
Thanks james for your kind response. Intention is to set a single identifier for guest user account email. If that email exists then user can login or if doesn't he will have to get registered. However let me implement your suggested code and I will respond you back. Thanks again -- You receiv

IntegrityError column email is not unique

2016-07-02 Thread M Hashmi
I am working on my Checkout view with regular/guest user but getting hard time to come around the integrity error. Idea is to let guest users register with email only to checkout and I need to set the user email unique. models.py *from django.conf import settings from django.db import models

Re: sub accounts in django

2016-05-19 Thread M Hashmi
Can you explain one of those approaches or provide a web reference with complete A to Z implementaiton? On Thursday, May 19, 2016 at 2:19:04 AM UTC-7, Javier Guerra wrote: > > On 18 May 2016 at 17:02, Mehdy M. Haghy > > wrote: > > Creating sub accounts is a pretty common scenario. > > you have

elasticsearch for django with haystack

2016-05-19 Thread M Hashmi
My code is similar to like this if not exactly like in the link provided. But I am not able to search products added via products models. The link is http://stackoverflow.com/questions/37314696/djanog-elasticsearch-implementation-issue?noredirect=1#comment62151898_37314696. In this link user ha

ProgrammingError django_content_type already exists

2016-02-03 Thread M Hashmi
I've been stuck on this issue for a while now. If anyone have concrete solution please let me know. I subscribed for a VPS on DigitalOcean.com Ubuntu with OneClickDjango installation. Pre-loaded installation is 1.6.1 and when I upgrade it I get Programming Error django_content_type already exist