Creating a ISP control panel with Django.

149 views
Skip to first unread message

Marc Aymerich

unread,
Dec 29, 2009, 11:11:51 PM12/29/09
to django...@googlegroups.com

Hi everyone,

I just started developing my first web application, I chose Django for this job and I'm so excited with it. It's a control panel with billing system for the ISP which I'm working for. This control panel allows customers and our admins to add domains, email accounts, ftp accounts, databases... and then bill. As it is the first time i'm using django, i'd like to share with you how im thinking to implement it so I can be sure I'm doing fine, respecting django philosophy :).

*I've defined the database model in models.py

*I've created two instances of the AdminSite, (one for admins, another for customers)

*The database can be updated by 3 differents ways:

+Admin panel

+Customer panel

+Synchronization app (to allow sysadmins to do modifications directly on the system without loosing consistence between the database and the system)

*For the admin and the customer panel I want to override the function save_model via /contrib/admin/options.py. I want to call there a function so a resource is created in the system, ex: create_domain(). ¿Is that the best place to call create_domain()?

*The synchronization app is called by cron each 'X' time. via wget http://panel.mydomain.org/app/syncrhonitzation. It looks up for changes and saves them into the database.

*Every time that someone creates a new resource (ex. add domain) I need to log it into "orders" table (to bill customers later). In order to preserve data consistency I think the best way to do this is using the signal django.db.models.signals.pre_save. At this point I have a few questions:

-Is using this signal is the best way? If this signal fail (don't insert a row in orders table), is the default behaviour cancelling obj.save() function? or domain is saved anyway in the database? If that's the case,can the function that calls obj.save() know that the signal has failed?

I appreciate any kind of comment!

thank you a lot for reading until here!

Marc 

Waqqas Jabbar

unread,
Dec 29, 2009, 11:40:43 PM12/29/09
to django...@googlegroups.com
The main idea in django is to reuse apps. Define the functionality that you want and search for it.
It is likely that you will find a lot of applications that you can use to speed up ur development.

As an example of using a lot of application, check out http://pinaxproject.com/


--

You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Larrik Jaerico

unread,
Dec 30, 2009, 9:03:43 AM12/30/09
to Django users
I would forget the signals, and override your model's save() function
instead. That should give you all of the functionality you are asking
for, and be much less of a headache.

On Dec 29, 11:11 pm, Marc Aymerich <glicer...@gmail.com> wrote:
> Hi everyone,
>
> I just started developing my first web application, I chose Django for this
> job and I'm so excited with it. It's a control panel with billing
> system for the ISP which I'm working for. This control
> panel allows customers and our admins to add domains, email accounts, ftp
> accounts, databases... and then bill. As it is the first time i'm using
> django, i'd like to share with you how im thinking to implement it so I can
> be sure I'm doing fine, respecting django philosophy :).
>
> *I've defined the database model in models.py
>
> *I've created two instances of the AdminSite, (one for admins, another for
> customers)
>
> *The database can be updated by 3 differents ways:
>
> +Admin panel
>
> +Customer panel
>
> +Synchronization app (to allow sysadmins to do modifications directly on the
> system without loosing consistence between the database and the system)
>
> *For the admin and the customer panel I want to override the function
> save_model via /contrib/admin/options.py. I want to call there a function so
> a resource is created in the system, ex: create_domain(). ¿Is that the best
> place to call create_domain()?
>

> *The synchronization app is called by cron each 'X' time. via wgethttp://panel.mydomain.org/app/<http://panel.mydomain.org/app/syncrhonitzation>
> syncrhon <http://panel.mydomain.org/app/syncrhonitzation>itzation<http://panel.mydomain.org/app/syncrhonitzation>.

Reply all
Reply to author
Forward
0 new messages