Questions tagged [django-1.7]

Django 1.7 is the version of the Django framework, released September 2014. Please only use this tag if your question relates specifically to this version.

Django 1.7 depends on Python 2.7 and supports Python 3.4, support for Python 2.6 has been dropped.

Tag questions that address any of these new features:

  • Schema migrations
  • App-loading refactor
  • New method on Field subclasses
  • Calling custom QuerySet methods from the Manager
  • Using a custom manager when traversing reverse relations
  • New Prefetch object for advanced prefetch_related operations
  • Admin shortcuts support time zones
  • Using database cursors as context managers

If the question is not specific targeting features from this release please add . For questions about the new Schema migrations tool, please add .

See the Django 1.7 release notes for more information

394 questions
0
votes
2 answers

upgrade from django 1.4 to 1.7 - url tags error (I think!)

I am trying to upgrade my version of Django from 1.4.6 to 1.7, but I get the following error, which I have no idea how to solve: My tracestack is as follows: C:\Users\user_name\Desktop\project_name\project_name>python ../manage.py…
user1261774
  • 3,525
  • 10
  • 55
  • 103
0
votes
0 answers

Oracle date query in django

This is the SQL I get from Django when making a date query on Oracle (i is an instance of Model.objects): from datetime import datetime as dt dates = [dt(2014,07,01), dt(2014,07,02)] print i.filter(incd_date_d__range=dates).query SELECT…
dmvianna
  • 15,088
  • 18
  • 77
  • 106
0
votes
1 answer

Why do migrations fail on test, but not on migrate?

I'm using Django==1.7, and have four applications: frontend game geo people The apps settings is like this: INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', …
Luis Masuelli
  • 12,079
  • 10
  • 49
  • 87
0
votes
1 answer

django-timezone-field gets error unicode object has no attribute zone

I was not able to do a migration on one of my model objects that use django-timezone-field in django 1.7 I found a solution here: https://github.com/mfogel/django-timezone-field/issues/12 I installed the forked version of django-time-field which…
Atma
  • 29,141
  • 56
  • 198
  • 299
0
votes
1 answer

How not to display a field in form if the boolean field in database is False

I would like not to display a field in form if I have a boolean field in database set to False. Here is my code: class CreateServer(ModelForm): def __init__(self, g, *args, **kwargs): super(CreateServer, self).__init__(*args,…
Zoli
  • 831
  • 1
  • 11
  • 27
0
votes
1 answer

How do I use the same render in 2 separate view functions? (django)

The project_list() view lists all the projects that already exist and gives you the option to add a new one. new_project() handles the creation of that new project then redirects to either the project() view or back to the project_list() including…
pompousPanda
  • 105
  • 2
  • 10
0
votes
1 answer

What is wrong with my custom model field?

I try to implement an image field that you can assign a string to and it will automatically fetch the image from that URL. Reading it afterwards, it will hold the path to the local copy. Therefore, I inherited from Django's ImageField and its…
danijar
  • 32,406
  • 45
  • 166
  • 297
0
votes
2 answers

NoReverseMatch Exception in django named group url

I am new to django and playing with urls and stuck on this problem, I have a view in my views.py which reverse url to a different view def index(request): username = request.session.get('username') if username is None: return…
Dheerendra
  • 1,488
  • 5
  • 19
  • 36
0
votes
0 answers

Link dies on ajax call

Short version: After ajax call, link turns into plain text, but back to link on page refresh. Details: I have a notification system in place (like Stack Overflow and whatnot). The notifications are either in a dropdown subtemplate: …
thumbtackthief
  • 6,093
  • 10
  • 41
  • 87
0
votes
1 answer

django: defining tags/filters/manager actions with less ceremony

To create custom django template tags and filters, as well as to add custom manage.py commands no matter how trivial, the docs tell you to create specific directory structures. I'm working on a pretty tiny project, and it pains me to double the…
salezica
  • 74,081
  • 25
  • 105
  • 166
0
votes
0 answers

django-taggit error in Django-1.7 : 'tags' has an m2m relation with model

I've written a BlogEntry model that I've made in Django-1.7 When I run, /manage.py makemigration, I get the following error. CommandError: One or more models did not validate: blog.blogentry: 'tags' has an m2m relation with model
Anish Shah
  • 7,669
  • 8
  • 29
  • 40
-1
votes
1 answer

Django 1.7 | Comment Form With Blog Post

I working on a blog using Django 1.7. I want to include a comment form with each blog post but unsure how to do that. Here is my code: Models: class Category(models.Model): name = models.CharField(max_length=128, unique=True) slug =…
Muhammad Ahmed
  • 428
  • 2
  • 6
  • 17
-1
votes
2 answers

Error while installing django version 1.7.1 using pip

Obtained the following code through pip install django==1.7.1 Downloading/unpacking django==1.7.1­­ Downloading Django-1.7.1-py2.py3-none-any.whl (7.4MB): 7.4MB downloaded Installing collected packages: django Cleaning up... Exception: Traceback…
Hanson
  • 5
  • 4
-1
votes
4 answers

How do you remove all data after running syncdb?

I'm in production and just ran syncdb but I made a mistake and want to delete what syncdb did, including all data in the tables is fine. Just a fresh start in the databases so I can run syncdb again. (virtualenv-2.7)[root@server mysite]# python…
User
  • 23,729
  • 38
  • 124
  • 207
-1
votes
1 answer

How do you add attributes to Django users and register them publicly?

I've been reading the documentation: https://docs.djangoproject.com/en/1.7/topics/auth/customizing/ I have a fair grasp on the user class that inherits AbstractBaseUser. You simply create additional variables that you want to add and add them to…
User
  • 23,729
  • 38
  • 124
  • 207
1 2 3
26
27