spiningup / BigVASP

A collaborative Mozilla science project to build a materials science database for calculation results using simulation package VASP
4 stars 8 forks source link

Django project layout #7

Open acbalingit opened 9 years ago

acbalingit commented 9 years ago

I'm proposing that the directories be restructured so that the apps would be consistent and portable. Instead of the top-directory containing the project files and the sample data, the top level should already already contain the apps:

* README.md
* manage.py
* BigVASP/              ## from myproject
  -- settings.py
  -- urls.py
  -- wsgi.py
  -- templates/
       -- base.html
       -- index.htm
  -- static/                 ## static assets for the frontend (css/js/img)
* vasp_handler/       ## the parser as a separate app, containing pages that uploads data
  -- urls.py
  -- forms.py
  -- models.py
  -- views.py
  -- extract_vasp.py
  -- templates/
* userauth               ## login pages
  -- models.py
  -- views.py
  -- urls.py
  -- templates/
      -- login.html
      -- user.html
      -- admin.html
* tests/
  -- sample_data/

I'll make a pull request that incorporates this and see if all agrees with how the files would be arranged.


Jeff Knupp, Starting a Django 1.6 Project the Right Way

andres-root commented 9 years ago

I like that structure. Much better than the current version.

andres-root commented 9 years ago

I have some things ready in my side, like user authentication and some of the parser. I have a question, why no to use one single directory for the templates and static instead one inside each app?

`

andres-root commented 9 years ago

This is the structure I'm using now.

`

acbalingit commented 9 years ago

It's okay to place all the template files in a single folder along with the apps, placing the templates and static files on separate apps is more of a personal preference in making things modular, e.g. if you have an existing authsys app from another app, you could reuse it to a new app by simply dropping the folder into the project carrying together the templates and static files, and it should work almost immediately. I'm totally okay with either.

andres-root commented 9 years ago

gotcha, that's a good one.

andres-root commented 9 years ago

So, I think we should talk and see how we're going to structure the project, I see that both have work done and we need to merge those things, for example I'm using Django 1.7 and I guess you're using django 1.6. Just sent you an email today in order to talk about this.

andres-root commented 9 years ago

I'm almost done here, I'll do the pull request this afternoon.