cookiecutter | CLI for quickly creating boilerplate files
kandi X-RAY | cookiecutter Summary
kandi X-RAY | cookiecutter Summary
A CLI for creating boilerplate files/folders based on templates you provide. Like Yeoman or Python's Cookiecutter but much, much simpler. It is designed for existing projects where you want an easy way to create boilerplate files - instead of having to copy paste an existing file & then remember to make the necessary changes. A good use-case for cookiecutter is, for example, creating a new Redux connected React component within a project. Not hard... but also not fun.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of cookiecutter
cookiecutter Key Features
cookiecutter Examples and Code Snippets
Community Discussions
Trending Discussions on cookiecutter
QUESTION
I am at a beginning of a "company web app project". I tried a Django cookiecutter template, and so far I like what I see. What I see I won't need is the user registration, password reset, social-app logins, and so on, because I will use LDAP for my user login. Afaik the stuff I don't need is provided by that "allauth" apps (please correct me).
What would be the steps needed to remove this functionality so I can have the authentication more like when starting a project via Django "starproject"?
I don't have any crucial data in the DB, or any models I care about, so instructions for a fresh start would be ideal.
MY idea was to remove the allauth apps from "APPS" in settings and only then do the initial migrations, but something tells me it won't be that easy. I am an intermediate python dev, but new to Django.
Thank you all in advance for your ideas.
...ANSWER
Answered 2021-May-20 at 10:32Allauth doesn't force any particular user model on you, so it probably will be that easy – remove the installed_app
, remove any urls
references, remove the package(s) from requirements.
QUESTION
Cookiecutter-django have endpoints /auth-token/ to get a token and /api/users/me/ for getting user info. But it does not seem to have a logout endpoint. Am I right?
And, if the serverside logout is needed, i will need to write it.
Can you confirm? Thanks.
...ANSWER
Answered 2021-May-03 at 18:58It looks like you are referring to the DRF part of the cookie cutter. There is no logout, what you want to do is write some endpoint that will delete/invalidate the instance of the respective Token
model from your database.
If you are referring to the non-DRF part, there is a logout at /accounts/logout/
.
QUESTION
How does running docker-compose -f local.yml up
create the postgres database in the postgres container with configurations in .envs/.local/.postgres
. I have looked through the Dockerfiles and cannot seem to find a command such as createdb
except in the maintenance/restore
file.
Cookiecutter-django: https://github.com/pydanny/cookiecutter-django
...ANSWER
Answered 2021-May-03 at 18:53The cookie cutter sets the environment variables which are then read by the Docker image. See Section How to extend this image > Environment Variables in the official docs: https://hub.docker.com/_/postgres
QUESTION
I am certain that this issue is down to my own ignorance of Python and pip, however, I have scoured the net and tried many things to get this to work, so far, to no avail.
I have a docker image based on the Bitbucket pipelines default image (version 2): atlassian/default-image:2
, which uses Python 2.7.x. And SAM doesn't work with that, I looked at AWS' documentation and this said that the SAM CLI no longer supports Python 2.7.x, so I removed all Python installations from the docker container (debugging the Bitbucket pipeline locally) and attempted to make sure that there was only Python3 and pip3 installed (I even setup symlinks from /usr/bin/python
to /usr/bin/python3
and from /usr/bin/pip
to /usr/bin/pip3
- although, that seems like such a dumb thing to have to do).
I also tried doing the above with Python 3.6, as the error message (shown below) seemed to show a Python 'f-String' syntax, which according to Python's docs was introduced in 3.6.
Nothing I do seems to work and the more I look at this, the more I get tied up in an seemingly never ending web of Python versions and linux packages!
The error (and python versions) can be seen here:
...ANSWER
Answered 2021-Apr-13 at 03:51In most cases, instead of modifying the python installation in an existing image or installing a new one, I would recommend just using a docker image that already has python 3 installed. This bitbucket page talks about using different base images.
There's also a page about using a python base image spectifically.
Aside from this, depending on how you want to use SAM, you may be able to use the builtin Bitbucket "pipe" for deploying to SAM instead. Here is some info on pipes.. I think this would bypass the need to install SAM in your build.
I haven't used that particular pipe myself but the way I think it works is you build your deploy artifact file in your pipeline, caching it so it's available in future steps, then you set that file as the input for the SAM pipe to deploy it. The SAM pipe runs in a separate container, so it's already installed in that container. You just pass in the file.
Finally, I have never used SAM, so take this with a grain of salt, but I don't see a reference to installing the CLI with pip
either on the official AWS Linux installation docs or on the github page. I did find this issue, from which I glean the following:
pip
installation is possible but not recommended- Python 3.5 is not supported by aws sam cli
- If you use the installer in the instructions, it sounds like it will take care of the python versioning for you.
- They would like to target a single version of Python, so if you use pip, maybe the latest or 2nd latest Python version will work. Just a guess...
QUESTION
I recently updated a django api from 2.2 to 3.1. I updated the dockerfile and related bash files like django-cookiecutter did https://github.com/pydanny/cookiecutter-django/commit/b22045bcd4ebf563ccdcf226fb389a6bb71e2654#diff-1872e6a6f0bbcb27f2eda185ac89eed05eb7a402b298e58bcbef29bf039c2c13
The upgrade mostly went well except now in production we cannot send email. I have a minimal management command I run in production to test email settings
...ANSWER
Answered 2021-Apr-04 at 14:06So in short, it's very likely your mail server only supports TLS 1.1 or even only TLS 1.0 and the slim-buster image no longer has support for those protocols.
Going back to 3.7-alpine (which is known working combination) or an older ubuntu/debian version which still supports those protocols will allow you to send mail again.
Then you should upgrade your mail server, cause both TLS 1.0 and TLS 1.1 should have died long ago.
Edit:
Another way to test your mailserver is to use openssl's s_client
command:
QUESTION
I could not find the code definition using Ctrl + click
when I use Docker
+ Django
in my project, since source code are now in container. How could I configure my VScode to enable code navigation?
I am using django-cookiecutter
with use-docker
configuration.
ANSWER
Answered 2021-Jan-28 at 18:02Python is not a statically typed language and the IDE or editor sometimes can't find the exact code definition.
See: vscode code navigation, also: Difference between statically typed language and dynamically typed language
QUESTION
I'm trying to build a pipeline for the standard AWS SAM HelloWorld template using Python 3.8. I'm using this template as a pipeline example. The only change I'm making to the pipeline is the Environment/Image which I'm changing from 3.6.5 to 3.8.3, like so...
...ANSWER
Answered 2021-Jan-02 at 12:09This is because it is trying to pull the new image from docker hub which has throttling enabled for pulling images. So what you can do is pull the image from AWS Public ECR and use the same in your environment.
There is another way for this you create your own ECR repo in the account and push the mentioned image to your own ECR and use that in the template.
QUESTION
I'm currently working on a django project built with django cookiecutter. I'm running both redis server and the redis client but anytime I run the django server it keeps giving the below error
...ANSWER
Answered 2020-Dec-17 at 08:12I think you need to setting.py Configure celery in the file_ BROKER_ URL, as follows:
QUESTION
Can anyone help me with to configure my django cookiecutter production setup to work with Gmail SMTP.
I have deployed my application using docker. Cookiecutter gives you to configure your app to anymail providers. I've chosen Mailgun however I didn't have an email address that has been verified by my domain provider. So, I couldn't register any user to my app because ( https://cookiecutter-django.readthedocs.io/en/latest/deployment-with-docker.html#configuring-the-stack) here it says you can't :)
I have tried to override the default email verification setting from "mandatory" to "none". However, it still threw 500. In below, I've added all-auth settings. I had to decide either to buy an email address or configure my app to work with Gmail Smtp or get rid of this email verification process.
settings/base.py
...ANSWER
Answered 2020-Nov-09 at 07:57You don't config email host and email from the sender. Try this
QUESTION
A fundamental question about the .gitignore list that's auto generated by django-cookiecutter. I suppose this it's best practice to ignore dist.
I am not a front-end/UI master but many javascript packages come with a dist folder which I just copy into the static folder. Is that a bad idea? Is there something I should know about files in a dist folder?
...ANSWER
Answered 2020-Oct-18 at 12:02The idea behind this is that you don't commit compiled resources into git as they should be generated at deploy/build time.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install cookiecutter
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page