Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Apr 26th, 2012  |  syntax: Python  |  size: 0.96 KB  |  views: 36  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ----------------
  2. manage.py
  3. ----------------
  4.  
  5. #!/usr/bin/env python
  6. import os
  7. import sys
  8.  
  9. if __name__ == "__main__":
  10.     os.environ.setdefault("DJANGO_SETTINGS_MODULE", "blog.settings")
  11.  
  12.     from django.core.management import execute_from_command_line
  13.  
  14.     execute_from_command_line(sys.argv)
  15.  
  16. -----------------
  17. views.py
  18. -----------------
  19.  
  20. from django.db import models
  21. from django import forms
  22.  
  23.  
  24. class Blog(models.Model):
  25.         title=models.CharField(max_length=22)
  26.         text=models.TextField()
  27.  
  28. class Contact(models.Model):
  29.     subject = models.CharField(max_length=100)
  30.     message = models.CharField(max_length=100)
  31.  
  32.  
  33. class ContactForm(forms.Form):
  34.     subject = forms.CharField(max_length=100)
  35.     message = forms.CharField()
  36.     sender = forms.EmailField()
  37.     cc_myself = forms.BooleanField(required=False)
  38.  
  39. class FileUploadModel(models.Model):
  40.         title = models.CharField(max_length=50)
  41.     uploaded_file = models.FileField(upload_to = 'bose')