Re: RichTextField widget for django

2009-03-23 Thread Scot Hacker
On Mar 20, 2009, at 7:27 AM, Greg Fuller wrote: > http://code.google.com/p/django-fckconnector/ > http://code.google.com/p/django-tinymce/ See also: http://www.wymeditor.org/ https://trac.wymeditor.org/trac/wiki/Contrib/IntegrateInDjango ./s

Re: Django book mostly done?

2009-03-23 Thread Scot Hacker
On Mar 17, 2009, at 10:51 AM, Alex Gaynor wrote: > Adrian just put the last batch of chapters online, so I believe all > the content is now up. Having skimmed most of it I can say it looks > really good and I'm sure it basically all works, that said it isn't > a final addition so there

Arguments to django_inlines

2009-07-09 Thread Scot Hacker
Having great success with django_inlnes http://github.com/mintchaos/django_inlines/ and am able to pass in and process custom arguments just fine. But can't solve an issue I've hit: If an argument includes any kind of punctuation marks, the inline template fails to render. For example, in: {{

cPanel Python/Django support

2012-04-30 Thread Scot Hacker
For the past couple of years, cPanel (the most widely deployed hosting control panel system) has been taking pulse on user demand for native Django support (similar to their Rails installer). Just saw this note from cPanel devs and thought some folks here might be interested. This is a great

Re: django search query

2013-06-30 Thread Scot Hacker
On Saturday, June 29, 2013 9:32:19 PM UTC-7, Harjot Mann wrote: > > Is there any search query in django which can ignore vowels like I want to > make a query which displays all the clients name who writes their name as > 'amanjit' or 'amanjeet'. > It should take take ee=i or anything like

Strange 404s

2010-10-06 Thread Scot Hacker
We have enabled the option to have 404 requests automatically emailed to admins. It works well, but sometimes we get strange reports like this: Referrer: http://ourdomain.edu/forums/software/ Requested URL: /forums/software/ User agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) IP

wsgi conf ignored after apache restart

2010-10-26 Thread Scot Hacker
We have a consistent mystery on one of our .edu sites I'm hoping someone can help solve. If we restart apache on this shared host, the site reverts to a very old, non-Django version of itself. That is, an antique PHP-based version of the site is served up, and the design changes to one

Re: OT: getting strange attempted gets

2010-11-15 Thread Scot Hacker
On Nov 14, 11:25 am, Federico Capoano wrote: > No one is attacking your server, that's just the django server telling > you what's going on in your app (when you perform any action the > server logs it). Right, but he said he's seeing requests that *can't* be explained

Re: django tagging app choices

2010-11-16 Thread Scot Hacker
On Nov 15, 8:55 pm, Thomas Schreiber wrote: > check the grids on django packages:http://djangopackages.com/grids/g/tagging/ django-taggit seems to be the new hotness. Unfortunately we've been waiting for months for a conversion script to help us migrate from django-tagging to

Re: OT: getting strange attempted gets

2010-11-16 Thread Scot Hacker
On Nov 15, 8:45 pm, Steve Holden wrote: > > Perhaps he did, but that's no reason to believe him until we know that > his assessment of the situation  is likely to be realistic. Don't forget > that a lot of people who post here aren't particularly experienced and > so may not

Re: User model optional

2010-11-21 Thread Scot Hacker
On Nov 20, 2:55 pm, VB wrote: > If I intend to write my own authentication, can I use my define my own > User model? Or, am I better off naming the model something else? > Why write your own authentication? That wheel's been invented so excellently by django-registration

Re: Django-grappelli issue

2010-05-02 Thread Scot Hacker
On May 1, 10:12 pm, Tran Cao Thai wrote: > I discovered the grappelli app today and just set up it. However, the admin > site doesn't look as good as the screenshot from the site. Here is the > screenshot of my admin page > >

Re: surveys

2010-05-12 Thread Scot Hacker
On May 11, 3:16 pm, HARRY POTTRER wrote: > I have a project that I'm working on that works like this: > > the user enters some points on a map which are then stored in a > database as a LineString object (via geodjango). Along with the > geographic data, the user is given a

Re: RSS Aggregator

2010-05-13 Thread Scot Hacker
On May 12, 11:06 am, beetlecube wrote: > Hello, >  Just wondering if there are alternatives to the feedjack RSS > aggregator that anyone has used. It doesn't have to be "Django-ized" > like feedjack is. > > Just any Python library that you've had good luck with, parsing a

ellipsis is not safe, use ellipsis.__new__()

2010-03-01 Thread Scot Hacker
I've been tracking trunk on 1.2 and recently started getting this error when get_profile() is invoked: TypeError at /item/9/ object.__new__(ellipsis) is not safe, use ellipsis.__new__() Request Method: GET Request URL:http://127.0.0.1:8000/item/9/ Django Version: 1.2 beta 1

Overriding admin Media class

2010-03-23 Thread Scot Hacker
Given an admin media class that sets up a rich text editor, like: class TutorialAdmin(admin.ModelAdmin): fields... class Media: js = ['/paths/...',] I would like the ability to selectively override js. I've added a "use_editor" boolean to the Tutorial model. The question is,

Re: Overriding admin Media class

2010-03-24 Thread Scot Hacker
On Mar 23, 5:32 pm, Paulo Almeida wrote: > I don't have a working sample (never did this), but you may be looking for > something like this: > > class Media: >        js = get_path() > > And in the class where you keep use_editor: > > def get_path(self) > if

Re: Overriding admin Media class

2010-03-24 Thread Scot Hacker
On Mar 24, 12:05 pm, Firat Can Basarir wrote: > Scot you need to learm Python. Do you mean learn *more* Python? Great, I'm always game to learn more! I've taken a Python class and read books and run several Django sites. It's not like I don't know enough Python to be

Re: Overriding admin Media class

2010-03-24 Thread Scot Hacker
On Mar 24, 2:08 pm, Shawn Milochik wrote: > > http://docs.python.org/library/functions.html#staticmethod > > It means that the method is function that, when you run it, doesn't > specifically belong to any particular instance, but to the class itself. > > Shawn Thanks

Re: Overriding admin Media class

2010-04-02 Thread Scot Hacker
Sorry for long delay on this thread. Back at the problem now. On Mar 25, 1:22 am, Sam Lai <samuel@gmail.com> wrote: > On 25 March 2010 09:25, Scot Hacker <shac...@berkeley.edu> wrote: > > > > > > > It sounds like you're saying that the model method is n

Re: Overriding admin Media class

2010-04-02 Thread Scot Hacker
On Apr 2, 3:48 pm, Sam Lai wrote: > > And that should work. You need to make sure you have the right imports > for the various classes. I tend to define my forms in a separate > forms.py but that's up to you. Sam, you're a genius - that worked perfectly. Thanks SO much. I

Styling help_text

2011-01-31 Thread Scot Hacker
This ticket http://code.djangoproject.com/ticket/8426 says that, as of six months ago, model field help_text rendered in forms by {{form.as_p}} gets wrapped in a style-able span. But in Django 1.2.4, {{form.as_p}} still generates unspanned help_text. It also doesn't show up spanned in the docs:

Re: django email client (reusable app) kickstarter

2014-10-13 Thread Scot Hacker
On Monday, October 13, 2014 4:18:52 AM UTC-7, biuro wrote: > > > > perhaps I run out too far in the future and this should be put on a > different database. > what do you think guys? > I think that database independence is a core feature of Django and of virtually every reusable app. Your

Re: New app - architecture

2014-10-19 Thread Scot Hacker
All good advice from Avraham Serour - just a couple of additional comments: On Sunday, October 19, 2014 1:06:55 AM UTC-7, Avraham Serour wrote: > > > > > BE API for web services integrations: TastyPie? (API will have to be > versioned, I would like to have the auto documentation, too) > I like

Re: entering data directly into a postgreSQL database

2014-10-19 Thread Scot Hacker
On Saturday, October 18, 2014 10:05:11 PM UTC-7, Jon Joseph wrote: > > > def __str__(self): > return self.problem_number + '\n' + self.problem_statement > I don't like this idea of sticking a new line into a string representation. Do you really want a new line crammed into every

Re: AUTH_USER_MODEL does not accept sub application

2014-10-27 Thread Scot Hacker
On Monday, October 27, 2014 8:58:36 AM UTC-7, Scot Hacker wrote: > > > add2virtualenv /path/to/custom/apps/directory > > > And when its time to deploy, you'll need to do similar on the server, using an equivalent method in the wsgi definition, e.g.: import os, sys, site sys.

Re: AUTH_USER_MODEL does not accept sub application

2014-10-27 Thread Scot Hacker
On Monday, October 27, 2014 5:44:55 AM UTC-7, Collin Anderson wrote: > > Hi Frankline, > > Like you said, you need to use 'app_label.model_name' for AUTH_USER_MODEL, > instead of 'apps.app_label.model_name'. Django looks at INSTALLED_APPS and > knows to add the "apps" prefix when importing. >

Re: Multiple site package directories for Python and question about apache configuration

2014-11-05 Thread Scot Hacker
You want to establish the path directories in your .wsgi file. Use `addsitedir` to set the path to site-packages and set additional paths with path.append, e.g.: import os, sys, site site.addsitedir('/path/to/site-packages') sys.path.append('/extra/path/1')

ModelMultipleChoiceField forcing required

2014-11-05 Thread Scot Hacker
I'm having a strange issue with a pair of ManyToManyFields, where they're acting like they're required fields in the admin even though they're not. # In models.py instructors = models.ManyToManyField(Instructor, blank=True) students = models.ManyToManyField(Profile, blank=True) I can

Re: ModelMultipleChoiceField forcing required

2014-11-05 Thread Scot Hacker
On Wednesday, November 5, 2014 11:15:47 AM UTC-8, Carl Meyer wrote: > > So because you are manually creating your `instructors` and `students` > fields on the form, the `blank=True` in the model has no effect; you > need to pass `required=False` to your two form fields. > Got it, right you

Re: Django strange behaviour

2014-11-09 Thread Scot Hacker
On Saturday, November 8, 2014 9:07:04 AM UTC-8, monoBOT monoBOT wrote: > > Lists are inmutable > Lists are absolutely mutable in Python - hence the availability of `result.append()`. Perhaps you're thinking of tuples, which are not mutable and have no methods for alteration. ./s

Re: Is django framework feasible for developing online LMS?

2014-11-12 Thread Scot Hacker
On Wednesday, November 12, 2014 7:54:18 AM UTC-8, Tom Evans wrote: > > > There is basically no difference between any web framework in terms of > features, so pick whichever one you want that is in the language you > know or wish to learn. > > Frameworks may all have roughly the same

Re: Is django framework feasible for developing online LMS?

2014-11-12 Thread Scot Hacker
On Wednesday, November 12, 2014 8:11:16 AM UTC-8, Ari Davidow wrote: > > I am curious as to why you would write an LMS from scratch, rather than > use an existing framework--edX uses Django and that code is open-sourced > and available. Other open source possibilities, not relying on Django,

Re: django.contrib.comments depreciated, any good alternatives?

2014-11-21 Thread Scot Hacker
On Thursday, November 20, 2014 10:35:18 PM UTC-8, Code wrote: > > Hi, > > I have been facing a nightmare with django comments app. > > see: https://groups.google.com/forum/#!topic/django-users/7B2umISG-9I > > I found out it has been depreciated and so wanted to know suitable > alternatives.

Re: Multiple levels of user in django application

2014-11-28 Thread Scot Hacker
On Friday, November 28, 2014 3:16:41 AM UTC-8, Anju SB wrote: > > Dear Friends, > > I want to develop a django based GIS web application. In my application > there are different levels of users namely station level user, circle level > user etc. Each user details are provided in different

Re: Multiple levels of user in django application

2014-11-29 Thread Scot Hacker
On Saturday, November 29, 2014 8:49:25 AM UTC-8, Anju SB wrote: > > > Thank your for your reply. Actually I created another model that > aggregates all the values from each group table. but after analyzing I > feel its a worst method and performance is also very low.So model re-design > is

Re: Multiple levels of user in django application

2014-12-01 Thread Scot Hacker
On Monday, December 1, 2014 9:00:51 PM UTC-8, Anju SB wrote: > > Actually I can't change the models of the different user details > (state_data,district_data,dub-division_data,circle_data,station_data) > because these tables are used for other GIS activities. > I need to map user with these

Re: Multiple levels of user in django application

2014-12-02 Thread Scot Hacker
On Tuesday, December 2, 2014 1:53:36 AM UTC-8, Anju SB wrote: > > > We can't modify the 5 user details tables, because the other applications > are associated with that table. It is required to map these table with user > table. But using the foreign key relationship we can only relate to one

Re: Devils advocate question

2014-12-17 Thread Scot Hacker
On Tuesday, December 16, 2014 1:15:57 PM UTC-8, Sayth Renshaw wrote: > > With django what benefit do I get for the extra build time over Drupal or > Rails. I'd strongly contest that statement. Development time might be roughly equivalent to Rails (given equally experienced developers), but

Re: Any actual open project to create a company "social" network using Django?

2014-12-27 Thread Scot Hacker
On Friday, December 26, 2014 8:31:16 AM UTC-8, Fellipe Henrique wrote: > > Hi, > > There's any actual open project to create a company "social" network using > Django? I search on google, and I don't find any project using django (or > even other python framework) only PHP or Ruby... > The

Re: Write Multiple Text Files into a Single CSV File

2014-12-31 Thread Scot Hacker
On Tuesday, December 30, 2014 9:54:10 PM UTC-8, Martin Mirero wrote: > > Hi folks, > > I'm just cutting my teeth on Python/Django and need some assistance on > something I've been grappling with for a few days: > >- I have a bunch of text files on disk that all have the same basic >

Re: passing variables

2015-01-13 Thread Scot Hacker
On Monday, January 12, 2015 at 5:29:08 PM UTC-8, suabiut wrote: > > How to you pass variable from one template to another template? > You haven't provided any information about your problem, but it sounds like you might want to read the docs on template inheritance:

Re: Map Django Model to Legacy multi-join query

2015-01-21 Thread Scot Hacker
On Tuesday, January 20, 2015 at 8:02:57 AM UTC-8, Fred wrote: > > I've got a complex 1000+ table vendor read-only MS SqlServer database and > only have SELECT privileges. I can connect with pymssql no problem. > > Of all these tables, I probably care about 50 or less. > > I cannot create views

Re: How to check appname via Django commands?

2015-01-23 Thread Scot Hacker
On Saturday, January 17, 2015 at 1:38:32 AM UTC-8, Sugita Shinsuke wrote: > > Hi there. > > I use Django 1.6 version. > > The database of Django store the information of application. > So, I know that if I change the hierarchy of the Django project folders, > some trouble occurs. > The

Re: Django for backend and frontend

2015-01-26 Thread Scot Hacker
On Sunday, January 25, 2015 at 4:29:00 AM UTC-8, Xiangyu Wu wrote: > > Hello, > > Shall I use Django for backend and frontend or is it a good idea to use > Angular JS for frontend and Django for backend. What are the advantages and > disadvantages? > Doing this means using Django as basically a

Re: Context processors, am I doing them right?

2015-02-04 Thread Scot Hacker
On Tuesday, February 3, 2015 at 4:56:09 PM UTC-8, Dean De Leo wrote: > > Hi, > I am new to Django and I am still going through the tutorial. I've tried > to set up a context processor for the following scenario, and I would like > to obtain some confirmation if this is a proper solution or I

Re: how to access json data value(s) returned back to django view from 'GET' request to an api

2015-02-06 Thread Scot Hacker
On Thursday, February 5, 2015 at 11:10:32 AM UTC-8, Henry Versemann wrote: > > I have a django view (django v. 1.7 ; python v. 2.7.8) which currently and > successfully sends a request to an api, and receives a good response back. > I'm sending and receiving using the 'requests' library (v.

Re: how to access json data value(s) returned back to django view from 'GET' request to an api

2015-02-06 Thread Scot Hacker
On Friday, February 6, 2015 at 9:39:00 AM UTC-8, Henry Versemann wrote: > > Scot, Thanks for the reply. OK I've gotten down to the point to where I > have my version of your json_data in your code below, but I'm not sure I > understand exactly what your code is doing, after you have the

Re: Login in all pages

2015-02-07 Thread Scot Hacker
On Thursday, February 5, 2015 at 5:35:09 AM UTC-8, Juan Diego Gonzalez wrote: > > Hi, I need to put the django login feature in all pages, I mean, the user > will be able to login in the reserved area of the web from any public page. > > Install django-stronghold or similar.

Tests and read-only database

2015-02-09 Thread Scot Hacker
My project access two databases, one of which is remote and read-only. When running tests, Django wants to create a test_ copy of that db on the remote host, but of course it lacks permission (I lack write access to the entire db host). So I'm blocked from running *any* tests, even ones that

Re: Tests and read-only database

2015-02-10 Thread Scot Hacker
On Tuesday, February 10, 2015 at 12:55:57 AM UTC-8, Avraham Serour wrote: > > you can tell django to use sqlite for tests, it will create an in memory > sqlite > Thanks Avraham. Having a bit of trouble finding specifics on this in the documentation, but this works neatly: if 'test' in

Re: Rewrite (port) project from PHP (Code Igniter) to Django

2015-03-05 Thread Scot Hacker
On Thursday, March 5, 2015 at 4:28:13 AM UTC-8, Alexey Milogradov wrote: > > Hello everyone! > > I would like to collect thoughts, articles, posts, code bases, actually > any shared experience on how to port existing project from PHP to > Python/Django. > The specifics of the process are really

Re: Binding hand written HTML(form) or forms that are not created through djnago forms to django forms validation errors

2015-03-10 Thread Scot Hacker
On Tuesday, March 10, 2015 at 4:10:48 AM UTC-7, Mahesh Thipparthi wrote: > > Hi All, > Kindly help me with following questions. > > Use case is this: > 1. i have created a form manually ( not generated through django forms) > 2. I am calling a Django view function upon submission. > 3.

Re: Is bcc implemented?

2015-04-02 Thread Scot Hacker
> > See > https://docs.djangoproject.com/en/1.7/topics/email/#emailmessage-objects > ./s -- 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, send an email to

Re: Django Admin should really support Twitter Bootsrap

2015-04-16 Thread Scot Hacker
On Monday, April 13, 2015 at 3:16:40 PM UTC-7, Patrick Lemiuex wrote: > > It's about time, the django admin tool should support twitter bootstrap > markups and styling. This is the third django project where I've had to > deal with custom form widgets because the admin tool supports kind of an

Re: Django data to Javascript

2013-10-15 Thread Scot Hacker
On Tuesday, October 15, 2013 8:45:09 AM UTC-7, larry@gmail.com wrote: > > >> > You can embed js anywhere in your template, e.g.: > > {% for shbf in should_have_found_list %} > > my_js_function(shbf); > > {% endfor %} > I think you meant to write:

Re: [ANNOUNCE] Django 1.6 release candidate available

2013-10-23 Thread Scot Hacker
On Tuesday, October 22, 2013 8:08:33 PM UTC-7, James Bennett wrote: > It's almost here! > > Tonight we've issued a release candidate for Django 1.6. Information, > including links to downloads and release notes, is available on the Django > project blog: > >

Re: Can i Use history.js in Django?

2013-12-01 Thread Scot Hacker
On Sunday, December 1, 2013 4:21:33 AM UTC-8, Robert Jonathan Šimon wrote: > > Hello everyone, > I want to use history.js on one page in my website, where there will be a > photo gallery, and I want to know before I will write the code, if it can > be done, and if so is there any problem with

Re: need some explanation

2013-12-05 Thread Scot Hacker
On Wednesday, December 4, 2013 5:27:39 AM UTC-8, Tom Evans wrote: > > On Wed, Dec 4, 2013 at 7:20 AM, Hussain Nagri > > wrote: > > Hello, > > I am new to Django and trying to learn myself. > > My question is that when we create models in model.py then after each > class

Re: django 1.6 + django-allauth facebook authentication error

2013-12-24 Thread Scot Hacker
On Monday, December 23, 2013 11:05:26 PM UTC-8, Nobin Mathew wrote: > > Hi, > > I am writing a django website using django-allauth for facebook > authentication. > > When I sign into facebook(after giving username and passwd) from my local > development server( >

Re: Need some suggestions on picking up the best combination

2015-06-01 Thread Scot Hacker
On Monday, June 1, 2015 at 4:03:46 AM UTC-7, William Dai wrote: > > > > Any comments on above options appreciated. This would help me decide the > right way to go since once we commit, we would need to stick to the > decision for long time. The project is a longterm project and could grow >

Re: Grouping lists in a template

2015-07-13 Thread Scot Hacker
On Sunday, July 12, 2015 at 5:50:11 PM UTC-7, Andrea wrote: > > Hello. I'm new to both django and python. Been trying to figure out how to > group items from a model for hours now. > Check out the `regroup` template tag: https://docs.djangoproject.com/en/1.8/ref/templates/builtins/#regroup

Re: How do I install Python 3 in a virtualenv on a MAC ?

2015-07-17 Thread Scot Hacker
On Thursday, July 16, 2015 at 2:24:10 PM UTC-7, plan9d...@gmail.com wrote: > > I'm new to Django and would like to install Python 3.x in a virtualenv so > I can follow the tutorial given on the Django website. > How do I install Python 3.x (latest version) within a virtualenv on a Mac? >

Re: Name error ,not defined problem

2015-07-19 Thread Scot Hacker
Your URL definition is calling a module that hasn't been imported. At the top of your urls.py, add: from newsletter import views In the URL definition, do: url(r'^$', views.home, name='home'), ./s > > -- You received this message because you are subscribed to the Google Groups "Django

Re: Why should we use Django Rest Framework?

2015-10-03 Thread Scot Hacker
Just a quick tip: Sometimes you need a little JSON endpoint for some feature of your site or project, and a full REST framework like DRF is completely overkill. Django makes this incredibly easy, out of the box: from django.http import JsonResponse def some_view(request): my_dict =

Re: How to create a global management command?

2015-10-28 Thread Scot Hacker
Right - even though a management command must live inside of an app, all of them work "globally" across the project. I often include an app called "base" in my projects for just this purpose - it includes management commands and utility functions that don't belong logically to any other app.

Re: git exclude files

2015-12-12 Thread Scot Hacker
On Saturday, December 12, 2015 at 7:38:21 AM UTC-8, Gary Roach wrote: > > Unfortunately, venv doesn't give me a choice as to where the files are > stored. They are all under the top directory of the same name as the > project but are actually in the same directory as the top level project >

Re: git exclude files

2015-12-13 Thread Scot Hacker
On Sunday, December 13, 2015 at 8:17:15 AM UTC-8, Gary Roach wrote: > > As I mentioned earlier, venv and virtualenv do not work the same. There > may be a way to force venv to put the files in a different place but the > default is to put them in the directory just above the start of the

Re: Structuring an API in a large project

2014-05-02 Thread Scot Hacker
On Thursday, May 1, 2014 8:59:25 AM UTC-7, Cezar Jenkins wrote: > > > As you can guess, the views.py file is pretty big and I want to refactor > this out. Currently I have a few options in front of me, the one I'm > leaning towards is to put an 'api/v1' package into each app and use the api >

Re: Angular and Django

2014-06-22 Thread Scot Hacker
Angular is really wonderful, and I use it with several Django projects. But the two are agnostic about each other. All Angular needs from the back-end is a solid JSON API to work with and a few core back-end features like handling authentication. Modern JS frameworks like Angular, sadly, make

Re: Alternative to django-registration (unmaintaned since September 2013)

2014-07-24 Thread Scot Hacker
On Friday, July 18, 2014 5:31:14 AM UTC-7, Santiago L wrote: > > Hi, > > Some weeks ago I noticed that django-registration is not longer maintained > by > its creator: > I've switched to django-allauth for my Django projects, which does an equally superb job of supporting both social and

Re: school website

2014-08-13 Thread Scot Hacker
On Tuesday, August 12, 2014 6:46:40 AM UTC-7, ngangsia akumbo wrote: > > PLease i have a small question. I just need some guidance > Django is a great choice for school portals/intranets, and can accomplish everything you describe (I've built several of them, but can't make the source

Multidimensional form requirements

2016-04-08 Thread Scot Hacker
I need to build a pretty complex / non-standard form and am looking for advice on the overall architecture. Consider the following models: class UserProfile(User): ... standard set of fields class ProfileExtra(): ForeignKey(UserProfile) extratype (e.g. skill, work experience, website,

Re: Multidimensional form requirements

2016-04-09 Thread Scot Hacker
On Friday, April 8, 2016 at 11:27:01 AM UTC-7, Tundebabzy wrote: > > I don't know if I'm off target but. > > I'm presently work on something like this where I have have to save three > models at a go. One model is a stand alone while the other two have a > foreign key to the stand alone

Re: Comparison of django MTV and MVC architecture

2016-04-17 Thread Scot Hacker
The Django docs have an FAQ on this topic: https://docs.djangoproject.com/en/1.9/faq/general/#django-appears-to-be-a-mvc-framework-but-you-call-the-controller-the-view-and-the-view-the-template-how-come-you-don-t-use-the-standard-names "Where does the “controller” fit in, then? In Django’s case,

Re: How and where should I put a version number in my Django project?

2016-05-03 Thread Scot Hacker
Another approach is to use git commit IDs and/or git tags to track releases, then display that data (and commit date) in a template, only to superusers or some group. I did a little blog post about this recently: http://blog.birdhouse.org/2016/04/22/django_git_template_tag/ ./s -- You

Re: Redirection to SSO using Django

2017-03-09 Thread Scot Hacker
On Wednesday, March 8, 2017 at 5:26:02 AM UTC-8, Arun S wrote: > > Hi, > > My Project, i would want to redirect login page to a SSO page. > and handle redirection in Django. > You didn't mention what SSO service you are using for authentication, but there are existing Django apps for most

Re: Simple Join with no matching primary keys

2017-03-09 Thread Scot Hacker
On Wednesday, March 8, 2017 at 8:39:43 AM UTC-8, aysh...@gmail.com wrote: > > Tables are coming from different sources, for each single datetime value > there is a different url, in order to tie up the single source data it must > live inside its own table. > So why not make them into one

Re: ORM for structured Logs

2017-04-08 Thread Scot Hacker
On Tuesday, April 4, 2017 at 5:18:42 AM UTC-7, guettli wrote: > > In the past I was told: Don't store logs in the database. > For general purposes, I agree with this. Logging is a python standard, logs can be verbose, logrolling solutions are well established (and built in), etc. However, there

Re: Totally Lost on "python manage.py runserver"

2017-04-18 Thread Scot Hacker
`pip install pysqlite2` ? ./s On Friday, April 14, 2017 at 5:07:06 AM UTC-7, Michael Durkin wrote: > > I am at a loss. My Google-Fu seems to be sub-par as I cannot find an > answer to what I'm looking for. > > I am running Ubuntu, using Python 3.6.0 (pyenv handles different Python > versions

Re: Need help in Django User Model customization and authentication

2017-05-14 Thread Scot Hacker
This is a fairly common need in academia, where your users need a different set of profile fields depending on affiliation. And you always end up with edge cases where some people are simultaneously faculty and staff, or even student and faculty, etc. And those "special" people will need to

Django dev job opportunity at California College of Arts

2017-05-17 Thread Scot Hacker
San Francisco Django developers: A great opportunity has opened up at California College of Arts for a full-time Python/Django developer: https://cca.wd5.myworkdayjobs.com/en-US/CCA/job/San-Francisco/Web-Developer_R502257 Full-stack skills desirable. This is a small but excellent team at a

Re: Non-primary auto-incrementing field with Postgres

2017-06-20 Thread Scot Hacker
One strategy might be to: 1) Bring in the data under a different column name ('old_id' ?) 2) In a single migration, drop the default ID column, rename old_id to id, and give it primary_key=True That should preserve your old IDs and set the next auto_increment to the next highest value (and if

Re: setup.py for Django project?

2017-09-11 Thread Scot Hacker
Thanks for the feedback everyone. Good to get some real-world input on non-standard approaches like this. I'm going to try and steer the project away from it. And I agree that manage.py and setup.py are not interchangeable at all - especially since not everything *goes* through manage.py. ./s

setup.py for Django project?

2017-09-06 Thread Scot Hacker
I am accustomed to seeing pip-installable dependencies of a Django project each have their own `setup.py`. I am not accustomed to seeing a Django project *itself* have its own `setup.py`, but I am now working with a project that does just that. The setup does not move the Django project itself

Re: Django and Visual Studio Code

2018-05-01 Thread Scot Hacker
On Monday, April 30, 2018 at 4:38:51 AM UTC-7, Simon Connah wrote: > > I've got most of Visual Studio Code configured for Django development > (I'm trying it out to see if I can ditch PyCharm and save some money) > and almost everything seems OK. > After moving through BBEdit, TextMate,

Re: Adding Junk code to your django project

2018-01-11 Thread Scot Hacker
It is possible (though not common) to distribute the compiled *.pyc files rather than the source *.py files. See the bottom of https://www.smallsurething.com/how-to-obfuscate-python-source-code/ . Back in early days of Django there was a (very expensive) commercially sold content management

Re: How do I make a Django model from a tab-delimited data file?

2018-01-11 Thread Scot Hacker
Another approach is to use postgres' COPY command: https://www.postgresql.org/docs/9.6/static/sql-copy.html which knows how to parse and import tab-delimited files (and is crazy fast). Then, once the table exists, use Django's `inspectdb` management command to generate a Model corresponding to

Re: When to use get_user_model()

2018-02-20 Thread Scot Hacker
It's good future-proofing, in case you ever change the User model in your project. In real life, that's highly unlikely, but where it's *really important* to use get_user_model() is when you are writing reusable apps for distribution. If your app is intended to be dropped into any existing

[ANN]: django-todo 2.0

2018-04-10 Thread Scot Hacker
“django-todo is a *pluggable*, multi-user, multi-group, multi-list todo and ticketing system - a reusable app designed to be dropped into any existing Django project. Users can create tasks for themselves or for others, or create ”assigned tasks” that will be filed into a specific list

Re: [ANN]: django-todo 2.0

2018-04-12 Thread Scot Hacker
On Thursday, April 12, 2018 at 1:47:14 AM UTC-7, Derek wrote: > > Interesting to hear of this. > > Unfortunately we are currently committed to Django 1.11 as it is an LTS, > but if you're planning on keeping this in-sync with all 2.x releases, then > that opens up the option to look at using

Web app dev job at CCA - San Francisco

2018-09-21 Thread Scot Hacker
Great Django job in San Francisco - I've worked with them before and can vouch for the crew and the school - great people, great technology (including the Wagtail CMS). Passing this along: " I have an opening for a web application developer on my team at the California College of the Arts in

Re: Starting a New Project somewhat like multitenant saas appication.

2018-09-26 Thread Scot Hacker
It's a little tough to understand what your actual questions are, but: > the role-based authentication I can do but is there any other better option or thing available? The native Django permissions system is limited to specifying who can see or edit particular models (and even then, is

Re: How can I refresh admin_urls

2019-02-23 Thread Scot Hacker
Django Admin is customizable to an extent, but at a certain point those customizations can cost you more time than they save, and it makes more sense to build your business logic in a standard app/view. Without digging into your code, my spidey sense tells me your app is at that point - stop

Re: How does WSGI work?

2019-03-09 Thread Scot Hacker
Excellent summary - should be posted for posterity on a blog or something. I don't know enough about wsgi internals to add to this, but would have been nice to have this to read the first time I set up a server, back in the day. ./s On Tuesday, February 26, 2019 at 10:26:43 AM UTC-8, Tal

Re: Webinterface for python script

2019-02-07 Thread Scot Hacker
On Wednesday, February 6, 2019 at 1:27:18 AM UTC-8, Eric Pascual wrote: > > Hi Derek, > > but I have never seen anyone refer to it as a "lightweight" project > (before you, that is). > > I didn't meant "Django *is* lightweight" but "Django *can be* > lightweight", implied you configure it

Re: Webinterface for python script

2019-02-05 Thread Scot Hacker
. >> >> I was among these people until my experience and skills in Django reached >> the level where I became aware that it can be stripped down to a very basic >> an lightweight framework if needed, thanks to its modular approach. But >> this came with time  >&g

Re: Webinterface for python script

2019-02-04 Thread Scot Hacker
Make a basic Django view. Place your script in a python module that lives inside your app. Call that module/ function from the Django view. See Django docs and tutorials on how to handle uploaded files. Pass the uploaded file to your module, and handle the return value(s) however you want.

Re: Different types of testing

2019-07-13 Thread Scot Hacker
On Friday, July 12, 2019 at 5:33:38 AM UTC-7, Chandrashekhar Singh wrote: > > Hello Developers, > I am curious to know what are testing methods do we use in django. Does > any has good examples or codes except django documentation.? > thanks > I don't have numbers, but subjectively, it feels

Re: I'm struggling with Django's view directory structure.

2020-01-08 Thread Scot Hacker
That is entirely up to you. The typical scenario is that you have one views module per app in your project, which would live at your `yourapp/views.py`. If your app has lots of views and you want to keep it from getting too large, another common pattern is to have one module per view in a

  1   2   >