I’m not sure I explained myself that well. Our system has two models, Product
and ProductSearch. The Product tables come from third party sources, and can’t
be edited from the front end. Users can setup their own ProductSearches, which
are then used to construct the queryset. So our code actuall
I apologize for the confusion, but I have ended up following Andreson's
advise and used "python manage.py collectstatic"
to generate a directory that I uploaded to my Apache server. That captured
all the files needed for admin, and after I got my httpd.conf file right,
it worked correctly.
I n
On 23/03/2015 9:54 AM, talex wrote:
On second thought maybe using
/python3.3/site-packages/django/contrib/admin/static/admin
directly is not the best practice.
I tried using collectstatic, but then the admin could not find it.
Please comment.
Here is a collectstatic incantation which works fo
On second thought maybe using
/python3.3/site-packages/django/contrib/admin/static/admin
directly is not the best practice.
I tried using collectstatic, but then the admin could not find it.
Please comment.
On Sunday, March 22, 2015 at 3:33:21 PM UTC-7, talex wrote:
>
> All,
>
> Thank you. I
All,
Thank you. I had negeleted to enable file serving on Apache for
../python3.3/site-packages/django/contrib/admin/static/admin
I added the stanza:
Alias /static/admin
../python3.3/site-packages/django/contrib/admin/static/admin
Require all granted
to Apaches's httpd.conf, and no
I think the end of the traceback is pretty telling:
ValueError: Lookup failed for model referenced by field
quedar.LearningGroup.members: quedar.User
You have a LearningGroup model with an attribute called members which is
still referencing the original User model that was removed.
-James
On Mar
Hi,
from the information you provided I can only guess you are migrating away from
a custom user model to the "normal" Django user model. This won't work (out of
the box). And even the way to migrate from the Django user model to a custom
user model is more of a workaround than a solution. Plea
Judging from the makemigrations output, you deleted a model (User) but also
added it as a foreignkey field to another model (Persona), is that what you
wanted?
On Sun, Mar 22, 2015 at 3:16 PM, wrote:
> Hi,
>
> makemigrations works but migrate does not:
>
> [xan@mercuri gargamella]$ python manage
Hi,
makemigrations works but migrate does not:
[xan@mercuri gargamella]$ python manage.py makemigrations
Migrations for 'quedar':
0003_auto_20150322_1813.py:
- Create model Persona
- Delete model User
- Add field user to persona
- Alter field members on dialectgroup
- Alter
I will give you one more complete example:
Custom a User is not easy you need to do many things:
In that link django-docs explain all for you and there is an example with
email field.
https://docs.djangoproject.com/en/1.7/topics/auth/customizing/#a-full-example
My tip is: In the docs there is
You can inheriant of AbstractBaseUser and define your field:
from django.contrib.auth.models import AbstractBaseUser
class MyCustomUser(AbstractBaseUser):
mail = models.EmailField(max_lenght=254)
REQUIRED_FIELDS = ['mail']
# more code
Please sorry about my english, I'm a Brazili
Is it the same if I want to specify email as required field, isn't?
El diumenge, 22 març de 2015 15:55:33 UTC+1, Tim Graham va escriure:
>
> Currently you need to use a custom user model if you want to change the
> username max_length. There's an open ticket to increase the default length
> to 2
Hi
I have been using this patch to get around the short user name (which is 30
characters):
#--
#
# Patch to allow username to exceed the default maximum of 30 characters
#
# http://stackoverflow.com/a/6453368/1228131
#
# No
Currently you need to use a custom user model if you want to change the
username max_length. There's an open ticket to increase the default length
to 254 though: https://code.djangoproject.com/ticket/20846
On Sunday, March 22, 2015 at 10:45:34 AM UTC-4, somen...@gmail.com wrote:
>
> Thanks, Ande
Thanks, Anderson, but can I overwrite the length of User class? How? Sorry
I'm still a newbee? With AbstractUser?
[https://docs.djangoproject.com/en/1.7/topics/auth/customizing/#django.contrib.auth.models.CustomUser]
or Extending user class
[https://docs.djangoproject.com/en/1.7/topics/auth/cu
Em production you need to run the command: python manage.py collectstatic
and you need configure your production serve like "apache" to read the
'static' folder in you root project.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscrib
No, the user class uses 75. You need to change to 254.
models.EmailField(max_lenght=254)
>
>
--
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+unsub
Take a look at your production server log, you may find that your static
files aren't actually being served by your production server. This also
happens when you set debug=False in settings.py. Visit
https://docs.djangoproject.com/en/1.7/howto/static-files/deployment/
to setup static files pro
Hi,
The User class in
https://docs.djangoproject.com/en/1.7/ref/contrib/auth/#django.contrib.auth.models.User
is using EmailField with 254 max_length? I want to follow RFC (See
https://docs.djangoproject.com/en/1.7/ref/models/fields/#emailfield)
Thanks,
--
You received this message because
Greetings,
I want to have the thumnails of images with the names in the dropdown field
of form. To return the image as foreign key field, I have used this code :
def __unicode__(self):
image_data =
open("/home/sandy/whats-fresh-api/media/images/download.jpg", "rb").read()
return '%
Hi
I have created an data migration script for populating one of
app db tables with data from a JSON file. First I ran
python manage.py makemigrations --empty TPP_App
(‘TPP_App’ is the name of my app) and then I added a custom
method called populate_db which will use bulk_create to add
mu
21 matches
Mail list logo