Re: Make mobile app from webapp

2019-01-07 Thread Brad Pitcher
The basic formula we've used in the past: 1. Decouple back- and front-end using API 2. Use django-bakery (https://django-bakery.readthedocs.io/en/latest/) to export the needed pages to HTML (requires the use of class-based views, which are actually really awesome) 3. Use Phonegap to wrap these HTML

Re: issue in hosting https://www.pythonanywhere.com

2018-12-25 Thread Brad Pitcher
, Dec 25, 2018 at 7:58 AM Brad Pitcher wrote: > Can you share your wsgi file created on pythonanywhere? > > On Tue, Dec 25, 2018, 1:01 AM Atul Anand >> Hi >> I have activated the venv by below cmd: >> 07:57 ~/simplesocial (master)$ workon djangoVenv >> Please let

Re: issue in hosting https://www.pythonanywhere.com

2018-12-25 Thread Brad Pitcher
>>> <https://help.pythonanywhere.com/pages/Virtualenvs>. You need to *Reload >>> your web app* to activate it; NB - will do nothing if the virtualenv >>> does not exist. >>> >>> /home/crackjeeonline/.virtualenvs/djangoVenv >>> <https://www.pythona

Re: issue in hosting https://www.pythonanywhere.com

2018-12-24 Thread Brad Pitcher
The paths in your logs indicate you aren't using a virtualenv. Find the virtualenv section in the web tab and make sure you specify the path to your virtualenv there. Should be something like /home/[username]/.virtualenvs/djangoVenv On Mon, Dec 24, 2018 at 8:09 AM Atul Anand wrote: > I am using

Re: Alternative to fabric

2014-11-17 Thread Brad Pitcher
I agree Ansible is a good fit for your situation. Since Ansible works from yaml files, you don't have to write any Python 2.x compatible code as you would with Fabric. On Mon Nov 17 2014 at 8:24:24 AM Brian Schott wrote: > Ansible is a good choice. > > Sent from my iPhone > > On Nov 17, 2014, at

Re: Please help: urgent deployment problem with django post office

2014-10-03 Thread Brad Pitcher
If you want to simply disable logging, you could try setting the LOG_LEVEL to 0: POST_OFFICE = { 'LOG_LEVEL': 0 # Don't log anything } On Fri, Oct 3, 2014 at 4:55 AM, Sabine Maennel wrote: > Hello Collins, I need post office for other purposes not for error > logging. > > I worte an issue

Re: 1.6.5 as a zip for download?

2014-05-28 Thread Brad Pitcher
Is this what you're looking for? https://github.com/django/django/archive/1.6.5.zip On Wed, May 28, 2014 at 9:51 AM, Neil Walker wrote: > Hello, > I wish to download 1.6.5 stable zip without using pip and not as a tar/gz > (limitations on software I can use at work), but when I visit the downlo

Re: Centos 6.5 Python 3.3.x Django 1.6 Apache 2.2

2014-05-05 Thread Brad Pitcher
It's just something that was passed down to me from a senior programmer :-) - Brad Pitcher On Mon, May 5, 2014 at 2:45 PM, Guillem Liarte < guillem.lia...@googlemail.com> wrote: > Hello Brad, > > Thanks for the suggestion, I was suspecting something like that. I wil

Re: django 1.6.4 - markup / markdown (for django blog tutorial)

2014-05-05 Thread Brad Pitcher
django.contrib.markup has been deprecated. You could try using the standalone project that is a copy of the same code from django: pip install django_markup_deprecated Then add "markup_deprecated" to your INSTALLED_APPS instead of django.contrib.markup. - Brad Pitcher On

Re: Centos 6.5 Python 3.3.x Django 1.6 Apache 2.2

2014-05-02 Thread Brad Pitcher
=/data/app/guillem-py3-dj17-test/lib64/python3.3/site-packages/ - Brad Pitcher On Fri, May 2, 2014 at 4:11 AM, Guillem Liarte < guillem.lia...@googlemail.com> wrote: > Hello, > > I have looked through the web in several different especialised forums but > I cannot find

Re: Printing things to the server console in Django?

2014-02-21 Thread Brad Pitcher
print("information") - Brad Pitcher On Fri, Feb 21, 2014 at 1:00 PM, wasingej wrote: > Hi guys. I'm pretty new to Django and I'm trying to figure out how I can > print out information to my console that I started my web application on > using "pytho

Re: How do I create a standalone python application that uses the django environment (e.g. the ORM etc...)?

2013-09-17 Thread Brad Pitcher
th.abspath(os.path.dirname(__file__)), '..')) ----- Brad Pitcher On Tue, Sep 17, 2013 at 12:25 AM, DJ-Tom wrote: > > Hi, > > I'm also not sure if the python file is at the correct location. > > This is how the directory structure looks: > > my_

Re: How do I create a standalone python application that uses the django environment (e.g. the ORM etc...)?

2013-09-16 Thread Brad Pitcher
You need to do something like this before import django stuff: import os import sys sys.path.append(os.path.abspath(os.path.dirname(__file__))) os.environ['DJANGO_SETTINGS_MODULE'] = 'web.settings' ----- Brad Pitcher On Mon, Sep 16, 2013 at 8:19 AM, Nigel Legg wrote

Re: SQLite3 database error!!!

2013-04-21 Thread Brad Pitcher
Can you post the rest of the traceback? On Apr 21, 2013 7:06 AM, "Kakar" wrote: > I am in settings.py and using SQLite3. But when i execute manage.py > syncdb, it gives me error: "Value error: Empty module name" I didn't > understood this part. Plz help me guyz. > > -- > You received this message

Re: Possible Basic kwargs question.

2013-04-16 Thread Brad Pitcher
ram1'], etc > > Why even unpack the dictionary? I could just pass the dictionary instead. > > > On Tuesday, April 16, 2013 11:08:42 PM UTC-4, Brad Pitcher wrote: > >> It should be: >> model.method1(**params) >> On Apr 16, 2013 7:49 PM, "jayhalleaux&qu

Re: Possible Basic kwargs question.

2013-04-16 Thread Brad Pitcher
It should be: model.method1(**params) On Apr 16, 2013 7:49 PM, "jayhalleaux" wrote: > Not really a Django question but I'm trying to create a model method that > does not have a fixed set of parameters. > > models.py > Class Model_A(model.Model): > ... > > def method1(self, **kwargs): > > print p

Re: django-social-auth problem with facebook

2013-04-15 Thread Brad Pitcher
In my experience, that particular error always means that the database doesn't match what you have in your models. Try a syncdb and/or check your south migrations to make sure your database is up to date. - Brad Pitcher Software Developer (702)723-8255 On Sun, Apr 14, 2013 at 11:

Re: Suggestion for using distinct on django 1.4+ in your unit tests?

2013-03-06 Thread Brad Pitcher
I believe sqlite supports "distinct" just not "distinct on". I have always managed to find workarounds using "distinct" anywhere I formerly used "distinct on". On Mar 6, 2013 7:01 AM, "Toran Billups" wrote: > I recently upgraded to django 1.4 and found that my "distinct" queries > don't work anym

Re: Upgrade to django 1.5

2013-03-04 Thread Brad Pitcher
It should be safe, just test things out. Also, if you have DEBUG=False you must also include an ALLOWED_HOSTS array, which became required in Django 1.4.4: https://www.djangoproject.com/weblog/2013/feb/19/security/#s-issue-host-header-poisoning It should contain a list of domains used to access th

Re: Why i can't get the debug informations (in case of error) when i run LiveServerTestCase tests?

2013-02-09 Thread Brad Pitcher
Have you tried adding a: import pdb; pdb.set_trace() in the view to debug that way? On Jan 30, 2013 12:31 AM, "Alessandro Pelliciari" wrote: > Thanks for the answer! > > Because i'm developing and integrating some flow (social registration etc) > through tests. > > So, instead of creating every t

Re: Help - No module named models

2013-02-04 Thread Brad Pitcher
On Sun, 2013-02-03 at 10:04 -0800, frocco wrote: > from catalog.models import Category It is probably this line. Maybe there is no __init__.py file in the catalog directory? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from th

Re: newbie needs to copy a record in admin to a new record

2013-01-11 Thread Brad Pitcher
s and copy them. - Brad Pitcher Software Developer (702)723-8255 On Fri, Jan 11, 2013 at 7:06 AM, frocco wrote: > Hello, > > I am just learning django and want to allow a user in admin to copy a > record from the list to create a new record and make changes. > This wi

Re: Email notifications app

2012-11-23 Thread Brad Pitcher
Checkout django drip: https://github.com/zapier/django-drip On Nov 23, 2012 7:22 AM, "Arnaud BRETON" wrote: > Hi everybody, > > I'm looking for a powerful third-app for Django to manage time-driven > email notifications. > > I found django-notifications ( > https://github.com/jtauber/django-notif

Re: selenium test for fallback page loaded from app cache when server is unavailable

2012-11-03 Thread Brad Pitcher
Are you having the selenium test go to online.html first like in your manual test? Maybe you need to have selenium hit offline.html first and cache that page? On Nov 3, 2012 6:14 AM, "Joao Coelho" wrote: > Hi. I haven't been able to figure this one out. Trying to write an > automated test that us

Re: How to reference model instance fields dynamically

2012-10-26 Thread Brad Pitcher
Use setattr's counterpart, getattr :-) getattr(inst, k).add(relatedObject) On Fri, Oct 26, 2012 at 5:16 PM, Chris Pagnutti wrote: > Awesome. Thanks Brad. Now the question is, what if the attribute is a > ManyToManyField. > > e.g. > inst.k.add(relatedObject) > > How to reference k properly if k

Re: How to reference model instance fields dynamically

2012-10-26 Thread Brad Pitcher
You can use python's setattr function to do this: for k,v in fields.iteritems(): setattr(inst, k, v) On Fri, Oct 26, 2012 at 8:37 AM, Chris Pagnutti wrote: > Say I have a model like > class MyModel(models.Model) >name = models.CharField(max_length=100) >number = models.IntegerField()

Re: Best way to detect if a user has changed password

2012-10-24 Thread Brad Pitcher
You could use a "pre_save" signal. kwargs['instance'] will contain the updated record and you can get the old record with "User.objects.get(id= user.id) if user.pk else None". I've done this in the past to check for a changed email address. On Wed, Oct 24, 2012 at 2:23 PM, Roarster wrote: > I'm

Re: static files

2012-10-11 Thread Brad Pitcher
I believe the best way of doing this is to have your image(s) in static/images and your css in static/css. Then you can use a relative URL to set the background image like so: background-image : url("../images/PAE.jpg") It's better not to have any CSS mixed in with your HTML anyway. On Oct 11, 2

Re: Possible spam from mailing list? ("China Mobile")

2012-09-10 Thread Brad Pitcher
Yes, I received a similar email about the post "Re: I can't install django on my mac. I'm not sure wh..." which I recently responded to. Not sure what to make of it. On Mon, Sep 10, 2012 at 12:27 PM, Kurtis wrote: > I just received a very unusual e-mail that included a recent post's > subject. T

Re: I can't install django on my mac. I'm not sure why. Details inside.

2012-09-09 Thread Brad Pitcher
Glad to here you got it working, and please let us know if you have any other questions. On Sun, Sep 9, 2012 at 5:52 PM, Shayan Afridi wrote: > It works! Thank you all so much. It feels great to know that there is a > very responsive and helpful support system for django users. Thanks again! > >

Re: I can't install django on my mac. I'm not sure why. Details inside.

2012-09-09 Thread Brad Pitcher
I can't speak authoritatively on this, since that's not how it installs in Linux, but in my understanding the contents of the django.pth file should be the directory django has been installed to. Check the contents of that file to see if everything is in order. An alternative to this is to update P

Re: I can't install django on my mac. I'm not sure why. Details inside.

2012-09-09 Thread Brad Pitcher
The question is, is django inside one of those directories? It should probably be installed to C:\Python27\lib\site-packages so there would be a C:\Python27\lib\site-packages\django directory. Is it there? On Sun, Sep 9, 2012 at 3:41 PM, Shayan Afridi wrote: > Interesting. I'm doing it on my PC n

Re: File Upload with Progress Bar

2010-06-03 Thread Brad Pitcher
> Sort of, that's what the default is in the demo, but now I've > > noticed I > > > > > > have the same problem with apache progress reporting as I did using > > > > django > > > > > > progress reporting.  It's behaving like it

Re: File Upload with Progress Bar

2010-06-03 Thread Brad Pitcher
x27;t streaming the file upload to django, I'm currently investigating that. On Jun 2, 9:24 pm, Brad Pitcher wrote: > Sort of, that's what the default is in the demo, but now I've noticed I have > the same problem with apache progress reporting as I did using django > progr

Re: File Upload with Progress Bar

2010-06-02 Thread Brad Pitcher
eports until the file has finished uploading. It's actually driving me a bit crazy so I'm going to have to move on to something else for a while. On Wed, Jun 2, 2010 at 9:16 PM, Venkatraman S wrote: > Does this work with the Django development server? > > > On Thu, Jun 3, 2010 at

Re: File Upload with Progress Bar

2010-06-02 Thread Brad Pitcher
Since I just spent much longer than it should have taken figuring this out, I will try and help you out. I followed the instructions at the provided link and it sort of worked. Not quite as well as I liked. I used Apache for the progress reporting, which the author doesn't mention in the article

Re: Setting list_display for InlineModelAdmin

2010-04-21 Thread Brad Pitcher
Thank you for setting me straight. What a dumb mistake. :) On Apr 21, 11:03 am, Daniel Roseman wrote: > On Apr 21, 3:20 pm, Brad  Pitcher wrote: > > > Hi guys, > > This is driving me a little crazy, so I hope someone can offer good > > advice.  I've specified a

Setting list_display for InlineModelAdmin

2010-04-21 Thread Brad Pitcher
Hi guys, This is driving me a little crazy, so I hope someone can offer good advice. I've specified an inline class in my admin.py file, and in it I have specified a subset of the classes attributes with list_display. However, what I set in list_display has no effect on what is rendered for the i