Re: Images are not displaying

2017-06-16 Thread 'Abraham Varricatt' via Django users
If this is a production deployment, you probably need to run collectstatic and test if static files are being served correctly - more a deployment issue than a django matter. But, if you are testing with 'runserver' on a development system ... without exact knowledge of your folder structure,

Re: User has no dcf_profile : RelatedObjectDoesNotExist

2017-06-16 Thread 'Abraham Varricatt' via Django users
On Friday, June 16, 2017 at 7:06:33 AM UTC-4, Nabil BOUDERBALA wrote: > > After extending an existing user model, I get RelatedObjectDoesNotExist > exception with a value User has no dcf_profile. I seems that dcf_profile > isn't created automatically for each user. > It took me awhile to

Re: uWSGI ModuleNotFoundError Django 1.11

2017-06-02 Thread 'Abraham Varricatt' via Django users
Consider thinking of the problem this way - you are trying to tell uwsgi to run a django project located within a certain directory using a virtualenv located in another directory. What James is asking is, if you have checked that the virtualenv you are using has all the dependencies to run

Re: count from multiple tables in a single query?

2017-05-31 Thread 'Abraham Varricatt' via Django users
regate function. > > If the models are unrelated, then I’m fairly certain that you can only use > separate queries to get your results. > > > > > > *From:* 'Abraham Varricatt' via Django users [mailto: > django...@googlegroups.com ] > *Sent:* Wednesday, May 31, 2017 2:14

count from multiple tables in a single query?

2017-05-31 Thread 'Abraham Varricatt' via Django users
Hello, Is it possible to get the count of entries from multiple tables in a single query call? I'm looking at the official docs on aggregation and I can't find anything. For example assume I have the following 2 tables, class Author(models.Model): name = models.CharField(max_length=100)

Re: ANN: django-admin-tools 0.8.1 released

2017-05-30 Thread 'Abraham Varricatt' via Django users
By chance do you have any screenshots in your documentation? -Abraham V. On Tuesday, May 30, 2017 at 8:39:54 AM UTC-4, izi wrote: > > Hello, > > We are happy to announce the availability of the version 0.8.1 of > django-admin-tools: > https://pypi.python.org/pypi/django-admin-tools/0.8.1 >

Re: Is it possible to swap 1.8 and 1.10/1.11 Admin static files

2017-05-30 Thread 'Abraham Varricatt' via Django users
How ... did you impose our will on this user? ;) I'd like to hear more ... for peaceful research purposes, of course. -Abraham V. On Monday, May 29, 2017 at 9:19:01 PM UTC-4, Mike Dewhirst wrote: > > Cancel this question. We will force the user to comply with our reality. > > Cheers > > Mike

Re: Link to download

2017-05-05 Thread 'Abraham Varricatt' via Django users
That's an interesting project! If I use WhiteNoise as part of a production deploy somewhere, can I skip (or ignore) running 'manage.py collectstatic' ? Yours, Abraham V. On Wednesday, 3 May 2017 15:13:36 UTC-4, Dan Tagg wrote: > > You might want to check out WhiteNoise ( >

Re: about tutorial "app reusable section" issue

2017-05-01 Thread 'Abraham Varricatt' via Django users
Hello Xuanbei, You are most likely getting that erro because you still have 'polls' mentioned inside INSTALLED_APPS within your settings.py file. On a different note, can you link to the tutorial you are following? I don't recall the official django tutorial instructing to install polls via

Re: Filling out a form using a json file

2016-12-12 Thread 'Abraham Varricatt' via Django users
Hello Jochen, On Monday, December 12, 2016 at 9:17:11 AM UTC-5, joche...@gmail.com wrote: > > > for editing Objects, but it seems that those views can only deal with > objects that already are in the database. So is there a more > idiomatic way to solve this or am I stuck with the above

Re: Drawback of delete all migrations file

2016-12-09 Thread 'Abraham Varricatt' via Django users
Hello Sylvain, I think you have two concerns here, On Friday, December 9, 2016 at 1:39:50 PM UTC-5, Sylvain Dégué wrote: > SO im thinking about reset completly my production database and remove all > the migrations to start fresh. I dont have much data in the production > database so its

Package a virtualenv to deploy across multiple systems?

2016-09-21 Thread 'Abraham Varricatt' via Django users
Hello, Do we have any standard/recommended way to distribute the python virtualenv used in a django application across multiple servers? I'm able to write a provisioning script to do the following on a server, (for brevity, this is just a high-overview) * Clone the master branch of my django

Re: Custom Template Tag

2016-09-15 Thread 'Abraham Varricatt' via Django users
The idea of doing a POST request during template rendering seems weird. As others have mentioned - that's not the place for it. But perhaps you issue could be a matter of performing your POST operation on the client side, instead of the django server? In that case, it might be worth

Re: TypeError: view must be a callable or a list/tuple in the case of include(). in urls.py

2016-09-05 Thread 'Abraham Varricatt' via Django users
Not sure what the issue is without more info about the error, but is the regular expression for that view correct? Assuming that you want to divert folks to the root of your site can you try the following? url(r'^/$', views.dashboard, name = 'dashboard') NOTE: if the error still persists, it

Re: Getting Start Django

2016-08-31 Thread 'Abraham Varricatt' via Django users
It's nice that you are on Ubuntu. :) Here is a quick and dirty way to get up to speed, (going to assume you will use python3) # Installing virtualenv globally $ sudo apt-get update $ sudo apt-get install python3-pip $ sudo pip3 install virtualenv Once you have that done, navigate to an empty

Re: Hi, i'm new to django i need some mini project which contain atleast 4 page for go through how it works

2016-08-31 Thread 'Abraham Varricatt' via Django users
This might be silly to ask but - can we assume you've completed the django tutorial? On Monday, 29 August 2016 16:56:33 UTC+5:30, rajeshkmr9583 wrote: > > Hi, > > i'm new to Django i need some mini project which contain at least 4 > page for go through how it works.. > > Thanks > -- You

Re: how to use view function in another function of view in django

2016-06-16 Thread 'Abraham Varricatt' via Django users
I'm going to go out and make a random guess that when you say "use a view inside another view" with respect to the code you posted, you want all calls to index() or list() to render the base view. In that case just use return. i.e. def index(request): return base(request) Yours, Abraham V.

Re: how to set up jenkin's 'GitHub Pull Request Builder Plugin' for django ?

2016-01-09 Thread Abraham Varricatt
.. etc? -Abraham V. On Saturday, January 9, 2016 at 9:34:32 AM UTC+5:30, luisza14 wrote: > > Do you know buildbot ? > > http://buildbot.net/ > > > > El viernes, 8 de enero de 2016, Abraham Varricatt < > abraham@googlemail.com > escribió: > > Hello everyon

Re: how to set up jenkin's 'GitHub Pull Request Builder Plugin' for django ?

2016-01-08 Thread Abraham Varricatt
Hello everyone, I've attained some success in my endeavor and wanted to talk about it (The following events take place over the past few days). The first thing I needed to do was rent out a cheap ubuntu server - I got one from digitalocean. A requirement for jenkins is java. I decided to go

how to set up jenkin's 'GitHub Pull Request Builder Plugin' for django ?

2016-01-05 Thread Abraham Varricatt
Hello everyone, I've got a very simple django project hosted on github ( https://github.com/abrahamvarricatt/TDDwithPython ; yes, it's based on the book ) and I'm trying to figure out how to configure a jenkins CI server to run tests based on pull requests. My end objective is to get a system

Re: Debugging Django with Debug set to False

2016-01-05 Thread Abraham Varricatt
Technically speaking, setting DEBUG=False on a production system does not render it un-debuggable. You can still debug and work with such deployments but expect resistance. An ancient approach to debugging ANY production environment is to liberally sprinkle printf (or the django log equivalent)

Re: There's any framework for "bussiness app (ERP)" built in Django?

2016-01-05 Thread Abraham Varricatt
Would a CMS work? Like, http://www.django-cms.org/en/ or http://mezzanine.jupo.org/ -Abraham V. On Tuesday, 5 January 2016 03:33:00 UTC+5:30, Fellipe Henrique wrote: > > Thanks for all replies.. > > But, I'm looking for a framework, not a finished ERP like Odoo... > > Need to be web, so,

Re: possible to setup old project (different dependencies) as a library ?

2016-01-04 Thread Abraham Varricatt
o one-time > port everything to 1.9 and continue development there. > If codebase is so large that it takes significant time, you can do > one-time port to different branch of your codebase, do the upgrades and > finally backport all new features that are not yet ported over. > > O

possible to setup old project (different dependencies) as a library ?

2016-01-04 Thread Abraham Varricatt
A team I'm working with has its hands full with an old Django 1.4 project (python 2.7). We're thinking of refactoring the code-base and migrating things over to the latest Django 1.9. Thing is, we can't abruptly stop working on the old 1.4 code base. So, an idea was floated - to start a new

Re: how to restrict responses to a single server/domain ?

2016-01-04 Thread Abraham Varricatt
My head is still spinning over the different concerns to be juggled over this issue. But I just wanted to come back and say that I really appreciate the responses. Especially from James - Thanks a lot! :) Things on my mind - * network controls = I can understand how attractive (and simple)

how to restrict responses to a single server/domain ?

2015-12-30 Thread Abraham Varricatt
I'm trying to build something similar to a microservice using Django and can't figure out how to setup the authentication part. When I say 'microservice' I mean, we have a bunch of systems like - example.com , test.com , another.com and another.test.com (a subdomain). I'm going to build a

Re: how to mock REST calls during development?

2015-05-27 Thread Abraham Varricatt
was >> done on the testCase class, the view was written without if DEBUG or >> anything similar >> >> On Mon, May 25, 2015 at 3:33 PM, Abraham Varricatt < >> abraham@googlemail.com > wrote: >> >>> Hello everyone, >>> >>> I'm work

how to mock REST calls during development?

2015-05-25 Thread Abraham Varricatt
Hello everyone, I'm working on a Django application which needs to communicate with a 3rd-party REST API. In production the flow would be like this; 1. end-user browser sends a request to my django server 2. my server makes a remote REST call to 3rd party server 3. 3rd party server

design pattern to handle multiple groups from the same view

2015-05-05 Thread Abraham Varricatt
Hello everyone, I'm working on an e-commerce site. There is a generic version of the site available to the open internet and customized versions available to enterprise users. Now, when I say 'customized', I'm mostly talking about really minor customization's. If the current user belongs to

Re: how to handle race conditions?

2015-02-19 Thread Abraham Varricatt
: > > Hi Abraham, > > On 02/17/2015 10:01 PM, Abraham Varricatt wrote: > > I'm trying to make an app where folks can order X quantity of an item. > > The condition is that the order should only be made if inventory exists. > > Assume that we have stock of Y items.

how to handle race conditions?

2015-02-17 Thread Abraham Varricatt
Hello, I'm trying to make an app where folks can order X quantity of an item. The condition is that the order should only be made if inventory exists. Assume that we have stock of Y items. This means that only if Y >= X should we allow the sale to go through. And once we accept an order, the

Re: subdomains and HOST in settings.py?

2015-02-05 Thread Abraham Varricatt
;> cookies work across subdomains. >> >> >> On Thursday, February 5, 2015 at 4:12:24 AM UTC-8, Abraham Varricatt >> wrote: >>> >>> Hello, >>> >>> I'm trying to implement custom subdomains on a customer site and am >>> having troub

Re: subdomains and HOST in settings.py?

2015-02-05 Thread Abraham Varricatt
ot;ALLOWED_HOSTS", then that one is only a >> whitelist of allowed domains. >> >> Try and describe your problem with more detail, What error are you >> getting? What problem with JQuery are you having? >> >> On Thu, Feb 5, 2015 at 9:48 AM, Abraham Varric

Re: subdomains and HOST in settings.py?

2015-02-05 Thread Abraham Varricatt
Ok, I think I goofed up asking the question here. I noticed that there was a HOST setting defined in the django documentation and assumed it was the same thing, but some more code investigation, reveals otherwise. But I *am* running into a tangential issue. I mentioned that if I set the value

subdomains and HOST in settings.py?

2015-02-05 Thread Abraham Varricatt
Hello, I'm trying to implement custom subdomains on a customer site and am having trouble understanding how the HOST option in settings.py works. The requirement is that if a user logs in, they should see their own username as the subdomain. So for example if we have 3 users - mark, alice and

Re: Authenticate users with both username and email

2015-01-19 Thread Abraham Varricatt
ice). > > TL;DR; Overriding the user forms is probably not enough, you'll need a > custom user and custom authentication backend. > > Not sure if I made the situation better or worse, but HTH... > > Obviously, YMMV, I haven't tried this myself, but I have done a fair bit > of

Re: filter

2015-01-19 Thread Abraham Varricatt
In addition to the other answers, I will suggest that you re-think your view logic - you haven't handled the case where your IF block fails. Remember, Django expects every view function to return a HttpResponse object. Assume that someone's request isn't authorized (yet) or even rejected. What

Re: Authenticate users with both username and email

2015-01-19 Thread Abraham Varricatt
Ignoring the malformed code, will the call to authenticate() even work without username? According to the docs, https://docs.djangoproject.com/en/1.7/topics/auth/default/#django.contrib.auth.authenticate It takes credentials in the form of keyword arguments, for the default > configuration this

Re: do migrations (Django 1.7+) handle production data?

2015-01-14 Thread Abraham Varricatt
7? Slowly discovering django, Abraham V. On Wednesday, January 14, 2015 at 12:56:45 PM UTC+5:30, Russell Keith-Magee wrote: > > > On Wed, Jan 14, 2015 at 3:03 PM, Abraham Varricatt < > abraham@googlemail.com > wrote: > >> Hello everyone, >> >> One

do migrations (Django 1.7+) handle production data?

2015-01-13 Thread Abraham Varricatt
Hello everyone, One of the biggest features introduced in Django 1.7 are migrations. They can broadly be classified into 2 types - * schema migrations * data migrations Schema migrations deal with changes to the database schema. eg - changing max_digits of a DecimalField. Data migrations

Re: CSRF verification failed when I use smart phone

2015-01-08 Thread Abraham Varricatt
Can it be possible that you are rendering a different template (without CSRF) for the mobile version? -Abraham V. On Thursday, January 8, 2015 2:15:21 PM UTC+5:30, Sugita Shinsuke wrote: > > Hello Vijay Khemlani > > Thank you for replying. > But, of cause I appended the tag in my form like

Re: django template auto format tool?

2014-12-17 Thread Abraham Varricatt
mber 13, 2014 9:53:56 PM UTC-5, Abraham Varricatt wrote: >> >> Hello, >> >> Is there any command-line based tool which would let one auto-format >> Django template files? Ideally, the tool should also be used to format >> HTML, CSS and .JS files too. >> >> I'

Re: django template auto format tool?

2014-12-15 Thread Abraham Varricatt
it anyway?!? -Abraham V. On Monday, 15 December 2014 03:24:30 UTC+5:30, somecallitblues wrote: > > PyCharm ide does a great job for all those file types. > On 14/12/2014 2:00 pm, "Abraham Varricatt" <abraham@googlemail.com > > wrote: > >> Hello, >&

django template auto format tool?

2014-12-13 Thread Abraham Varricatt
Hello, Is there any command-line based tool which would let one auto-format Django template files? Ideally, the tool should also be used to format HTML, CSS and .JS files too. I've recently inherited a bad-looking code base and want to clean it up. Have heard of the PEP8 autoformatter, but