Reputation: 937
It is a little oxymoron now that I am making a small Django project that it is hard to decide how to structure such project. Before I will at least will have 10 to 100 apps per project. Now my project is just a website that presents information about a company with no use database, meaning it's really static, with only 10 to 20 pages. Now how do you start, do you create an app for such project.
Upvotes: 1
Views: 473
Reputation: 53669
If you only have static views, you can use the following setup:
urls.py
templates/
folderwsgi.py
You can use a TemplateView
to direct any url to the appropriate (static) template:
from django.views.generic import TemplateView
urlpatterns = [
url(r'^$', TemplateView.as_view(template_name='home.html'), name='home'),
...
]
Then point the ROOT_URLCONF
setting to your urls.py
, and add the templates/
folder to your TEMPLATES
setting. Add any other required settings such as SECRET_KEY
or ALLOWED_HOSTS
, and configure your wsgi.py
.
Upvotes: 3
Reputation: 1142
Frankly I won't use Django in that case, I would use Flask for such small projects. it's easy to learn and setup a small website.
PS: I use Flask in small and large apps!
Upvotes: 1
Reputation: 765
meaning it's really static
Use nginx
to serve static files. Do not use django. You will setup project structure when it will be required.
Upvotes: 3