Re: Request for inspiration on business system

29 views
Skip to first unread message

Lachlan Musicman

unread,
Nov 20, 2012, 6:21:50 PM11/20/12
to django...@googlegroups.com
On Wed, Nov 21, 2012 at 8:37 AM, Peter Edström <edst...@gmail.com> wrote:
> Hello,

Hi!

> A company's internal business database system pretty much, and nothing new
> under the sun. Perhaps accompanied by an external website further on.
> Now on to the questions.
>
> Do you think Django would be suitable for this?

Yep!

> Do you have some spontaneous ideas and/or pre-made code snippets that could
> be handy (like a calendar)?

1. Do the tutorial.
2. Set up using virtualenv (for compartmentalising), pip (for
installing) and South (because you will need it as your models
change).
3. djangosnippets.org is a good place to start, and to get ideas.

> How would you structure the project;
> Everything in one app, or how would you split them? One for employee
> interface, one for admin interface (perhaps use the built-in admin system),
> one for external website? Is this bad design?

I would put everything in one app - it's seems small enough that this
will suffice. Too much fragmentation will just cause headaches. I
believe that others will disagree with me on this.

> I would like to design is such that it will be easy to expand, e.g. with
> statistics on hours worked, integration with invoice system, database
> accessible by Android app....... or whatever. But being new to Django I'm
> not really comfortable with basic design principles.
>
> Any input is appreciated and of course I'm reading up in Django Book,
> watching YouTube videos and exploring code as much as I can.

Just get started - that's the best way to learn. The number of times I
got halfway through implementing something and then discovered that
there was already a django goody waiting to make life easier for me
(slugify, get_absolute_url, SortedDict, actions...) - but I had to
know what to ask for first. I think jumping in is especially important
if you are new to Django.

Cheers
L.



>
> Thank you.
> Best regards,
> Peter
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/geK-jXEjDQEJ.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.



--
...we look at the present day through a rear-view mirror. This is
something Marshall McLuhan said back in the Sixties, when the world
was in the grip of authentic-seeming future narratives. He said, “We
look at the present through a rear-view mirror. We march backwards
into the future.”

http://www.warrenellis.com/?p=14314

Issam Outassourt

unread,
Nov 20, 2012, 6:26:01 PM11/20/12
to django...@googlegroups.com
Right,

Hum... I first would like to say that Django is a great framework for web applications, based on Python. Knowing that, what it provides is an API, python API and some specific to Django.

A common way to develop Django apps is to start by modelizing your problem. Here come models, that you should have encountred up to now, which is your database structure.
Design is not the main purpose of Django. Once you've got the data that you received from the user of the app (http request, get/post data, ...), Django tries to understand the user's request through recognizing the url and/or more sent details (see where the urls.py stands ?). The next step is to send (prepare data that has got to be sent)/store the rignt information that the user wants you to process (all right ! I bet these are what they call views). Then it renders templates, which are HTML parsed (that could contain whatever form of javascript or such things) files that integrates a canvas to generate your web page and then send it back to you.
That is the highest level of abstraction in the concepts of Django that I reached so far.

Here you've got how to do the job, in my opinion. That is to say, make models, design urls, prepare your views, create your templates.
During this process, you must be aware of the needs of each part of your application, and as well what each part can pay to do that, its offers.

Giving you precise hints on your models could just ruin your imagination. We make Django do whatever we want, right ? But you are the only one to know what you want to do, or at least, if it's not the case, hurry and find out yourself.
Good luck

Regards,
Issam


2012/11/20 Peter Edström <edst...@gmail.com>
Hello,
A short background:
I'm about to develop a web-based portal for my friend's company that deals with cleaning services of all kind, and I want to try out Django for this. In brief, the portal should consist of a database with data on employees, customers, contracts, work orders... and upon this there should be an interface for administrating everything related, such as adding customers, contracts and so on. There should also be an interface for the employees, for viewing work orders, today's agenda (e.g. go to customer X and do task Y) and register time put into a work order and closing it. In the background, work orders are supposed to be created automatically based on what's agreed upon in a contract (e.g. customer X subscribes on task Y on interval Z which should be handled by employee A).


A company's internal business database system pretty much, and nothing new under the sun. Perhaps accompanied by an external website further on.
Now on to the questions.
  1. Do you think Django would be suitable for this?
  1. Do you have some spontaneous ideas and/or pre-made code snippets that could be handy (like a calendar)?
  1. How would you structure the project;
    • Everything in one app, or how would you split them? One for employee interface, one for admin interface (perhaps use the built-in admin system), one for external website? Is this bad design?
I would like to design is such that it will be easy to expand, e.g. with statistics on hours worked, integration with invoice system, database accessible by Android app....... or whatever. But being new to Django I'm not really comfortable with basic design principles.

Any input is appreciated and of course I'm reading up in Django Book, watching YouTube videos and exploring code as much as I can.

Peter Edström

unread,
Nov 21, 2012, 10:11:31 AM11/21/12
to django...@googlegroups.com
Lachlan Musicman:
You recommend using virtualenv. Why and in what scenarios? If I understand it correctly, virtualenv sets up a virtual python environment galvanically isolated from the rest of the system and I see how this let you go crazy and experiment without risking anything. Is this the main reason why people use it or are there other reasons?

Issam Outassourt:
Thanks for the summary of the major components of Django. I've read about models, views, templates et c and played around with them some, but it's very easy to get stuck on details and forget the big picture. The methodology you describe seems quite simple and straight-forward and I guess it all comes down to what I guess is your (and Lachlan's) point: get busy and learn on the way.


Thank you for the replies.

Javier Guerra Giraldez

unread,
Nov 21, 2012, 10:38:48 AM11/21/12
to django...@googlegroups.com
On Wed, Nov 21, 2012 at 10:11 AM, Peter Edström <edst...@gmail.com> wrote:
> You recommend using virtualenv. Why and in what scenarios?

always.

each and every time i haven't used it, i've regretted it later. it
not only lets you experiment but also in deployment you're guaranteed
a stable environment. Also it makes it quite easy to reproduce the
deployed environment in your desktop long time afterwards, when you've
already forgotten how it was development before the latest and
greatest versions of everything.

--
Javier

Issam Outassourt

unread,
Nov 21, 2012, 12:23:35 PM11/21/12
to django...@googlegroups.com

Well, I do not totally agree with your point.
The problem with virtual environments such as these is that you have trouble sometimes figuring out what actually happens behind the scripts that are used to initialize your environment. Thus comes a natural habit that I personally developed which is to say, whatever external tool that you need a specific version for, get the latter version and install it within a directory that would look like something of this kind /external/django/bin/
And add that directory to your Django project path in your settings.py
This has the advantage to let you know when you deploy your app, which are the real specifics that you need to install back again on your development server.

Did that help ?
Again, it's my personal opinion. Be careful to choose what suits you.

--
Issam Outassourt

--
You received this message because you are subscribed to the Google Groups "Django users" group.

Tom Evans

unread,
Nov 21, 2012, 12:34:18 PM11/21/12
to django...@googlegroups.com
On Wed, Nov 21, 2012 at 5:23 PM, Issam Outassourt
<issamou...@gmail.com> wrote:
> Well, I do not totally agree with your point.
> The problem with virtual environments such as these is that you have trouble
> sometimes figuring out what actually happens behind the scripts that are
> used to initialize your environment. Thus comes a natural habit that I
> personally developed which is to say, whatever external tool that you need a
> specific version for, get the latter version and install it within a
> directory that would look like something of this kind /external/django/bin/
> And add that directory to your Django project path in your settings.py
> This has the advantage to let you know when you deploy your app, which are
> the real specifics that you need to install back again on your development
> server.
>
> Did that help ?
> Again, it's my personal opinion. Be careful to choose what suits you.

virtualenv doesn't actually do any 'magic behind the scenes', it
simply changes your $PATH so that the correct python interpreter is
found, and hence uses the correct 'site-packages' folder inside your
virtualenv.

I personally think manually manipulating sys.path inside your
settings, or inside your wsgi file, is much more troublesome.

Cheers

Tom

Lachlan Musicman

unread,
Nov 21, 2012, 5:21:16 PM11/21/12
to django...@googlegroups.com
On Thursday, November 22, 2012, Peter Edström wrote:
Lachlan Musicman:
You recommend using virtualenv. Why and in what scenarios? If I understand it correctly, virtualenv sets up a virtual python environment galvanically isolated from the rest of the system and I see how this let you go crazy and experiment without risking anything. Is this the main reason why people use it or are there other reasons?

People have already said it, but the stability is definitely a factor. I run Ubuntu, so Django isn't always installed the way I want it to be. Plus, other considerations come into force - I remember at one stage (maybe still) the ppa for the e-reader software calibre had a dependency on django, which would often mean there were two djangos installed - this can be confusing. 

Virtualenv (and virtualenvwrapper) keeps everything tightly contained, and that's handy. Also, once you are using pip inside virtualenv, you have the same advantages - everything you install inside the VE with pip will be contained. 

And to repeat again what others have said, it makes re-deployment a lot easier.

 
Issam Outassourt:
Thanks for the summary of the major components of Django. I've read about models, views, templates et c and played around with them some, but it's very easy to get stuck on details and forget the big picture. The methodology you describe seems quite simple and straight-forward and I guess it all comes down to what I guess is your (and Lachlan's) point: get busy and learn on the way.

Yeah, I read the docs a dozen times before I started - and it didn't help nearly so much as just starting (on a non tutorial project). Note that I still read the docs (they are comprehensive and excellent) daily, depending on needs.  
 
Thank you for the replies.

No hassles - that's what we are here for! 
Reply all
Reply to author
Forward
0 new messages