Re: How to deploy migrations to production

2019-04-02 Thread Simon A
Thank you. I'd surely be able to use this when we deploy. But is it really necessary to run collectstatic everytime there is a deployment to perform? I just use this to make the admin page have the correct styling when accessed in production. On Wednesday, April 3, 2019 at 12:55:31 PM UTC+8,

Re: How to deploy migrations to production

2019-04-02 Thread אורי
I think *makemigrations* should never be used in production. You run it locally and then commit the migrations. If it's a new production server you are deploying, I think you can delete all your migrations and then run *makemigrations* (locally) to create only initial migrations. But only if you

Re: Remove username field

2019-04-02 Thread אורי
I think you can define your own User model and then you can define it without username. You can also set the email address for login and also as the username field. Take a look at Speedy Net: https://github.com/speedy-net/speedy-net

Re: Remove username field

2019-04-02 Thread Guru Murthy
Hi Suman khatua, You can remove the username from admin authentication system -- 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

Re: Django module view has no attribute?

2019-04-02 Thread Sithembewena L. Dube
@drone4four I meant the main URLconf, not "maul". Kind regards, Sithembewena *Sent with Shift * On Wed, Apr 3, 2019 at 3:36 AM drone4four wrote: >

Re: Django module view has no attribute?

2019-04-02 Thread Sithembewena L. Dube
There was also a typo in my response, as I wasn't using the aliased imports in the calls to `path`. Also, the single letters were just an illustration (clear variable naming is key). Also, I would not import any app's views in the maul URLconf. This kind of defeats Django's "plug and play"

Re: Django module view has no attribute?

2019-04-02 Thread drone4four
Thank you Lloyd: You are right that my import statements are written inside my urls.py in such away that they override each other, confusing Django. I appreciate your advice, but with all due respect, a slightly more Pythonic approach would be this: “”” from django.contrib import admin

Re: How to deploy migrations to production

2019-04-02 Thread Simon A
Ah I see. Thank you Jani for clearing that up. -- 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+unsubscr...@googlegroups.com. To post to this group,

Re: BaseModelFormSet > _construct_form

2019-04-02 Thread Kevin Jay
ke...@kjay.net On Tue, Apr 2, 2019 at 4:12 PM nikolaysm wrote: > Hello, > > In function _construct_form variable "pk_key" is generated as: > pk_key = "%s-%s" % (self.add_prefix (i), self.model._meta.pk.name) " > > So pk_key is not flexible. Because if I overwrite function "add_prefix" > from

RE: BaseModelFormSet > _construct_form

2019-04-02 Thread Matthew Pava
Why are overwriting add_prefix? Why are you overwriting _construct_form? From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of nikolaysm Sent: Tuesday, April 2, 2019 9:37 AM To: Django users Subject: BaseModelFormSet > _construct_form Hello, In function

Re: Hosting recommendations please

2019-04-02 Thread Sasa Kalaba
*1.) PythonAnywhere* - use for lightweight applications. Extremely easy to setup. *2.) Heroku* - easy to setup, and you can deploy anything up there. Price is also very reasonable. You'll have to get into some of the internal specifics (like dynos and whatnot). *3.) DigitalOcean*

Re: Django module view has no attribute?

2019-04-02 Thread Joel Mathew
Is there a function named posts in views.py? On Tue, 2 Apr, 2019, 7:29 AM drone4four, wrote: > I’m taking a Udemy course by Nick Walter and rather than copying line by > line, I’m trying to branch out and experiment on my own. > > The purpose of the website I am creating is for a small blog,

Using forms to handle request.GET data?

2019-04-02 Thread Carsten Fuchs
Dear Django group, I would like to show users a form that they can use to customize the view, for example a ChoiceField from which the year of the report can be chosen. It seems straightforward to use a forms.Form to handle the request.GET data: from django import forms class

Remove username field

2019-04-02 Thread Soumen Khatua
> > Hi folks, I want to remove username field from django.contrib.auth.User please tell me, how I can do that and also set email address as a username in inbuilt login form??? Thank you. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To

BaseModelFormSet > _construct_form

2019-04-02 Thread nikolaysm
Hello, In function _construct_form variable "pk_key" is generated as: pk_key = "%s-%s" % (self.add_prefix (i), self.model._meta.pk.name) " So pk_key is not flexible. Because if I overwrite function "add_prefix" from class "forms.ModelForm", I get error "MultiValueDictKeyError". My add_prefix

Permit to modify questions displayed by taking previous answers into account

2019-04-02 Thread Muhammed Yaseen Poonawala
The survey that my project creates are simple questions, but I want to add constraints in a sense that when a question A (Are you married?) is asked with options 'married', 'unmarried'. If the answer for question A is 'married' then I should get question B(How many kids do you have?) or if the

how to run jupyter notebook code in django

2019-04-02 Thread zain malik
Hi, I am zain and i am implementing popularity based recommendations system on django. The code of recommendation system is implemented on Jupyter notebook and it is using *pandas dataframes and some numPy* *functions*. Now i am confused about how to run that code in my django Product model

Django inbuilt server

2019-04-02 Thread primeshs . 17
Hello, I'm a new django user. Can someone please tell me what is the name of django inbuilt server is? I went throughout the internet but I couldn't find a proper answer. Regards. -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Static image not getting displayed.

2019-04-02 Thread Chetan Ganji
{% load static %} in the first link of your template. You have below code The line should be Regards, Chetan Ganji +91-900-483-4183 ganji.che...@gmail.com http://ryucoder.in On Wed, Apr 3, 2019 at 1:13 AM Ing.Daniel Bojorge wrote: > See the development tools and look what path is it? > >

Re: Static image not getting displayed.

2019-04-02 Thread Ing.Daniel Bojorge
See the development tools and look what path is it? So, put STATIC_URL = '/static/' in your settings.py and {% load static %} in the first link of your template. Dios L@s Bendiga Saludos, [image: --] daniel.bojorge [image: http://]about.me/daniel.bojorge

Re: Static image not getting displayed.

2019-04-02 Thread Agbonxoft Prince
Try loading static , if it's not loaded *{% load static %}* in the HTML page On Tue, Apr 2, 2019, 19:01 Sandip Nath wrote: > Downloaded an image of Django Reinhardt and saved it in static/images > folder as django.jpeg. In the settings.py file created a variable > STATIC_DIR and assigned it

Static image not getting displayed.

2019-04-02 Thread Sandip Nath
Downloaded an image of Django Reinhardt and saved it in static/images folder as django.jpeg. In the settings.py file created a variable STATIC_DIR and assigned it os.path.join(BASE_DIR, 'static') and again assign this variable to STATICFILES_DIR and kept the STATIC_URL as "/static/". In the

Re: Upgrading Django from 1.11 to 2.2

2019-04-02 Thread אורי
>From the page Tim linked: "If you’re upgrading through more than one feature version (e.g. A.B to A.B+2), it’s usually easier to upgrade through each feature release incrementally (A.B to A.B+1 to A.B+2) rather than to make all the changes for each feature release at once. For each feature

Re: Upgrading Django from 1.11 to 2.2

2019-04-02 Thread אורי
I accept Tim's advice to upgrade from one major version to the next. Even if I want to upgrade from 1.11 to 2.2, I have to upgrade first to 2.0 and then 2.1 and only then 2.2. It makes sense. אורי u...@speedy.net On Tue, Apr 2, 2019 at 4:44 PM Derek wrote: > I agree; and the reason for Django

Re: Upgrading Django from 1.11 to 2.2

2019-04-02 Thread Derek
I agree; and the reason for Django moving to LTS releases was so that you would be able to upgrade from one LTS to the next. Hence the OP (and others like me I am sure) asking how that can be done - we are looking for specific advice or instructions (and less about "general" guidelines). On

Re: Showing old data

2019-04-02 Thread Larry Martell
On Mon, Apr 1, 2019 at 11:12 PM Swetank Subham Roy wrote: > > Hello folks, > I have created a hosted a django web app on apache2 using mod_wsgi, the > content should automatically refresh everyday. But it is not getting > refreshed automatically. I need to manually restart or reload the apache

Re: I Am A Begginer Web Developer - Need Help With Finding A Term

2019-04-02 Thread nm
Hi Rok, I suppose you want to *list* all your posts :) List is where you display many instances on one page (and your url is e.g. `.../classes/`). And as you probably already know, if you want to retrieve just one post (or class, or whatever you call it), you need a detail view, and the url

Re: How to deploy migrations to production

2019-04-02 Thread Jani Tiainen
Hi. You should deliver migrations as part of your product and run them on production. Just like you do with collectstatic command you run migrate command. Eventually you will have data migrations and those you can't recreate on production. Also if you recreate migrations on production again

How to deploy migrations to production

2019-04-02 Thread Simon A
There is a workflow section in the migration page from the django project documentation. But there are somethings I am confused about, It says that the migrations need to be created in the non production environment and then checked in to the repository along with the changes in models.py. My

Re: Hosting recommendations please

2019-04-02 Thread RLM
Have you had a look at AWS? We have had success with it. Roger On 2/4/19 6:08 pm, Mike Dewhirst wrote: I have to move three Django websites away from my current VM service provider by the end of April because he is going out of the VM business. One is a plain Mezzanine CMS on one VM running

Re: Venv

2019-04-02 Thread PASCUAL Eric
Hi, pyenv (https://github.com/pyenv/pyenv) offers a simpler way for activating/deactivating venvs, by managing this automatically for you based on where you are located in the file tree. Before focusing on this feature, you must know that pyenv does far more than managing virtualenvs, since

Re: Hosting recommendations please

2019-04-02 Thread Joel Mathew
I'm running mine off a Digitalocean 1GB droplet, and one hobby site off Heroku. Heroku has some latency noticeable occasionally, but the digitalocean droplet is perfect. I will scale to better specs once I go into active production. It's working fine for upto 10 users now. Sincerely yours, Joel

Hosting recommendations please

2019-04-02 Thread Mike Dewhirst
I have to move three Django websites away from my current VM service provider by the end of April because he is going out of the VM business. One is a plain Mezzanine CMS on one VM running Nginx/Gunicorn and the other two are on the second VM running Apache and mod_wsgi. I'm most familiar