placing views and models in configuration root

27 vues
Accéder directement au premier message non lu

Andreas Bloch

non lue,
28 avr. 2014, 02:27:0528/04/2014
à django...@googlegroups.com
is it bad practice to create a views.py and models.py file and place it in the configuration root? (the folder that is created when you run "startproject <project_name>" which contains the settings, urls, and uwsgi file")

Venkatraman S

non lue,
28 avr. 2014, 02:46:1928/04/2014
à django...@googlegroups.com
On Mon, Apr 28, 2014 at 11:57 AM, Andreas Bloch <abl...@gmail.com> wrote:
is it bad practice to create a views.py and models.py file and place it in the configuration root? (the folder that is created when you run "startproject <project_name>" which contains the settings, urls, and uwsgi file")

An unequivocal 'Yes' :) 


-V

Andreas Bloch

non lue,
28 avr. 2014, 02:54:3228/04/2014
à django...@googlegroups.com
aaaalrighty then - I will create an app then...

Andreas Bloch

non lue,
29 avr. 2014, 02:36:2729/04/2014
à django...@googlegroups.com
so what do you when you're making trivial sites, that don't have any database models, like about-page, landing-page and so on?
would you make a separate app for those and stuff them all in there or just use templateviews and route them from the configuration root urls.py?

Venkatraman S

non lue,
29 avr. 2014, 03:08:3429/04/2014
à django...@googlegroups.com
Use nginx and serve static content . Why use django?

-V


On Tue, Apr 29, 2014 at 12:06 PM, Andreas Bloch <abl...@gmail.com> wrote:
so what do you when you're making trivial sites, that don't have any database models, like about-page, landing-page and so on?
would you make a separate app for those and stuff them all in there or just use templateviews and route them from the configuration root urls.py?

--
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 django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6399b238-222a-42f5-9786-b416e01234fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andreas Bloch

non lue,
29 avr. 2014, 03:11:3129/04/2014
à django...@googlegroups.com
because they are sites in a bigger django project with multiple apps...

Venkatraman S

non lue,
29 avr. 2014, 04:48:3429/04/2014
à django...@googlegroups.com
On Tue, Apr 29, 2014 at 12:41 PM, Andreas Bloch <abl...@gmail.com> wrote:
because they are sites in a bigger django project with multiple apps...

I think you are referring to something like a company website along with a SaaS solution. 
If yes, there are multiple ways could be done. But a quick solution is obviously to do TemplateViews - in which case you are routing purely from your urls.py.
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message